Implement Criteo OneTag via Google Tag Manager for Drupal

Standard

Setup Crieto OneTag for Drupal using Google Tag Manager without touching Code of Drupal 

Recently once client ask me to implement Criteo OneTag via Google Tag Manager without touch Code of Drupal, I asked client run a test order to see possibility via Google Tag Manager for Crieto OneTag for Drupal. I placed a test order on Drupal for Criteo OneTag after placed test order all the possibility to setup without touching code of Drupal using Google Tag Manager for Drupal.

Require these Tags need to Implement Criteo OneTag on BigCommerce Stencil Themes to Work using Google Tag Manager

  1. Homepage dataLayer using Google Tag Manger for Crieto OneTag for Drupal
  2. Listing page dataLayer using Google Tag Manager for Crieto OneTag for Drupal
  3. Product page dataLayer using Google Tag Manager for Crieto OneTag for Drupal
  4. Basket page dataLayer using Google Tag Manager for Crieto OneTag for Drupal
  5. Sales Confirmation page dataLayer using Google Tag Manager for Crieto OneTag for Drupal

1. Install Google Tag Manager via Google Tag Manager on Implement Criteo OneTag via Google Tag Manager for Drupal

Paste this code as high in the <head> of the page as possible:
<!– Google Tag Manager –>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({‘gtm.start’:
new Date().getTime(),event:’gtm.js’});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!=’dataLayer’?’&l=’+l:”;j.async=true;j.src=
‘https://www.googletagmanager.com/gtm.js?id=’+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,’script’,’dataLayer’,’GTM-XXXX’);</script>
<!– End Google Tag Manager –>
Additionally, paste this code immediately after the opening <body> tag:
<!– Google Tag Manager (noscript) –>
<noscript><iframe src=”https://www.googletagmanager.com/ns.html?id=GTM-XXXX”
height=”0″ width=”0″ style=”display:none;visibility:hidden”></iframe></noscript>
<!– End Google Tag Manager (noscript) –>

Note: Make you will replace GTM Tracking Code with your GTM ID XXXXX

Drupal Ecommerce Tracking in Google Analytic

Standard

Google Analytics Enhanced Ecommerce for Drupal using Googel Tag Manager

Are you looking Drupal Ecommerce and Enhanced Ecommmerce Tracking using Google Tag Manager to sales details in Google Analytic

Recently one client ask me to implement drupal ecommerce tracking using Google Tag Manager to push all the purchase information to track in Google Analytic. once I looked possible track ecommerce tracking for Drupal, I need put transaction details into the Data Layer on success/Order Confirmation Page!, I have written a data layer on success page to push ecommerce tracking datalayer in Google Analytic to see sales detail in Google Analytic.

Google Analytics Enhanced Ecommerce for Drupal

Implementing Analytics eCommerce tracking in Drupal

First Install Google Tag Manager on Drupal Google Ecommerce Tracking for Google Tag Manager Ecommerce Tracking on  Putting code For Drupal  <head> and <body>

Paste this code as high in the <head> of the page as possible:
<!– Google Tag Manager –>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({‘gtm.start’:
new Date().getTime(),event:’gtm.js’});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!=’dataLayer’?’&l=’+l:”;j.async=true;j.src=
‘https://www.googletagmanager.com/gtm.js?id=’+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,’script’,’dataLayer’,’GTM-XXXX’);</script>
<!– End Google Tag Manager –>
Additionally, paste this code immediately after the opening <body> tag:
<!– Google Tag Manager (noscript) –>
<noscript><iframe src=”https://www.googletagmanager.com/ns.html?id=GTM-XXXX”
height=”0″ width=”0″ style=”display:none;visibility:hidden”></iframe></noscript>
<!– End Google Tag Manager (noscript) –>

Note: Make you will replace GTM Tracking Code with your GTM ID XXXXX

Product Detail Impressions: To Track product impression for Drupal Enhanced Ecommerce Tracking using Google Tag Manager used custom javascript to get the value of price, product and brand etc

Data layer Measuring Views of Product Details for Drupal

Implement Google Analytic Tracking Through Google Tag Manager on Drupal

Written a data layer code to push Ecommerce tracking for Drupal Ecommerce tracking in Google Analytic using Google Tag Manager

dataLayer.push({
‘event’: ‘orderComplete’,
‘transactionId’: “<%= order.number %>”,
‘transactionTotal’: <%= order.total.to_f %>,
‘transactionTax’: <%= order.tax_total.to_f %>,

Now it’s time to verify result in Google Analytic E-commerce tracking in Drupal using Google Tag Manager

Drupal Ecommerce Tracking in Google Analytic

Implemented Analytics eCommerce tracking in Drupal

Warning:if you do n’t know about javascript/ Datalayer/Jquery or do n’t have developing knowledge then do n’t try Drupal Ecommerce Tracking using Google Tag Manager without touching Codea custom javascript without using Any plugin that can broke your site, Cart and other functionality 

Disclaimer: Google tag manager belongs to Google property 

For Contact: mappchero@gmail.com

Google optimize Setup using Google Tag Manager Issue “Analytics configuration mismatch”

Standard

“Analytics configuration mismatch for Google Optimize”

Are you facing issue of Analytics configuration mismatch for Google Optimize using Google Tag Manager 

Recently one client asks me to set up Google Optimize using Google Tag Manager, He said, his development and Google Analytic person tried but did not any success for error “analytics configuration mismatch” continuous facing this because of that he is not able run A/B testing from Google Optimize.

Start looking his setup found a couple of mistakes made by his team, I asked them to give access of websites, Google Tag Manager and Google Optimize access to, rectify mistake apply on “Analytics configuration mismatch for Google Optimize”, If you will search on Google for “Analytics configuration mismatch” So many people are asking this issue, But does not have provided any solution by any other, But it’s tricky to setup Google Optimize using Google Tag Manager

Install Google Tag Manager on Google Tag Manager Code on the website to work Google Optimize

Paste this code as high in the <head> of the page as possible:
<!– Google Tag Manager –>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({‘gtm.start’:
new Date().getTime(),event:’gtm.js’});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!=’dataLayer’?’&l=’+l:”;j.async=true;j.src=
‘https://www.googletagmanager.com/gtm.js?id=’+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,’script’,’dataLayer’,’GTM-XXXX’);</script>
<!– End Google Tag Manager –>
Additionally, paste this code immediately after the opening <body> tag:
<!– Google Tag Manager (noscript) –>
<noscript><iframe src=”https://www.googletagmanager.com/ns.html?id=GTM-XXXX”
height=”0″ width=”0″ style=”display:none;visibility:hidden”></iframe></noscript>
<!– End Google Tag Manager (noscript) –>

Note: Make you will replace GTM Tracking Code with your GTM ID XXXXX

Copy the full code below and Put Googel Optimize as early in the <HEAD> as possible 

<!-- Anti-flicker snippet (recommended)  -->
<style>.async-hide { opacity: 0 !important} </style>
<script>(function(a,s,y,n,c,h,i,d,e){s.className+=' '+y;h.start=1*new Date;
h.end=i=function(){s.className=s.className.replace(RegExp(' ?'+y),'')};
(a[n]=a[n]||[]).hide=h;setTimeout(function(){i();h.end=null},c);h.timeout=c;
})(window,document.documentElement,'async-hide','dataLayer',4000,
{'OPT_CONTAINER_ID':true});</script>

Note: Make you will replace GTM Tracking Code with your GTM ID (OPT_CONTAINER_ID) XXXXX

Other changes are made in Google Tag Manager and corrected issue for Google Optimize to correct work on it,  Now it’s time very Google Optimize implemented through Google Tag Manager, 

Analytics configuration mismatch & Anti-flicker snippet timed out

DataLayer variable in anti-flicker snippet reassigned

Anti-flicker snippet timed out

Analytics configuration mismatch & Anti-flicker snippet timed out

Warning:if you do n’t know about javascript or do n’t have developing knowledge then do n’t try to Google Optimize using Google Tag Manager a custom javascript without using Any plugin that can broke your site, Cart and other functionality 

Disclaimer: Google tag manager belongs to Google property 

For Contact: mappchero@gmail.com