Google Analytics 4 Purchase event updates - google-analytics

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.

Related

Custom Event Tag not firing in GTM

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.

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.

Enhanced Ecommerce events from dataLayer are not sent

I'm working on the site that sells subscriptions.
On /subscribe page, there's a list of available subscription plans, that I push to Analytics as product impressions on page load using dataLayer syntax. On clicking the plan, its details are shown, so it'd be natural to send "productClick" in click handler. This info is sent to GA, but then product details is shown on the same page, changing the location hash.
GA documentation gives the only example on how to track product details given page view, but we don't actually have one here. Is there a way to manually send product detail?
In addition, there's a user flow which involves showing the same /subscribe page in an iframe. I'd like product impressions to be sent to GA too, but, once again, when I push to parent.dataLayer, the data is not sent to GA.
Also, clicking on plan maps to addToCart event, so I'd like to send it as well, but somehow what goes through is only a "productClick". Is there a way to push both "productClick" and "addToCart" events at the same time?
"Is there a way to manually send product detail?"
You need an interaction hit to send the data with Google Analytics. Plus the data must be available before (or alongside) the GTM event (be it native or a custom event in the datalayer) is fired, since GTM updates its internal data structure from the datalayer variable when an event occurs.
In your case, since the location hash changes you might be able to use GTMs history change event handler (or you push a custom event with your product data) to fire a Google Analytics event that sends your e-commerce data. Conceivably you could event do a pageview with a virtual pagename if the content changes enough to warrant to be counted as a new page.

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.

Google Tag Manager and Single Page apps

I'm trying to integrate Google Tag Manager with my Ember app. I'm having a hard time understanding how to notify GTM that the page changed, and send a page view event.
I've read a lot of things online, mostly working around creating a new variable for a "virtual page" or something, but obviously this is far from ideal.
I'd like to be able to just use dataLayer.push to notify the page actually changed. Is there an easy way out I didn't find or is it really a pain to track with GTM on SPA?
This was asked quite a while ago. With the current feature set of GTM, you can easily set up SPA page tracking without much trouble.
First, go to Triggers and create a new trigger. Select History Change as the trigger type. This will create a trigger that fires every time the location history changes.
Then create a new Tag of Universal Analytics type and set it up as per the screenshot below.
[
As for the trigger, set the previously defined History Change trigger, and you're done. Every time a navigation occurs in your SPA, a page view event with the proper page path will be triggered.
EDIT: as trognaders pointed out in a comment, this does not track the initial page view. To remedy, simply add an additional trigger for your tag that fires on the Page View event (All Pages). See screenshot below.
You definitely need to push events into the dataLayer which you can then trigger a GA page view tag in GTM. So to push an event into the DL:
dataLayer.push({'event':'virtualPageView'});
Then setup a trigger called 'vpv' which fires on a custom event called 'virtualPageView'. Add that trigger to a GA tag.
The best thing to do is also send through the details of the virtual page when you send the event. This way you can set up variables that pull these dataLayer property values into the page view call. So you might do this:
dataLayer.push({
'event':'virtualPageView',
'page':{
'title':'contact us',
'url':'/contact'
}
});
So you'd setup a variable called 'DL- page title' (for example) which is a dataLayer value of 'page.title' and another variable called 'DL - page url' which is a dataLayer value of 'page.url'.
You then setup a new Universal Analytics tag which has all your usual pageview settings but with 2 'Fields to Set' (under More Settings). Set 'title' to {{DL-page title}} and 'page' to {{DL - page url}}
Finally set the trigger to 'vpv' and you'll find everytime you push the event + data into the datalayer you'll get a pageView fired off with your virtual page's title and virtual url.

Resources