Closed ozchris closed 11 years ago
The first thing to check will be to verify the source using developer tools in Firefox or Chrome. While developing I sometimes have caching disabled, which I've noted can cause a request for the source to reload the page. This would deliver a different source, and might explain why it's not visible for you (refresh the success page and you'll see what I mean - it redirects to the empty shopping cart, which wouldn't show the transaction data).
If you're already checking the presence of the data layer via developer tools and it's still not there, can you let me know what version of Magento you're running? I'll give that version a test again and see if I can reproduce the problem.
Regarding the setup in Google Tag Manager itself, you're correct - all you need is a transaction tag that's set up to fire on the success page where the data layer is rendered. How you configure the rules for this to fire is up to you - it's typically based on page URL, but could also be done based on the presence of a data layer variable - transactionId
, for example.
Closing this issue down, as I spotted your post on Magento Connect. Glad you got things working!
Hi
I've installed your plugin on a vanilla local test site local.magentosample.com.
Basic analytics tracking is working, however the ecommerce data layer does not appear to be there. Both the data layer for visitors and transactions are enabled.
If I view source on the /checkout/onepage/success/ page, the only datalayer contents are visitorLoginState":"Logged out","visitorType":"NOT LOGGED IN","visitorLifetimeValue":0,"visitorExistingCustomer":"No"
I've tried various combinations - guest checkout, registered checkout, various payment methods, but no luck.
Within Google Tag Manager I assume we create a transaction tag, and a rule that fires on checkout/onepage/success - or is there another event trigger we should be using.
Very keen to get this working. Happy to donate if it helps a speedy response.
cheers