I'm currently trying to track my new e-commerce application by the use of the enhanced commerce plugin from google analytics.
I got one weird tracking issue I don't understand.
Here's a screenshot from the User Explorer
This screenshot ist taken from the "User Explorer". Reffering to the screenshot, I'm expecting to see the correct EUR value and not just EUR 0,00€. So my problem is, that I'm adding the products correctly but I still just see EUR 0,00€ instead of (in this example) EUR 1.650,00.
However, if I check the details of this "event" you see products properly with it's quantity and price. I'm also sending the ec:revenue parameter set with the correct value for this transaction.
Here's my purchase action code:
commercePurchase: function (id, affiliation, revenue, shipping, tax) {
console.log('GA Comerce Add Transaction: ', id, affiliation, revenue, shipping, tax) ;
console.log('set action purchase!');
ga('ec:setAction', 'purchase', {
'id': id,
'affiliation': affiliation,
'revenue': revenue,
'tax': tax,
'shipping': shipping
});
}
Am I missing something obvious?
Thanks!
Regards,
Santo
Related
I've implemented a filter as per this WooCommerce article on taxes:
add_filter('woocommerce_adjust_non_base_location_prices', '__return_false');
This effectively 'ignores' tax rates on checkout: an €8,99 product (where prices are added inclusive of tax) being sold from a UK store will cost €8,99 to a German customer, a French customer or an ROI customer. This all works fine on the front end.
However, I just created an order in the backend for a German customer, and that €8,99 product is being added to the order at €7,49 with no tax. I understand from a tax perspective why this is happening (a UK store selling in Germany shouldn't apply tax, so 8.99 - 20% UK VAT = 7.49), however this seems to be ignoring my woocommerce_adjust_non_base_location_prices filter.
At the moment my filter call is just a single line in a custom plugin, so being implemented at plugins_loaded, I guess. There's no condition for it (e.g. if (!is_admin()) {}), so I'm wondering if I need some other kind of condition to ensure it is applied to admin orders, or if I'm looking at a bug?
I am expecting someone to help me on the below. Below is the scenario
We are planning to track revenue, products sold etc and we have setup standard ecommerce tracking using GTM on my test domain. If the ecommerce tracking works fine on the test domain then, we have planned to move it to live.
Trigger I have setup
enter image description here
Tag I have setup
enter image description here
Data layer code placed on Confirmation page above the GTM container immediately after opening the tag
<script>
window.dataLayer = window.dataLayer || []
dataLayer.push({
'transactionId': 'XYZ',
'transactionTotal': 123,
'currencyCode': 'SAR',
'transactionProducts': [{
'sku': 'abcd',
'name': 'iphone',
'category': 'Mobile',
'price': 999,
'quantity': 1
}]
});
</script>
Here the problems are
1) Whenever someone lands on confirmation page in real time goal conversion visitors are showing as
two instead of 1 for that confirmation page.
2) I did continuously 4 bookings but only one booking is showing in goal conversions option and also
ecommerce tracking is also showing for that one booking only. But for all the 4 bookings GTM tag
triggered and also in real time conversions it showed for that 4 bookings.
3) After 15 mins again I made a booking then, that booking is tracking in analytics and showing
under conversions option.
I just want to know why does this happen. Why analytics is not tracking goal conversions if I do
bookings continuously from my system. Why it is tracking after that 15 mins of time.
2) Goals are registered only once per session, so unless you wait 30 minutes or remove the cookie the goal will be completed only once. Also if you re-use the transaction id this will be merged into a single row in the reports (try and set minutes as secondary dimension, that should break up transactions into different rows). Better use different transaction ids for testing (maybe random strings).
3) It seems by then your session has ended (unusual, session should be 30 minutes by default, or until a change of traffic source) and so conversions are recorded again.
As to 1) no idea really - if two users show up that would mean you create two GA sessons with different client ids, but there is nothing wrong with your trigger. I don't think this can be diagnosed without looking at your page.
Is is possible to track multiple coupons for a single order/transaction in Google Analytics? According to the documentation, the key 'coupon' should be an text...
In our store, customers can fill in multiple coupons for a single order. All the coupons will apply on the complete order, not on products. For example: The coupon 'NOSHIPPING' can be used to get free delivery, but also coupons can be linked to customers to give them an extra discount. So the code 'MYDISCOUNT5PERCENTOFF' gives a selected client also 5 percent discount of the total order. So the order can be completed with 2 coupons!
In the examples on https://developers.google.com/tag-manager/enhanced-ecommerce#purchases only a single coupon is given...
dataLayer.push({
'ecommerce': {
'purchase': {
'actionField': {
'id': 'T12345', // Transaction ID. Required for purchases and refunds.
'affiliation': 'Online Store',
'revenue': '35.43', // Total transaction value (incl. tax and shipping)
'tax':'4.90',
'shipping': '5.99',
'coupon': 'SUMMER_SALE'
},
'products': [ ... ]
}
}
});
Already tried some thing, but it's not possible to push the same object twice, but with different coupons, because the second push will overrule the first one...
It's not possible to push a second purchase after pageload / something like that. Already tried to seperate the coupons with comma's, 'coupon': 'NOSHIPPING,MYDISCOUNT5PERCENTOFF' but that just gives a coupon with the name including the comma in Analytics, so seperate coupons can't be filtered...
Also tried to set an array instead of an text, like 'coupon': ['NOSHIPPING','MYDISCOUNT5PERCENTOFF'], but that doesn't register any coupons at all...
Is there any way how to track multiple coupons in Analytics for a single transaction? And if not, please make this possible!
You won't be able to apply multiple coupons to the same transaction, and you've come close to what I think may be the only solution, which is to concatenate the coupon names, but use something like a pipe (or something easy to distinguish) to delimit them. For example:
'coupon': 'NOSHIPPING|MYDISCOUNT5PERCENTOFF|ANOTHERCOUPON'
In your reports, you would just have to mindful of this concatenation. You could also set up a custom dimension(s) for additional coupon codes, but this would seem more wasteful of a CD, unless you are on A360 and have more than you know what to do with.
Our products are apparel, so we have lots of sizes and color variants that roll up under a single product id.
We have Google Tag Manager integrated with Google Analytics and Enhanced Ecommerce. On the product detail page, the product id (parent level, no variants) is pushed to the datalayer in a sku variable. On the confirmation page, the dataLayer > transactionProducts is populated with an array of each sku ordered. SKU is also at the parent level. Hence, we can see a product page conversion rate based on sku ordered vs the sku passed for product impression.
Google Analytics will only take the first instance of a SKU value and ignore the rest. So, in the below example, Google Analytics will show 3 units of SKU 123 were sold in this order.
dataLayer = [{
"pageName":"confirmation",
"pageCategory":"checkout",
"transactionProducts": [{
"sku":"123",
"vn":"123:black",
"price":10,
"quantity":3,
"currency":"USD"
},{
"sku":"123",
"vn":"123:white",
"price":10,
"quantity":2,
"currency":"USD"
}]
}];
My question is this: how can we track purchases as in the example above such that total quantity of SKU 123 is recorded in GA?
By my lights, we either 1. Change what SKU means on the product page vs the confirmation page, and keep SKU as the parent in the former and update SKU to be vn on the latter or 2. Give up the ability to see purchases of variants and push parent-level sum totals into transactionProducts in the dataLayer on the confirmation page. If we do 1, then I fear we'll loose the product page impression conversion rate metric. If we do 2, then we loose visibility into purchases by variant. Is there any other option for tracking total SKU's purchased that I am missing?
Maybe a late response on this one but I'd go with option 1 so that you can easily see product conversion (purchase / prod views). Then if you want to capture the variant, you should be able to use the variant key. And if you need to add more keys other than the standard ones (https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce#product-data) you could create some custom dimensions with product level scope.
So then your dataLayer would look like this:
dataLayer = [{
"pageName":"confirmation",
"pageCategory":"checkout",
"transactionProducts": [{
"sku":"123",
"variant":"black",
"price":10,
"quantity":3,
"currency":"USD"
},{
"sku":"123",
"variant":"white",
"price":10,
"quantity":2,
"currency":"USD"
}]
}];
is there minimum value for price?
can I send items with price of 0.00085 for example?
ga('ecommerce:addItem', {
'id': '53d8c003cf07a6.46359058', // Transaction ID. Required.
'name': '6', // Product name. Required.
'price': '0.00182', // Unit price.
'quantity': '1' // Quantity.
});
thanks
You can sent whatever you want, but only two decimal places are displayed in the interface so your "micropayments" will show up with a zero revenue (I tested this with enhanced ecommerce but I don't think the interface will behave differently with standard ecommerce).
Update: I repeated my test to get an answer for the comment below. I found that a) yes, product revenue is summed up in the product performance reports, b) it seems that the way this is displayed has changed a bit since I last tested this - there is now a "less than" sign to indicate that product revenue is less than 0.01 (see screenshot).