Custom event names in GA4

Silver Contributor
Silver Contributor

Hi All,

Do you know if there's a way to send custom GA4 events, for example: 

event_name: 'custom_event'

Custom event naming is a key feature in GA4, so anyone setting up GA4 in Tealium will sooner or later face it.

In the Mappings, there is "trigger" entity referring to a custom event, but I can't figure out how it is supposed to work. Namely,

  • what should be mapped to it (static text? variable?)
  • what to add in the "Trigger" field

Can you please shed some light on it? Thanks.

undefined

11 REPLIES 11

Custom event names in GA4

Community Manager
Community Manager

Hi @florian_perl For events you usually want to map the data layer variable that captures your event names. In most cases this is tealium_event . The "Trigger" is the value of that variable in the data layer that corresponds to what you're tracking. The "Custom Name" is the GA4 custom event name.

For example, if your data layer has this:

var utag_data = { "tealium_event" : "my_event_name" };

Then your mapping would look like this:

ga4-custom-event-mapping.png

Hope that helps. I'll make that this explanation gets added to our docs.

Remember to "Accept as Solution" when your question has been answered and to give kudos to helpful replies.

Custom event names in GA4

Silver Contributor
Silver Contributor

Hi @TealiumJustin,

Thanks for your response. So, if I want to fire the tag on a utag.link() event, e.g.

utag.link({
  event_interaction: "form submit",
  form_type: "contact"
})

then how do I go about it? utag.link() does not affect utag_data.

Custom event names in GA4

Community Manager
Community Manager

Hi @florian_perl In that case, the data layer variable to map is  event_interaction  and the trigger value is "form submit". Variables in utag_data and variables passed to utag.link are both variables that you map in a tag.

Remember to "Accept as Solution" when your question has been answered and to give kudos to helpful replies.

Custom event names in GA4

Silver Contributor
Silver Contributor

Hi @TealiumJustin ,

The following does not seem to work. Can you have a look please?

For the link event: 

utag.link({
  event_interaction: "form submit",
  form_type: "contact"
})

with an intention to send a GA4 event 'form_submit', I tried the following:

tealium_ga4_mapping.png

Best,
Florian

Custom event names in GA4

Community Manager
Community Manager

@florian_perl Here's my setup and a screenshot showing the resulting GA4 tracking call.

Data Mapping

Same as yours, except I used tealium_event.

custom-event-mapping.png

Confirmed Mapping in Tag Template

Line 13 shows the mapping in the template.

custom-event-triggered.png

Tracking Call in Google

See the call to uag.link() and the resulting Google tracking call with en: form_submit.

ga4-custom-event.png

Remember to "Accept as Solution" when your question has been answered and to give kudos to helpful replies.

Custom event names in GA4

Silver Contributor
Silver Contributor

Hi @TealiumJustin , 

Thanks for the details - unluckily I can't see the u.map part of the template at all. Is there anything else apart from the mapping that needs to be done?

In tag:
tag.png

In template:
template.png

Best,
Florian

Custom event names in GA4

Community Manager
Community Manager

@florian_perl That means either:

  1. It's the wrong utag file, either by number ( utag.#.js ) or by environment (/dev/utag.#.js)
  2. The tag has not been published.
Remember to "Accept as Solution" when your question has been answered and to give kudos to helpful replies.

Custom event names in GA4

Silver Contributor
Silver Contributor

Hello @TealiumJustin ,

I've created the tag from a scratch and the mapping works fine - thanks for your support!
It may be useful to update the guidelines page with what you've shared here.

(I've also figured out how to send GA4 parameters, so I'll spare you another ticket :D)

Have a great day,
Florian

Custom event names in GA4

Rookie Contributor

@florian_perl I am struggling to figure out how to send GA4 parameters. Would you able to share a quick guide when you get time?

Custom event names in GA4

Silver Contributor
Silver Contributor

Hi @oworsnop1 , 

This is the mapping:tealiumiq000.png

 

 

 

 

 

 

 

Input:

utag.link({
  event_type: 'form_submit',
  form_title: 'summer promo',
  form_type: 'contact'
})

GTAG equivalent:

gtag('event', 'form_submit', {
  'form_title': 'summer promo',
  'form_type': 'contact'
});

Best,

Florian

Custom event names in GA4

Rookie Contributor
Thanks Florian, you're a lifesaver!
Public