Magento2 Compatibility
  1. 2.0.x
  2. 2.1.x
  3. 2.2.x
  4. 2.3.x
  5. 2.4.x
  6. EE 2.2.X
  7. EE 2.3.X
  8. EE 2.4.X
Headline
Nulled Google Tag Manager for Magento 2 with full support for Google Analytics Enhanced Ecommerce
Short Description
You need to Pay 10.00 EUR to Author clokers , From Magento 2 Google Tag Manager Enhanced Ecommerce (UA) Tracking - Anowave have 3 Description Attachments, 62 discussion, 17 Updates, 1,118 Views.

Troubleshooting​

This is all due to the new Elastisearch engine introduced in Magento 2.4 onwards. Our module is compatible with it, but there is a configuration change that needs to be done.
Go to Stores -> Configuration -> Anowave Extensions -> Google Tag Manager -> Enhanced Ecommerce Tracking preferences (section) and set Impression payload model to "Set dataLayer[] impressions AFTER Pageview". Once done, flush cache and everything should be back to normal. You may also notice a slight performance gain in categories as well.

Google Tag Manager for Magento 2 with full support for Google Analytics Enhanced Ecommerce, AdWords Dynamic Remarketing, AdWords Conversion Tracking, Social Network interaction tracking, Facebook Custom Audiences Pixel, Custom Dimensions, Google Customer Reviews, User ID data acquisition and User Timings Tracking.

Track product impressions, product detail views, add and remove from cart events, checkout steps and options, refunds, transactions and promotions performance in Magento with Google Tag Manager.

Google Analytics configuration​

To get proper Enhanced Ecommerce, Google Analytics should be configured as well. There are 2 keypoints here

1. Enable Enhanced Ecommerce

To enable Enhnaced Ecommerce go to GA -> Admin -> E-commerce settings -> E-commerce Setup and enable Ecommerce and Enhanced Ecommerce reporting

2. Configure Funnel

To configure funnel steps go to GA -> Admin -> E-commerce settings and under Checkout labeling enter the following steps:

Step 1 - Shipping
Step 2 - Payment
Step 3 - Place order

Note that if you use 3rd party checkout solution, steps could be different. In this case, contact helpdesk for further clarification



How to test if tags are actually working​

There are essenatially 2 types of tags. The first type of tags are those sent on Pageview. They include information that is gathered upon page load and sent automatically with the GA Pageview. The other type of tags are those fired after the page is loaded. They usually require user action such as click of a button etc.

To learn more about testing tags visit https://support.google.com/tagmanager/answer/2695660?hl=en

Previewing in debug mode allows you to check which tags are fired and which are not fired. If a certain tag isn't fired then make sure it's configuration matches the required one described in this documentation. (See Tag configuration).

AdWords Conversion Tracking & AdWords Dynamic Remarketing​

To configure AdWords, check the steps/guide outlined below.

1. AdWords Conversion Tracking

In our extension configuration screen go to AdWords Conversion Tracking tab and insert your conversion id and conversion label (obtained from AdWords). The word "purchase" is default and should be replaced with your own label. Once these are inserted, flush cache and conversion tracking should work out of the box. You don't need to define anything in terms of GTM tag/configuration. AdWords Conversion Tracking is built-in in our module for customer ease.

2. AdWords Dynamic Remarketing

If you used our API to create all triggers, then you should have a tag called EE AdWords Dynamic Remarketing and 2 variables in GTM -> Variables e.g. "ee conversion id" and "ee conversion label"

a) Go to GTM -> Variables and edit "ee conversion id" variable. Insert your conversion id (obtained from AdWords)
b) Go to GTM -> Variables and edit "ee conversion label" variable. Insert your conversion label (obtained from AdWords)
c) Publish new container version

This will activate AdWords Dynamic Remarketing.



Facebook Pixel Configuration​

Facebook Pixel tracking is built-in, you do not need to create any tags in GTM itself. Configuration is simple and it only requires you to insert your Facebook Pixel snippet in module's config screen under Facebook Pixel Tracking panel. Once snippet is inserted, the module will automatically insert the FB snippet on your pages and fire events such as AddToCart, Purchase, RemoveFromCart etc. automatically.

Promotions & Promotion tracking​

This module can track promotion views and promotion clicks. However, different customers use different promotions e.g. banners, sliders, static images etc. which makes it impossible to track them all. To solve this we have introduced a smart way to enable promotions in your site by doing a few code changes at HTML level. Althought this is DYI, it's very easy to achieve.

To make an object promotion simply add data-promotion="true" attribute. Then add the rest of the attributes from Enhanced Ecommerce specification related to promotions e.g.

  1. data-promotion-creative="squareBanner"
  2. data-promotion-name="Square Banner"
  3. data-promotion-position="1"
  4. data-promotion-id="SQUARE_BANNER"
Note: Values are fictional. Fill in your own values.

A typical HTML element would look like shown in the figure below.
magento-enhanced-ecommerce-promotions.png


data-promotion-* attributes can be applied to any element on the page.



Advanced Developer Configuration / Selectors​

Parts of the tracking related to event tracking may involve adjusting a few configuration selectors. Under Advanced Developer Configuration we have exposed a few selectors which provide a flexible mechanism of detecting elements on your page and binding the corresponding tracking e.g. productClick, addTocart etc. These selectors are XPath selectors. XPath uses path expressions to select nodes or node-sets in an XML document. The node is selected by following a path or steps.

In effect these selectors describe the path to specific elements on your page and allow the module to hook to them dynamically. There are several important selectors.

1. Impression list selector - Used to detect a list of products in categories
2. Impression click selector - Used to detect a clickable element e.g. product title, image from categories
3. Add to cart selector from categories - Used to detect direct "Add to cart" button from categories

There are also other less important selectors with self-explanatory names.

One may find this part of the configuration a bit technical so if you're unsure how to configure or if these need to be adjusted at all, please contact our help desk. Support engineers will clarify on this.

For technical person, it should be relatively easy to adjust these as long as you're aware on the following.

a) "//" double slash means an absolute selector, if selector starts with double slash e.g. // it will be applied on the whole content, in some cases could be the whole page or the listings HTML

b) If a selector starts with element, it's then a relative selector and will be applied on the content matched from the previous/dependable selector. Impression click selector for example depends on impression list selector. The first one must be absolute selector while latter one should be relative.

A good example would be:

a) Presume category products are listed in ORDERED LIST e.g. OL/LI, OL has ID - products, in this case the Impression list selector becomes: //ol[contains(@class,"products")]/li which reads "pick ALL LI elements which are direct children of OL element with attribute ID equal to "products"

b) Presume that product link which we need to track productClick exists in OL/LI/DIV/A with class "product-image", the Impression click selector becomes: DIV/A[contains(@class,"product-image")] which reads "pick A element which is child of DIV element which is direct child of previously matched LI element



Cookie Consent / GDPR​

The latest version of the extension comes with built-in Cookie Consent directive. This allows visitors to choose whether they allow site owner to collect and store cookies. A cookie is a small piece of data that a website asks your browser to store on your computer or mobile device. The cookie allows the website to "remember" your actions or preferences over time.

Most browsers support cookies, but users can set their browsers to decline them and can delete them whenever they like.

Cookie Consent Configuration​

To enable this feature go to Stores -> Configuration - Anowave Extensions -> Google Tag Manager -> Cookie Consent Directive and set "Enable Cookie Consent" to "Yes". Configure other settings as per your requirments.

Enabling Cookie Consent however isn't sufficient because some of your tag may still fire. In most cases, the Universal Analytics tag that fires on all pages will still fire. To prevent this, you need to change the tag trigger from All pages to custom event e.g. cookieConsentGranted. This event will be fired once visitor accepts cookie usage and on every page from then on.

Important: If cookie consent is disabled the Universal Analytics tag trigger should be reverted back to "All pages", otherwise it won't fire thus losing essential tracking data such as page views, transactions etc.



Developer reference​

Find below a list of the custom events dispatched by our module. These can be used to interact with the dataLayer[] object from your own modules and push/modify data covering your own requirements.



ec_get_widget_click_attributes
Allows 3rd party modules to modify widget click attributes e.g. data-attributes="{[]}"

ec_get_widget_add_list_attributes
Allows 3rd party modules to modify widget add to cart attributes e.g. data-attributes="{[]}"

ec_get_click_attributes
Allows 3rd party modules to modify product click attributes e.g. data-attributes="{[]}"

ec_get_add_list_attributes
Allows 3rd party modules to modify add to cart from categories attributes e.g. data-attributes="{[]}"

ec_get_click_list_attributes
Allows 3rd party modules to modify category click attributes e.g. data-attributes="{[]}"

ec_get_remove_attributes
Allows 3rd party modules to modify remove click attributes e.g. data-attributes="{[]}"

ec_get_add_attributes
Allows 3rd party modules to modify add to cart attributes e.g. data-attributes="{[]}"

ec_get_search_click_attributes
Allows 3rd party modules to modify search list attributes e.g. data-attributes="{[]}"

ec_get_checkout_attributes
Allows 3rd party modules to modify checkout step attributes e.g. data-attributes="{[]}"

ec_get_impression_item_attributes
Allows 3rd party modules to modify single item from impressions

ec_get_impression_data_after
Allows 3rd party modules to modify impressions array []

ec_get_detail_attributes
Allows 3rd party modules to modify detail attributes array []

ec_get_impression_related_attributes
Allows 3rd party modules to modify related attributes

ec_get_impression_upsell_attributes
Allows 3rd party modules to modify upsell attributes

ec_get_detail_data_after
Allows 3rd party modules to modify detail array []

ec_order_products_product_get_after
Allows 3rd party modules to modify single transaction product []

ec_order_products_get_after
Allows 3rd party modules to modify transaction products array

ec_get_purchase_attributes
Allows 3rd party modules to modify purchase attributes

ec_get_search_attributes
Allows 3rd party modules to modify search array attributes

ec_api_measurement_protocol_purchase
Allows 3rd party modules to modify payload for measurement protocol

ec_get_purchase_push_after
Allows 3rd party modules to modify the purchase push



Performance optimisation​

The module is developed in a way that dataLayer[] object gets initialized prior to sending a Pageview. While this brings more natural way of sending data to Google Analytics, it may bring minor performance issues mainly due to the fact that GTM snippet is located in HEAD section and this is where Pageview is fired. To get the dataLayer[] object initialized correctly, the module does some data pre-fetching. Performance impact is minimal on all pages except for category pages where payload could be significant especially in categories with lots of products. To improve performance you can pick from 2 types of dataLayer[] initializations e.g. Before Pageview and After Pageview. The latter one improves performance drastically however it requires additional adjustments in GTM tags and triggers. By delivering those 2 selectable types of initializations the module allows you to pick between more natural dataLayer[] initialization and improved performance.

To set dataLayer[] initialization model go to Stores -> Configuration -> Anowave Extensions -> Google Tag Manager -> Enhanced Ecommerce Tracking Preferences -> Impression Payload Model. In there we have included a User Guide that explains this feature in detail and the changes you need to do depending on the chosen initialization model.

Another bottleneck could be deeply nested category hierarchy and also number of categories. On sites with 2000+ categories, performance could be improved by disabling a setting called Use category segments from our module. When disabled, the module will not send the category as slash separated string but only the very category that product exists.



Assessing installation and tracking​



Assessing the installation is important part of ensuring that tracking works and it covers all aspects of enhanced ecommerce. There are multiple ways to assess the installation, but we will describe the most common ones.



1. Assessing as customer

As a customer you may not have coding skills so there are a few simple steps to follow. We have outlined them below.

  1. 1. Go to your Google Tag Manager account and check if you have created all tags, triggers and variables
  2. 2. Check if you have published your container
  3. 3. Run your container in "Preview" mode and go back to your site.
  4. 4. Browse pages such as Home Page, Category, Product detail page and ensure that Universal Analytics tag fires on all of them.
  5. 5. Click on a product from your categories and ensure that "Product click" event appears in the GTM preview console (bottom of the browser)
  6. 6. Click on "Add to cart" button and ensure "Add to cart" event is fired. Follow the same procedure for "Remove from cart"
  7. 7. Go to Checkout, and see if checkout steps are tracked (again by looking to the preview console).
  8. 8. Place an order and click on the dataLayer from the preview console. Ensure that dataLayer[] object contains all the data such as revenue, transaction, products array etc.
  9. 9. Play with the entire site when in preview mode and ensure that dataLayer[] object is initialized as per the specification descrived here - https://developers.google.com/tag-manager/enhanced-ecommerce
  10. 10. Last but not least, contact our support engineers and ask them to evaluate the installation.
2. Assessing as developer (advanced)

As a developer you could use some tools to assess the installation. We have outlined them below.

  1. 1. Assess the installation as customer (see pt. 1 above)
  2. 2. Open browser's developer console and inspect AEC and dataLayer objects. They should be defined.
  3. 3. Monitor network and requests made to
  4. 4. Inspect elements such as category images, add to cart buttons etc. for data-* attributes such as data-id, data-brand, data-catgory etc.
  5. 5. Make sure GTM is inserted only once in the page HTML source
  6. 6. Make sure standard Google Analytics is turned off entirely.


Considerations​

Even properly installed the extension may fail to send data to Google in certain cases. See below possible situations that may result in data loss:

  1. Transaction tag(s) are fired on order confirmation page and if for any reason the customer doesn't get to confirmation page, NO transaction data will be recorded.
  2. Some customers reported doubled amount of transaction value. This could happen if GA transaction tracking is enabled in Magento. It will in effect send transaction data twice resulting in incorrect transaction amount reported in Google Analytics. Our recommendation is to disable all 3rd party extension related to GA and leave stuff to GTM. It's main purpose is to allow site owners to add features to the site without editing code whatsoever.
  3. Inaccruate bounce rate has been repored on few occasions. This usually happens when there are more then one tag fired on 'pageview' with results in sending data twice to Google thus bounce rate getting lower then 1%. To test if your site doesn't sent 'pageview' twice to Google, use browser's console and search for requests containing the keyword "collect" There should be only 1 such request per page view.
  • magento2-ga-self-assessment.png
    magento2-ga-self-assessment.png
    67.1 KB · Views: 0
  • gtm2.png
    gtm2.png
    114.3 KB · Views: 0
  • magento2-google-tag-manager-api-full-support-preview.png
    magento2-google-tag-manager-api-full-support-preview.png
    239.9 KB · Views: 0
Author
clokers
Views
1,118
Extention type
zip
File size
903.2 KB
First release
Last update
Type
Digital product
License duration
Unlimited
Price
10.00 EUR
Rating
0.00 star(s) 0 ratings
Link was Broken? Please  Send Message to NP Team with Ticket, You will get it very quickly!
Support Developer If you are satisfied with your test or project have earn money successfully, Maybe you can click more information button to support with buying.
More resources from clokers

Latest updates

102.0.1 - [102.0.1] - 16/06/2022
Added custom product identity tags 4aef
101.9.7 - [101.9.7] - 16/06/2022
Added custom event footer_after_get_result to allow for footer modification
101.9.6 - Fixed Added performance tracking to consent queue
[101.9.6] - 14/06/2022 Fixed Added performance tracking to consent queue
101.9.3 - Update new version 101.9.3
Update new version 101.9.3
101.9.1 - Update new version 101.9.1
Update new version 101.9.1

Similar resources

Mageplaza Magento 2 Google Tag Manager N
the properly mixed solution with the site-tagging function and the supplement of Google
0.00 star(s) 0 ratings
Views
425
Updated
Mirasvit Google Tag Manager & Facebook Pixel for Magento 2 M
The Google Tag Manager & Facebook Pixel extension
5.00 star(s) 1 ratings
Views
425
Updated
Scommerce Magento 2 GA4 Google Tag Manager (GTM) Enhanced Ecommerce Tracking P
Magento 2 GA4 Google Tag Manager (GTM) Enhanced Ecommerce Tracking 2024
0.00 star(s) 0 ratings
Views
80
Updated
Back
Top