How to setup a Custom Event in GA4 using Javascript code extension in Tealium IQ

Bronze Contributor
Bronze Contributor

@developers@Tealium - I would like to set up a custom event for GA4 to track the Clicks on different Navigation links on a web page and additionally track some parameters along with the custom event. 

When following below steps, I dont see the Custom Event triggered in GA4. Any suggestions, please ? 

1. The custom event details like Event Name, Event Parameters are setup in the GA4 Property first.

2. On the GA4 tag in Tealium IQ, "tealium_event" datalayer variable is mapped to Custom Event Name using the "Event Trigger" option. And the Data variables for event parameters are setup using the "Event Specific Parameters" mapping the custom event. 

3. I have tried using Javascript code extension and jQuery onHandler Extension at Dom Ready scope to fire the utag.link method. But the GA4 custom event is not firing in utag.js. 

utag.link({ tealium_event: 'global_navigation', _ga4_param1: 'Click', _ga4_param2: 'contact-us-page' });

 

SV
1 REPLY 1

How to setup a Custom Event in GA4 using Javascript code extension in Tealium IQ

Tealium Employee

If your link event is actually triggering and the tag is not firing, I would check the mappings to ensure they are set up as follows:

Event Name

The mapping should show as "tealium_event" --> global_navigation:global_navigation where the value after the colon is the name of the event in GA4 (the value before the colon is the variable's value that will trigger the event. In this case, when "tealium_event" equals "global_navigation", the GA4 "global_navigation" event will be sent to Google.

Event Params

The event-specific parameters use the event name first, then the param name second:

"_ga4_param1" --> global_navigation.param1

In this case, the value of "_ga4_param1" will be sent to the parameter named "param1" with the "global_navigation" event. You'll want to make sure your param names align with the names configured in GA4 or Google won't know where to put the data.

If you need assistance beyond this information, I would suggest submitting a support request through our support portal.

Jen Kaye
Senior Premium Success Engineer | Tealium, Inc.
Public