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.