GOOGLE ANALYTICS: UA Property Not Passing Event Data to GA4 Property - google-analytics

I'm working on setting up GA4 properties for some of my clients. I've noticed some of the UA properties that have events set up in Tag Manager are not passing event data to the GA4 property.
For reference, I updated the data stream settings in GA4 to collect UA events. The setting is located under admin>data streams>client website stream>additional settings>more tagging settings. (Screenshot below.)
I'm wondering why event data is not going into GA4? The client has events already set up in Tag Manager. However, the tag type is UA and not GA4. Should I set up an additional event in GTM with a GA4 tag for the same event action?
Collect UA events setting
Current GTM Event Tags

The collect universal analytics events is only collecting the event from
ga() function, not from the Universal Analytic tag in the GTM.
I am afraid that you will need to set up the tags again for all the events for GA4.

Related

How can I add custom dimensions to a Universal Analytics tag in a server-side GTM container that receives its hits from a GA4 tag?

This is my situation:
A client-side GTM container contains a GA4 tag that sends its hits to a server-side container containing custom event parameters, e.g. page_type
A GA4 client in that server-side container that receives these hits
A Universal Analytics tag (among others) in that server-side container that forwards the hits
How can I add the value of page_type to the Universal Analytics tag as a custom dimension?
It turns out you can use x-ga-mp1-cd1 in the “Override Fields to Set” to achieve this, as mentioned here by Simo Ahava.

How can I override event action for a Universal Analytics tag in a server-side GTM container that receives its hits from a GA4 tag?

This is my situation:
A client-side GTM container contains a GA4 tag that sends its events to a server-side container containing event_category, event_action, event_label and non_interaction event parameters
A GA4 client in that server-side container that receives these events
A Universal Analytics tag (among others) in that server-side container that forwards the events
event_category, event_label and non_interaction are correctly translated to ec, el and ni in the outgoing HTTP request, but somehow event_action isn’t. ea is populated with the value of event instead.
I’ve tried explicitly creating an Event Data variable for event_action and mapping that to event_action in the server-side UA tag, but that didn’t change anything.
So, how can I override event action for a Universal Analytics tag in a server-side GTM container that receives its hits from a GA4 tag?
Found it: It looks like you can override any of the parameters of the outgoing HTTP request by adding x-ga-mp1- plus the parameter to “Override Fields to Set” in the server-side Universal Analytics tag. So in my case that means x-ga-mp1-ea and a couple more:
(Figured this out when trying to add a custom dimension.)

Push data to dataLayer and send it to Google Analytics at the same time in Google Tag Manager

I have a complicated issue with GTM, dataLayer and GA.
My setup is:
GA tag is triggered in PageView with Enhanced Ecommerce enabled by using dataLayer
A Custom HTML tag which pushes an item to dataLayer, and it's configured to run just before the GA tag (by using tag sequencing)
Problem is; GA is not including dataLayer changes made by custom Tag even if it's fired after Custom tag.
I noticed, dataLayer.push(...) creates a new GTM event named message.
How can I handle this, GA pageview tag must have the final dataLayer.
tHanks
The datalayer is not re-evaluated in a tag sequence. However you can manipulate the dataLayer directly.
First you need to make sure that the built-in "Container ID" variable is active (or you pass in the ID manually).
Then you get a reference to your GTM instance and call a dataLayer.set with a key and value:
var gtm = google_tag_manager[{{Container ID}}];
gtm.dataLayer.set('someKey',"someValue")
Unlike a dataLayer.push this will be available in the next step in the sequence.

When deploying GA in GTM, when should the script should be fired?

Should it fire during gtm.js, gtm.dom gtm.load, or does it not matter? Google support didn't have any recommendations https://support.google.com/tagmanager/answer/6107124?hl=en.
Firing the main GA tag should be done at Pageview which is the default for the built-in All Pages Trigger. This is normally completely fine. The only reason to change this is if your data depends on elements on the page to be present.
For example: If you are using a tag of type Transaction you should set the trigger to DOM Ready because GTM will otherwise not be able to pick up the dataLayer transaction.

Google Tag Manager tag is fired but event does not show up in Google Analytics Real Time Events Tab

I have created a tag which fires when the click url contains certain words. When I view the website in GTM debug mode the tag is getting fired. But the event is not getting captured on Google Analytics Real Time Events.
The following is the screenshot of my tag and trigger.
Will the real time events in Google Analytics not show until I publish the changes in GTM?
What the possible problems you may have(as you are saying your tag is firing and IP was not filtered in GA:
Your tracking ID for GA is incorrect(or you are checking data in the wrong GA property): your tag config looks correct, so data should be sent to GA(as you are saying GTM trigger works fine);
Trigger name is hidden, but looks like trigger type is "Click". Make sense to check if option "Wait for tags" was enabled. If this option is disabled and after click user redirecting on another website page, GTM may not have enough time after click and before redirection to send data to GA. And your tag will fire, but data will not be received to GA.
I had the same problem. It ended up being a double up in the GA id. I had used a constant variable to define the GA property but not removed the ID itself.

Resources