magepal / magento2-google-tag-manager

Google Tag Manager is a user-friendly, yet powerful and cost-effective solution that is a must-have integration for every Magento store. It simplifies the process of adding and managing third-party JavaScript tags. With dozens of custom events and hundreds of data points our extensions the #1 GTM solution for Magento.
https://www.magepal.com/google-tag-manager.html
258 stars 88 forks source link

Creating a GTM Tag and the trigger for e-commerce tracking #25

Closed Serge-Wiki closed 5 years ago

Serge-Wiki commented 7 years ago

Hello everybody,

I’m new to GTM data layers and would like to enable e-commerce tracking on my Magento 2 website. I’ve installed the extension and it seems that it generates data layer on my “Thank you page”. As far as I know in order to send my data to Google Analytics I have to create a tag and fire it on custom event trigger that should be generated inside the data layer. For example, it should be something like event: “Thankyou-success” or something like that. When I look through the code in JS console of Chrome I don’t see this line of code, just Event: “gtm-dom” and Event: “gtm.js” but those events appear on all pages of my site. So what event should I choose or should I create a trigger related to the page type? If so how can I do this?

Thanks gtm

srenon commented 7 years ago

@Serge-Wiki ... Take a look at 'Standard Ecommerce' https://support.google.com/tagmanager/answer/6107169?hl=en

Serge-Wiki commented 7 years ago

Thanks for the link. So I’ve created the tag with Data layer check box. Does it mean that now under E-commerce section of Google Analytics I will see all the e-commerce data? How will I define the event of completing the order?

Thanks a lot

gediminaskv commented 7 years ago

@Serge-Wiki I think, it's good to use pageType variable for triggering instead of Custom Event which is not present. The extension gives these values:

https://prnt.sc/glft2m

magefan commented 6 years ago

@Serge-Wiki event was added in this commit https://github.com/magepal/magento2-googletagmanager/commit/086de3be83d96b51cfd28ae4974f2a319bfc694e

Serge-Wiki commented 6 years ago

gediminaskv, Thanks for your reply if it’s not hard for you, could you please write the step of how should I set up my Tag and Trigger? Because what I’ve chosen doesn’t provide any data to analytics eCommerce section.

Thanks

Serge-Wiki commented 6 years ago

@magefan Thanks, Do you mean I have to update the extension and event will appear on each page?a

gediminaskv commented 6 years ago

@Serge-Wiki if it will help you, I share my GTM screenshots: https://qsnapnet.com/folders/32vnckt1oi3mzpv

Also I read some info on https://canonicalized.com/enhanced-ecommerce-tag-manager/?section=product-page and https://zadroweb.com/gtm-data-layer-event-tracking-guide/

Serge-Wiki commented 6 years ago

@gediminaskv I’m very sorry to bather, but still can’t get it right. I’ve updated the extension and created GTM tag (please see the screenshot).

image

I have turned Enhanced E-commerce Tracking in my Google Analytics account, but no data received !

Could you please show me what I miss?

I know that I should see some data in GA under Conversions -> e-commerce, but I see only zeros 

Maybe if possible, you’d write a few steps I should follow in order for this to work properly.

Thanks a lot

gewaechshaus commented 6 years ago

@Serge-Wiki - does it work in your case actualy?

simonmaass commented 5 years ago

could someone maybe explain a little more detail how to configure your GTM and Analytics in order to get the ecommerce data?