Duplicate transaction under same transaction ID - google-analytics

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.

Related

Google Analytics purchase event - track time with date

Does the time get stored with the date OOTB with the Google Analytics 4 (GA4) on eCommerce events?
On my company’s implementation when I look at the data stored to e-commerce events, like the purchase dimension, everything is showing as occurring at 12am. Do you know why this is? Is it a config issue or the way I am connecting?
I’ve seen posts where people create JavaScript variables to track time in GA4 and save to a dimension but this makes no sense given the high cardinality of time. I would have thought it would be more efficient to store as a datetime data type and track as part of the GA4 application.
Does anyone here see the time an event occurred on GA4 eCommerce events?

Google Analytics duplicate purchase reports

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.

Multiple custom metric hits issue with GTM/GA transaction

I track eCommerce transactions with GA and GTM, and trying to create a custom metric which will count how many people are involved in each transaction.
So I created a hit-scoped custom metric and try to pass its value along with the transaction tag in GTM:
Please see screenshot here:
As we know, a transaction in GA is a series of hits: one "transaction" hit and one or more "item" hits. The problem is that GTM sends the custom metric value with ALL of the hits, not just with one. So when I use my hit-scoped metric to measure something, it's measured more than once.
For ex., in a transaction where 2 people are involved, this value (2) is send twice (once with "transaction" hit, once with "item" hit) and in the GA reports I see figure 4 (instead of 2) associated with this transaction.
I didn't find a way to ask GTM to send the custom metric just once.
Am I missing something here? Any suggestions?
Thanks!
You can use a separate tag with the custom metric information, which is triggered on the same event as the transactions. This will create another request to GA, which isn't the best solution in terms of performance.
Maybe you can combine this information with a tag, which is already triggered on the same page? An "all pages" Universal Analytics tag is maybe present and has the information {{QuantityOfInsured}} available at the time the "all pages analytics tag" is triggered.

Are addTransaction and addItem totally separate from each other in Google Analytics?

I'm using Google Analytics with an ecommerce site and the data is being sent to GA, which is cool, and I'm looking in the Conversions > Ecommerce > Transactions section. When I click on a Transaction ID to view it, it doesn't show the individual items that I know where in that transaction but it shows the revenue. But then I noticed that further down the line, there are other Transaction ID's that when I open up, display the individual item or product info without any revenue tied to it.
It's like the data that is part of addItem is completely separate from addTransaction, even when looking at the reporting results. I assumed that the transaction was a parent element and all of the items purchased within that transaction were child elements and it would display/report that way.
Is there a way to mesh these together so that I can view the transaction ID with all of it's child items?
It sounds like you are only using ecommerce:addItem in you site code, when you also need to specify the total in an ecommerce:addTransaction tag.
If you only call ecommerce:addItem, Google will automatically create a blank transaction (with no total amount) based on the transaction_id required in addItem.
From Google's documentation:
Note: While most implementations will send both transaction and item data, you can send transactions without items, and items without transactions. If you send an item hit without a transaction, a transaction hit with only the ID will be sent automatically.
Transactions are not just the automatic sum of Items because some charges (like tax, shipping, or even "gift-wrap" for example) might need to be added to the total at the transaction level, but don't correspond to individual items.
As long as you ensure you fire both ecommerce:addItem calls and ecommerce:addTransaction calls using the same transaction id before you fire ga('ecommerce:send');, everything should show up in Google Analytics the way you are hoping.

Submitting eCommerce analytics to Google Analytics prior to completing transaction

We're using Google Analytics to track transactions, products, browser data, etc on our shopping cart. I am interested in pushing some data to GA prior to completing the transaction. Normally I push data to GA on the success/order confirmation page.
My Question: If I push custom variables to Google Analytics prior to completing an order, will GA be able to associate that session with my completed transaction - allowing me to cross reference my custom variables with the transaction IDs?
Background: We use an address validation service and sometimes the address that the validation service submits to us isn't correct. It can "over correct" and completely strip vital details from certain addresses. Happens less than 1% of the time but when that is multiplied against 1000 - 2000 orders a day it can really become a problem for our fulfillment department. Yes, we have reported this to the address validation service and they tell us they are investigating it. I plan to use jQuery to grab the form data in the billing and shipping fields and when the user fills out all necessary fields, do a push to GA.
Yeah, you should be able to set a session-level custom variable (a unique id or any other value that isn't PII) prior to the transaction, and then create a custom report in GA that looks at that custom variable against the transaction Id. Because it's a session-level variable, it will associate anything that happens for that session.
More info on session-level variables here - Custom Variables - Web Tracking (ga.js)

Resources