Custom event names in GA4

Gold Contributor
Gold 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

18 REPLIES 18

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

Gold Contributor
Gold 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

Gold Contributor
Gold 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

Gold Contributor
Gold 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

Gold Contributor
Gold 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

Bronze Contributor
Bronze 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

Gold Contributor
Gold 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

Bronze Contributor
Bronze Contributor
Thanks Florian, you're a lifesaver!

Custom event names in GA4

Silver Contributor
Silver Contributor

@florian_perl 

How to set up form_title and form_type?

Thanks!

Best,

Sabrina

Custom event names in GA4

Community Manager
Community Manager

@Sabrinaj When selecting the vendor parameter, you can click the parameter name to edit the data mapping. In this case, go to the Event category of vendor parameters, click Custom Event Data (event.custom), then click the parameter name to change event.custom to event.form_title .

ga4-custom-event-data-mapping.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

@TealiumJustin 

Thanks for your reply and the screenshot. Very clear and helpful!

Do we still need to register this parameter at GA4 UI as dimension as well ? (It seems if we use Google tag manger, we need to register custom parameter in GA4 from UI as dimension )

BTW I also try to sent a custom event to GA4. So, here is the case: When I search from home page, I can reach to a search results page.Data layer variable is "page_name", value is "search results", and then I can name the event as "Search_from_homepage" and send this event to GA4 right?

I saw purple varables "clean_page_name", and "page_name".  Which one I should select?

Thank you very much!

Custom event names in GA4

Community Manager
Community Manager
Yes, you need to register these custom parameters in GA4. More info here: https://support.google.com/analytics/answer/10075209?hl=en

Your search results mapping looks correct. Make sure the value in the data layer matches exactly to the trigger value in the mapping. In your example you used "search results" and "Search Results".

You should contact someone who works in your account to understand the intended usage of clean_page_name and page_name.
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, Justin,

Your reply is very helpful!
Thank you very much!

Sabrina

Custom event names in GA4

Bronze Contributor
Bronze Contributor
Hello, one question:

What about sending multiple events in a single call?

In Adobe Tag you can have the tealium_event variable like the following:
tealium_event: ['event1', 'event2']
And trigger one different event for each value in tealium_event.

In the GA4 tag, we see that it compares the string value off tealium_event, so I don´t really see if there is a way to trigger multiple events in a single call.

Thank you

Custom event names in GA4

Bronze Contributor
Bronze Contributor

@TealiumJustin is it possible to use a dynamic value substitution

@@tealium_event@@

 for the custom event name? I would like to avoid hardcoding any custom names where possible.

Public