- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
10-26-2022 06:43 AM
Hey All - hope somebody can help out.
I'm working on GA4 migration and I've stumbled upon an issue with getting the events setup right.
I've read the main guideline (https://community.tealiumiq.com/t5/Client-Side-Tags/Google-Analytics-4-GA4-Tag-Setup-Guide/ta-p/3528...) and respectfully, it is useless in that part.
There were some similar tickets before, one ( https://community.tealiumiq.com/t5/Developers/Has-anyone-implemented-the-new-GA4-aka-App-Web-in-Teal...) here that got me on a good track, but I need something more of a step-by-step guide.
So, what we have is this UGA event:
event_category: 'Web Vitals',
event_action: wv_event.name, //e.g. "CLS"
event_label: wv_event.id, // e.g v1-1619158612.....
event_value: Math.round(wv_event.name === 'CLS' ? wv_event.delta * 1000 : wv_event.delta),
And what I want for GA4 is:
event_category = event_name
event_action = parameter1
event_label = parameter2
event_value = parameter 3
Is there anyone here who would be so kind and help me do the event code and show how to do the mapping?
I'd be sooooo thankful!
11-09-2022 02:12 PM - edited 11-09-2022 02:16 PM
We were in a similar position and we weren't able to *easily* take a data layer value and send it as a custom event because of how event triggers work in Tealium iQ.
Basically, it seems like you can only map events to previously declared "Event triggers" inside GA4's tag mappings as shown here:
Essentially you need to map a certain trigger value from your tealium_event UDO data layer key to an event_name. This event_name, however, can't be dynamically set so you can't just take your old UA Event Category and send it that way. At least, I couldn't really find a way to do it.
The work around we eventually found was using a tag-scoped Sat Data Value extension that sets tealium_event to a "custom_interaction" value whenever the UDO variables for Event Category, Event Action and Event Label were populated:
Then we map an event trigger to tealium_event = "custom_interaction" that sends a "custom_interaction" event:
Finally, it's just a matter of mapping the Event Category, Event Action and Event Label variables to event-specific parameters inside the tag:
When it's all set up it should look like this:
Hopefully this helps. If you really need to map your event_name to the value of Event Category then you could probably do it modifying GA4 tag's template.
I personally opted not to because we are trying to deprecate these events anyways and I didn't really want to have to deal with a custom tag this early in GA4s life cycle.
Copyright All Rights Reserved © 2008-2023