Custom Event Tag not firing in GTM - google-tag-manager

Completely new to GTM and having trouble getting ecommerce conversion tracking to work on GA4. This is what debug mode looks like in GTM the tag doesn't fire. Does anyone know what could be causing the issue?
Have research all the possible reasons, checked the source code, spoken with the developer who added the GTM container to the site, reviewed the tag itself but still none the wiser.

Look at the trigger is waiting for a datalayer event : add_to_cart.
So you need to ask the developer to push a datalayer event with ecommerce item when user successfully perform an add_to_cart event.
Here is the detail about all ecommerce event and its datalayer.
https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtm
You have done half of the job. The there is still another part need to be done.

Related

Tracking purchase after user returns from external payment

I have a hybrid app where the store is built on Webview the rest is native mobile. Users access the store via the menu button.
Since the store is web, I set up dataLayer variables where I have user information such as nickname, id, etc and also an ecommerce object where the items in the store are shown. I have also added dataLayer events such as view_item, process_purchase and purchase_completed.
I have integrated GA4 and GTM and I pass all dataLayer variables as event parameters so I can have organized.
The main problem is that, when users pay their order via card, they are taken outside the website to the payment provider solution, and then once the payment is finished, they return to the payment confirmation page where I set up the "purchase_completed" dataLayer event. This appears to break the tracking of the funnel, so sometimes purchase_completed event does not fire, or sometimes it fires but empty (no data on datalayer).
Is there a way I can fix this issue?
To me, your problem sounds rather shop related, than GTM related.
If your DataLayer.push event is malfunctioning (either empty or not firing at all), you need to your code.
GTM does not care for a funnel, if the dataLayer event fires and both trigger as well as tag are setup corretly, the tag is executed.

Google Analytics 4 Purchase event updates

We have noticed purchase events in our Google Analytics 4 report coming through in Realtime as 'ecommerce_purchase', rather than 'purchase', as it has always been:
We have not updated anything within the GTM container or the GA4 report. The GTM Purchase tag continues to reference 'purchase' as the event, and is untouched:
Up until last Friday (16/01/21) our report was only ever receiving a 'purchase' event until this weekend where this new 'ecommerce_purchase' is now being tracked. It seems intermittent, where we can see 'ecommerce_purchase' in the GA4 Debugview, then run the same test a minute later where we then see 'purchase' as the event tracked in Debugview.
The dataLayer and code have remained untouched. When testing ourselves and viewing the tags fired in the GTM Preview, the 'purchase' event triggers our GTM tag, and the dataLayer displays all information from this event with no mention of 'ecommmerce_purchase'.
Would anyone have any idea as to what is causing this? Or, is anyone experiencing this as well?
Any help is much appreciated.
Thanks!
You might want to check in your Create Events/Modify Events to see if someone created a new event based on the purchase event or modified the purchase event coming in and renamed it to ecommerce_purchase.
Go to All Events > Create Events or Modify Events to see if any have been created.

Google Tag Manager dataLayer variables are undefined

When my page is displayed, I push some data to Google Tag Manager (GTM) dataLayer:
dataLayer.push({
event: "MY_EXPERIMENT",
variant: "A",
result: "FORM_DISPLAYED"
});
When the form is submitted, I push some new data:
dataLayer.push({
event: "MY_EXPERIMENT",
variant: "A",
result: "FORM_SUBMITTED"
});
I've created dataLayer variables in GTM, and I've inserted those in the category/action/label fields of my tag in GTM. One of the variables is setup like this:
The tag is triggered by URL path, and in preview mode it works.
However, when I look the event up in the live dashboard of Google Analytics, only "undefined" is displayed in the category/label/event columns. It seems to me the variables are not set up correctly, but I've looked through everything and it seems just fine.
What am I doing wrong?
It's hard to tell without any screenshots or further details but what's most likely happening is that your tags are firing too early. You said that the GA event tag is triggered based on a URL path. This most likely means that you're using the All Pages trigger in GTM with an optional filter to only fire on specific pages. However, you're most likely only executing those dataLayer pushes after the GTM container code. This means that at the time of tag firing, those dataLayer pushes haven't executed yet and that's why you're getting undefined in the values of the variables.
To fix this you should change the trigger of your GA event tag from All Pages to a Custom Event. In your case, the custom event name would be MY_EXPERIMENT.
I figured this out. I hadn't checked the "Use Datalayer" checkbox under More settings -> E-commerce in my event tag in GTM. Hard to find the checkbox, and I haven't seen it documented in any tutorials. But that solved my problem!
Sorry for no screenshots.

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