GTM eCommerce tracking - google-tag-manager

I would like to start tracking e-commerce with Google Analytics, to do this I need to pass the values of my data layer into GA using GTM. I have read endless amounts of documentation on the subject and as far as I can tell it should work, however I am still having problems.
The online store we use is actually a third party system (quote engine) so we can't change what is passed to the dataLayer, everything we need is passed to the dataLayer but I can't figure out how to send this data using GTM to GA.
My data layer looks something like this on the checkout page of the site:
dataLayer = [{
'u12': '18000011', 'u10': '31903296', 'u11': '159328761', 'u3': 'XXLX', 'u7': '58.97'
}];
The custom HTML tag in GTM I'm using is firing in the correct place but not sending the information to GA, the tag looks like this:
<script>
ga('require', 'ecommerce', 'ecommerce.js');
ga('ecommerce:addTransaction', {
id: '{{u12}}',
revenue: '{{u7}}'
});
ga('ecommerce:addItem', {
sku: '{{u12}}',
name: '{{u3}}',
price: '{{u7}}',
quantity: '1'
});
ga('ecommerce:send');
Unfortunately this is not working and my Google Analytics is empty in terms of e-commerce transactions, any help on this would be greatly appreciated.

Google pushes the enhanced ecommerce tracking thing. It is hard to find the old documentation of the standard ecommerce tracking.
GA Ecommerce Tracking with Google Tag manager

The solution was a combination of the two answers. I used Mindbreakers link as a template to create the custom data layer suggested by Eike Pierstorff and then used a standard transaction tag in GTM to send the information.
I would like to say a huge thanks to Eike Pierstorff and Mindbreaker for helping me with this.

Related

Google Analytics - send data to google analytics

I have recently been given a project requirement to send data over to google analytics from a certain page. I have no clue how to do that.
Account Id and every thing has already been created, I just want to know how I could send data on load of a certain webpage.
I have been looking up google analytics from what I understood I think I need to first push into ga functions the analytics tacking id and I think I need to have pageview as the event.
Could someone please share tutorial links for this?
Regards,
Farhan
I hope you are looking for the Event Tracking with the Google Analytics as page Tracking is Quite Simple you just need to add the tracking code and page Tracking is done so check out the below link and code you will find how you can do the Event Tracking
Send custom Event to Google Analytics
ga('send', {
hitType: 'event',
eventCategory: 'Videos',
eventAction: 'play',
eventLabel: 'Fall Campaign'
});

Drupal google tag manager e-commerce data not flowing

I'm having some trouble setting up Universal Analytics in combination with Google Tag manager in Drupal more specific to the e-commerce data. Normal google analytics is working but I can't seem to get the e-commerce data to show up. This is my configuration:
Drupal side:
Installed and configured Google Tag manager module with my project code.
Installed the Commerce Google Tag manager module (this sends the required data to the tag)
Google Tag manager side:
Created a new tag with the following settings
Tag type Universal Analytics
Linked the correct Universal Analytics project
Trigger on pageview
Enabled e-commerce setting
Use datalayer setting
Universal analytics side: On view level I enabled the e-commerce setting and enhanced e-commerce setting. Normal page traffic is flowing into Universal analytics verifying the tag is working.
When debugging the page calls with the Tag assistant I can verify that upon completion of an order data is being sent to the tag, this is the sent data:
[
{
"event": "trackTrans",
"transactionId": "606",
"transactionAffiliation": "Name Hidden",
"transactionTotal": 50,
"transactionTax": 0,
"transactionShipping": 0,
"transactionProducts": [
{
"sku": "211",
"name": "211",
"category": "",
"price": 50,
"quantity": 1
}
]
},
{
"gtm.start": 1465502292047,
"event": "gtm.js"
},
{
"event": "gtm.dom"
},
{
"event": "gtm.load"
}
]
I'm pretty new to Google Tag manager but this are my observations.
The analytics data is sent to the Tag => shouldn't it be sent to the Analytics code instead? Or does the tag manager take care of this?
The documentation mentions this:
Add a tag of type Universal Analytics; track type of Page View or Event.
Does this imply the tag also needs to fire on an event like checkout completion? Or is it a real "OR" case where you can decide for yourself to use either pageview or event.
If you need more information I will be happy to provide so!
Thank you for helping out.
A few things to note regarding the GTM setup, which may help:
Since you're using standard Ecommerce (ie. not Enhanced Ecommerce), your Track Type needs to be Transaction, not Pageview or anything else. It will follow that you won't have the option to check the Enhanced Ecommerce checkbox once you select that track type. There's also no further configuration regarding the dataLayer.
The analytics data is sent to the Tag => shouldn't it be sent to the Analytics code instead? Or does the tag manager take care of this?
The analytics data (assuming you mean the dataLayer) is read by the tag. GTM will handle everything for you (provided things are configured correctly).
Everything else should follow and you shouldn't need to do anything else. Your firing rule for the tag could be the event you are pushing in trackTrans.
If you need to use Enhanced Ecommerce, then you would need to restructure/redo your entire dataLayer (unfortunately, but for the better, as you'd get better and more insights into shopping and checkout behaviours in GA).

Google Analytics Enhanced Ecommerce in Adobe DTM

Is there even support for Ecommerce in the DTM implementation of Google UA? I'm not seeing a way to tell it to load the ecommerce library, let alone a way to include ecommerce related tags in your rules. There isn't even a "custom page code" option on the Rules with GUA like I have with Site Catalyst so not sure how to even add them manually. Am I missing something obvious? Or is there a work-around to doing the ecommerce tagging in DTM?
DTM do not support ecommerce tracking nativly as other Tag Management System do (TealiumIQ for example).
To include ecommerce or advanced ecommerce library you have to setup the require in the GA tool pageCode. Something like:
ga('dtm_ga_standard.require', 'ec');
To use it you have to create custom third party tag in the correct pageLoad rule in order to setup advanced ecommerce tracking, something like:
ga('dtm_ga_standard.ec:setAction', 'purchase', {
id: s_orderid,
affiliation: s_orderid,
revenue: order_total,
tax: '0',
shipping: pageViewData.shipment_cost,
coupon: ''
});
ga('dtm_ga_standard.send', 'pageview');
Be sure to prevent in the tool custom page code the standard page view using the commend:
return false
When the ecommerce page load rule is running.
Claudio.

I am trying to set value for custom dimension in google analytics for my website

I'm new to google analytics and i don't realize how make it works.
We have a website and we want to capture the customerId as custom variable in google analytics in order to analyze the behavior of each user with the site.
For this, i start to use google analytics (analytics.js) a few days ago and i created a custom dimension (to know who user access).
The dimension was created with session scope because those values must be sent once per session.
After that, i add the code needed as is explained here:
ga('create', 'UA-#######-1', 'domain.com');
ga('send', 'pageview', { 'dimension1': '<%Convert.ToString(Session["SelectedCustomerID"]);%>' });
I've tried this code and others configurations but google analytics doesn't take the values.
What i'm doing bad? Please suggest me a way to capture the information.

Google tag manager with enhanced ecommerce, but no ecommerce data in analytics

I am trying to implement the google tag managers UA Ecommerce features.
I've followed all steps from https://developers.google.com/tag-manager/enhanced-ecommerce.
According to the Google Analytics quick preview all my tags are being send with the DataLayer to GTM, but the ecommerce data isn't visible in Google Analytics.
Example tag im sending to GTM:
{
"ecommerce":{
"detail":{
"actionField":{
"list":"Product Page"
},
"products":
[
{
"name":"Twin Time",
"brand":"Fromanteel",
"price":"499.00",
"category":"watch"
}
]
}
}
}
I know the normal analytics works, since i do receive sessions.
Website in question: https://fromanteel.nl/
If I understand correctly, the pushes to the dataLayer succeed. I'm guessing that the corresponding tag might not be triggered. Actually had this happen to me a few weeks ago :-)
In the Tag Manager settings, under tags > your specific tag(s), verify that the trigger fires on everything that applies. For example, select 'all pages' and 'clicks' (not just the first).
I suggest using preview mode to see if the tag actually triggers.

Resources