-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event properties not being sent to Amplitude #525
Comments
Hi @AndreiIl, thanks for using amplitude SDK. |
@yuhao900914 yes, I created a source with the Typescript Runtime, added an event in the tracking plan, and added the source to the event. ampli --version |
@AndreiIl , how does the function method |
cc: @qingzhuozhen @justin-fiedler, any other thought you might have related to this issue? |
Is this for any custom event for Typescript Browser? @yuhao900914 Maybe check on the examples and pull with demo see if anything changed. |
I ran the Browser TypeScript Ampli Example and it tracked event properties correctly with the same code. Is this happening for all events or just one in particular? It will be helpful to know the exact property types on MyCustomEventProperties. We have different codegen based on different property scenarios. |
@yuhao900914 so what ampli generated for me when using pull is the code below ( note that in my example
@qingzhuozhen tried with only the above event so far but don't see why it would work for others. Could try a few options to validate/ narrow down the issue if that helps. @justin-fiedler DictionarySearchProperties has 3 properties, an optional string prop, a mandatory field accepting an enum with 3 possible string values, and another mandatory field that accepts any string. |
Hi @AndreiIl, sorry for the delay. I think we finally found the root cause of the issue - minification. Another customer was using webpack and babel to compile and minify their code. Their https://babeljs.io/docs/en/babel-plugin-transform-classes I opened a ticket to also fix the issue on our end (based on your suggestion) but hopefully this can unblock you for now. I'll update you once the fix is released. Thanks! |
This also seems to be a known issue in babel that has since been fixed. |
Abstract
Events are being triggered from inside my app using the correct properties as defined in the Tracking Plan but they are being logged as invalid as the properties are not being sent.
Environment
"amplitude-js": "8.18.1"
"@types/amplitude-js": "8.16.0"
Chrome: 100.0.4896.127
Repro steps
Observations
Neither the
ampli.customEventName(props)
nor theampli.track(new CustomEventName(props))
worked, both of them failed to register the attributes and were marked as invalid because of itWhile debugging noticed that when calling the
track(new CustomEventName(props)
) the event object only has the event_type prop set, while event_properties is not, which could indicate an inheritance issue, as the CustomEventName class implements BaseEvent but only relies on the constructor to set the event_properties, which it does not.If inside my custom event class definition (inside ampli/index.ts), I add the assignment of event_properties to this.event_properties inside the constructor, the issue is resolved, eg:
becomes
Please let me know if I should provide more info about the issue and thank you for looking into this.
The text was updated successfully, but these errors were encountered: