- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
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,
Can you please shed some light on it? Thanks.
Solved! Go to Solution.
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:
Hope that helps. I'll make that this explanation gets added to our docs.
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.
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.
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:
Best,
Florian
05-07-2021 10:26 AM - edited 05-07-2021 10:27 AM
@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
.
Confirmed Mapping in Tag Template
Line 13 shows the mapping in the template.
Tracking Call in Google
See the call to uag.link()
and the resulting Google tracking call with en: form_submit
.
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:
In template:
Best,
Florian
@florian_perl That means either:
utag.#.js
) or by environment (/dev/utag.#.js
)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
@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?
Hi @oworsnop1 ,
This is the mapping:
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
07-30-2021 11:29 AM - edited 07-30-2021 11:41 AM
@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
.
07-31-2021 03:31 PM - edited 09-29-2021 12:49 PM
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!
@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.
Copyright All Rights Reserved © 2008-2023