- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
Hi, we just started using tealium with mixpanel.
We have multiple custom events in mixpanel and I'm wondering how to setup this with tealium's utag.
What we used to do is something like:
mixpanel.track('eventName', { ...eventProperties })
Now, if I'm understanding this correctly the way to do this with tealium's utag is something like:
utag.track(tealium_event: 'track', ...eventProperties)
In the previous example it's unclear where to specify the custom event string.
Anyone know show to specify this custom event string?
Thanks :)
Here is a link to a previous post that may help:
https://community.tealiumiq.com/t5/Tealium-iQ-Tag-Management/utag-track-method/m-p/24578
Additionally here is the documentation for the tracking events:
https://docs.tealium.com/platforms/javascript/track/
Please let me know if this helps.
I just realized that you may have been asking how to trigger events within the MixPanel Tag within TiQ:
In your example, you want to send an event like:
mixpanel.track('eventName', { ...eventProperties })
This can be achieved through Data Mappings. For example, if you wanted to track when a user adds something to their cart and also pass the product_id here are the steps:
Let's say when a customer clicks add to cart on the site, an event listener triggers a utag.link event and passes this object:
{
tealium_event : "cart_add",
product_id : ["123456"]
}
Knowing this, within Tealium we can configure the MixPanel to send that event like so:
1. Open the Data Mappings within MixPanel and choose the variable tealium_event and within the mappings:
tealium_event
equals cart_add
2. Next, we can pass an event name, within this example, we can use cart_add
, since that is also the name of our event.
tealium_event
from the dropdowntealium_event
will be associated with, in this case Tracktealium_event
is assigned within that event, in this case, Event Name3. Lastly, we will want to configure product_id
to be sent whenever the cart_add
event occurs.
product_id
from the dropdowntealium_event
will be associated with, in this case TrackIn the second dropdown, we can choose where cart_add
is assigned within that event, in this case, Event Name
After we complete the data mappings and publish. When a user clicks on an Add to Cart Button, the tag will fire and pass this event:
mixpanel.track('cart_add', { product_id : "12345" })
If you want to look at the Tag Template, it may help you get a better idea of how the code is being processed, for example here is the mixpanel.track function at work:
To view the tag template, it is within the Advanced Settings of the Tag Configurations.
https://community.tealiumiq.com/t5/iQ-Tag-Management/Managing-Tag-Templates/ta-p/21713
Good luck and let me know if that helps.
Thank you, this was really helpful and something I didn't find in Tealium's documentation.
Looking at the template was also super helpful and it's bit difficult to get there as a first time Tealium user.
Hope y'all can add this to Tealium's documentation, thanks!
Copyright All Rights Reserved © 2008-2023