Closed agcty closed 1 day ago
Thanks for the contribution @agcty (you are the first!). I'm away for a week; I'll take a look soon and merge if ok. Thank you; free l feel free to add some more 🙏
@agcty I've looked into this and I've made some changes to handle the vagueness of the WebMC event and how Zaraz is currently sending the payload.
name
is not always there
type: 'track',
defaultPrevented: false,
cancelable: false,
timeStamp: 483.952333
}
I've made some changes to your suggested code to allow it to handle both.
Done in ef6a8ebe99f77d6b5bb7436feeb0c8e4c31b4769 (as I don't have edit rights on this PR).
First of all, thanks for taking time to create this managed component! Very valuable work.
Current behaviour Currently, when you track an event, the name that shows up in the posthog dashboard will always be "event" which doesn't make sense.
Expected behaviour Instead of the type that is now used as the event name, the actual event name should be used as described in the docs: https://posthog.com/tutorials/api-capture-events
Then you'll also be able to see the correct event name in the ph dashboard:
Shortcomings of this PR
1 test case currently fails but it's too complex for me right now to dig into.