GA4 - converting existing UGA tags into GA4 events - what do do in extensions - what to map in tags

Bronze Contributor
Bronze Contributor

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. 
Currently, all the events that are sent to UGA come from a custom javascript that calls are the UGA variables such as event category, event action and event label. I would like to convert that into the format that would be compatible with GA4. Now, I now that also involves mapping the correct variables. 

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: 

utag.link({
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),
event_is_noninteraction: true,
event_transport: 'beacon'

 

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! 

1 REPLY 1

GA4 - converting existing UGA tags into GA4 events - what do do in extensions - what to map in tags

Bronze Contributor
Bronze Contributor

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:

mappings.png

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:

custom_i.png

Then we map an event trigger to tealium_event = "custom_interaction" that sends a "custom_interaction" event:

event trigger.png

Finally, it's just a matter of mapping the Event Category, Event Action and Event Label variables to event-specific parameters inside the tag:

mapping parameters to event.png

When it's all set up it should look like this:

event mappings.png

 

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.

Cheers,

Joaquín V.

Public