Google Analytics duplicate purchase reports - google-analytics

We are trying to setup GA4 analytics without removing (at the moment) the previously setup UA, a scenario which is described on the official documentation :
[UA→GA4] Send events to both your UA and GA4 properties
Our problem is that specifically for the purchase event which is a default tag, we see duplicated reports in GA4 Ecommerce Purchases.
I suppose that this might be expected since we push 2 purchase events to the dataLayer as described in the following 2 docs for each version respectively:
Universal Analytics (Tag Manager) - Measuring Purchases
GA4 Ecommerce - purchase
It seems like the GA4 report is picking up both purchase events, despite the fact that we use a different model for each event push. So for example in the end we get :
One (1) purchase event with revenue $10.00 on UA reports,
Two (2) purchase events with revenue $20.00 on GA4` reports (which is wrong)
Is there any way we can use both UA and GA4 and be able to remove the duplicate purchase events on our reports somehow? Tried removing one of the 2 dataLayer push events but then one of the 2 reports (GA4/UA) is missing information.

Well, just make a CJS variable that would parse the event's content and indicate whether this payload has UA or GA4 structure. Then utilize the var as a check right in the GA4 EEC trigger. Actually, I would update the GA3 UA EEC trigger too, just in case it suddenly is able to consume the GA4 object.
But your general approach is sub optimal. How analytics agencies do this kind of job is by reusing the old UA DL pushes and sending the EEC payloads manually rather than through automated DL EEC tracking.
As benefits:
Your dataLayer still looks well and uncluttered by duplicate e-commerce information.
You don't bother front-end devs with extra work and it's easier to maintain
Much easier to introduce symmetrical changes especially when you want to introduce, say, a new product- or EEC hit-level custom dimension or metric.
Data parity does not depend on the front-end devs, only on the GTM config.
Less tags/triggers cluttering in GTM.
It's way-way-way faster to do it when you already have a template GTM container for such mapping. Not sure if the agencies share the containers yet though.
Cons:
A bit more code in GTM.
If GA3 breaks, GA4 will inherit the breakage automatically. Data parity is a double-edged sword.
I can't share my containers, unfortunately, but they look similar to this: https://github.com/gtm-templates-knowit-experience/ga-eec-to-ga4-ecom-converter/blob/main/template.tpl feel free to give it a shot and let us know if it does the trick.

Related

Google Tag Manager click event tracking working but not displaying anywhere

I have successfully created a GTM trigger and tag using the click_text parameter. When I preview and when I published the change both were successful in showing up on my Google Analytics 4 debug and real time tabs. I cannot seem to find a recorded total for this new tag trigger in either GTM or GA4 anywhere. Does this exist in either of these, or do I need to create an event in GA4 unrelated to what I set up in GTM. I have read most of Google's provided documentation on this specific step and it stops flat at this step of things.
Thank you in advance.
If you see your event in real time data report in GA, you're good. The data is in that property. It, however, is not yet available for aggregation, so you won't be able to count them or use them in other reports.
You should wait up to two days for the data to be in the non-real time reports. Vast majority of the data will be available for aggregation in one day, however. Some starts showing up in hours. GA 360 (paid version of GA) shortens the two days to four hours until all data is there.
I'd also suggest using Adswerve plugin for GA debugging: it will print all DataLayer changes as well as everything that is being sent to GA in the console. It's much more comfortable than using real time hits report and it will show you all dimensions that are being sent to GA.

Duplicate transaction under same transaction ID

I am having an issue tracking my transactions via Tag Manager.
I have a GA Universal Analytics Transaction tag which fires on transaction completes. All cool until here.
So I have added another tag to be able to record Checkout behaviour but suddenly I am getting double transactions for a single transaction ID.
Can an event populate the actual transactions in the Acquisition > Source/Medium data table? This second tag is an Event tag actually, so it confuses me a bit.
Sure (actually for some scenarios sending e-commerce events is even considered best practice, e.g. for product list tracking).
However this would send a transaction only when a purchase action is specified in your e-commerce variable (the one you specify in the E-commerce section in "Read data from Variable"). Unless this contains a purchase event your problem is probably elsewhere.
GA does not deduplicate transactions, so even a reload can potentially cause double transactions.
Is the screenshot you included of the second tag? If so, you'll likely want to remove or modify the ecommerce setting from that tag as GTM will populate the ecommerce reports with whatever data is in the EE Funnel Step 4 variable, even if it's the same data that has already been sent in a previous ecommerce beacon. So if EE Funnel Step 4 is sending an ecommerce purchase action and the same transaction id as your previous ecommerce beacon it would be counted twice in GA.

Google Analytics Ecommerce / Difference between 'ec:addItem', 'ec:addTransaction' and 'ec:send'

I would look for some feedback on tracking user activity on an commerce website using th google analytics commerce capabilities.
I can't fully understand those 3 parts :
Adding an item (ecommerce:addItem) : obviously when some user add a thing to the cart
Adding a Transaction (ecommerce:addTransaction) : that's where I'm very confused
Sending the data (ecommerce:send) : that's obvious
Can those 3 event append at a different moment ? in what manner ?
What would be a real-world use case that would make you use execute ecommerce:addTransaction and ecommerce:send at a different moment ?
This thing makes me wonder a lot, and I'd like to have some experienced feedback on this as you tend to easily break your stats if something is not done week enough
Thanks in advance
EDIT
So the main purpose right here is to get stats for the pending orders (you add stuff to your cart), and the complete orders (you paid for the things you added).
Right now I only send it all when the order is complete, and things are working pretty good in analytics, but I just don't know anything about the ones that did not complete.
This question was a lack of knowledge.
Simple ecommerce plugin has nothing to do with the enhanced ecommerce plugin
You won't track that much with the first one, except the checkouts. A plain, one order at a time, revenue value.
If you want a deep insight on your users behaviors (when i say deep, I mean it), You have to go for the second one.
We might be able to debate over the unusefullness of the first one; and the fact that its existence in itself compared to the second is completely misleading, as when you first get in, as usual with google, you get flooded by an endless documentation
ecommerce:addItem does not add items to a cart; it adds items to a transaction (with "conventional" ecommcerce tracking there is no cart tracking, you'd have to use enhanced ecommerce tracking. Actually your title refers to enhanced ("ec:") and your question to conventional ecommerce ("ecommerce:") tracking).
So ecommerce:addTransaction starts a transaction; here goes the stuff that affects the transaction as a whole, like transaction id, tax on the total purchase or shipping costs.
Now that you have started the transaction you can add items to it that are associated via the transaction id.
Finally the ecommerce:send command tells Universal Analytics that the transaction should be processed on the server. "send" is actuall a misnomer; addItem and addTransaction do already send data to the server (they each create an request to the tracking server and thus count towards your hit quota).
The reason for this is, as far as I can tell, that the information is transmitted via url parameters (you call the Google Analytics endpoint which returns an transparent pixel). The maximum length for an url request is limited (actual limits depend on browser and browser version).
So the transaction is broken up into multiple parts not because you want to execute the commands at different moments but so it can be transmitted via Url parameters without being truncated. The send command merely tells that you are now finished adding new parts to the transaction and the data can now be processed.

Querying Event Flow with Google Analytics API?

Using: Universal Analytics (analytics.js)
I am currently testing user experience across a site by triggering different events upon pageView. On a given pageView, multiple events may be triggered.
I am interested in determining what events (or sequence of events) may lead to a conversion being triggered. In the frontend, this can be achieved via Event Flow or Goal Flow visualizations. Unfortunately I could find nothing online regarding querying Event Flow specifically.
Is it possible to query Event Flow from the Google Analytics API? If not, are there any workarounds that would allow us to quantify impact from different flows?
There isnt a way of doing it with the API. I want to start by saying i havent tried doing this I am just going on what i would do if i did want to attempt to do this.
The flow apears to start with any of the normal dimensions country for example. My first idea was the ga:goalpreviousstep1 dimensiosn then i remembered they cant be queried with other dimensions.
I would look into ga:previousPagePath and ga:nextPagePath see what they come back with. queried along with your goal or event they might give you an idea of what the user was doing.

Google Analytics reports wrong goal completions and events count

I have this GA-tracked application that is not counting all my events and goal conversions. Events are correctly displayed in the Real-Time chart, but the reports apparently discard some of them. My goal completion counts are being incorrectly reported, too - for example, in a given day my user registration goal displayed less than 20 goal completions but I had almost 100 new users.
I am using Universal Analytics and my pageview count is still low compared to the GA threshold.
Any thoughts?
I also found few bugs and especially some events not firing properly. Hence, I move to old code again. Even in old code,” doubleclick.js” code not working for some Event Tracking. After I replace the code with old” ga.js” file all the event functions start to work without any modifications to the source code. Please stick with the old code for next few months.
Just check Avinash website (http://www.kaushik.net) , as we all know he is the digital marketing evangelist for Google. He is still using the old ga.js code. This tells that this new Universal Analytics code have some hidden bugs and they are testing the code with user experience. Hence this is not the time to fully depend on Universal Analytics. Sooner they will come up with updates and then it will be ok to move to Universal Analytics.

Resources