AJAX Enhanced Ecommerce/E-commerce Tracking using Google Tag Manager

Standard

Google Analytics AJAX E-commerce Tracking and Enhanced Ecommerce using Google Tag Manager

Recently, one of client asks me to implement e-commerce tracking using Google Tag Manager Ajax based E-commerce website. Due to Ajax based E-commerce Tracking quite difficult because the page is not refreshed and reload, that’s datalayer doesn’t catching require a parameter for eCommerce tracking using Google Tag Manager. 

For Tracking Ajax Google E-commerce Tracking require to setup data layer using Custom Javascript using Google Tag Manager, I have used some Jquery on DOM using to get information for Ajax E-commerce Tracking to fire as DataLayer.

Ajax Website you will not able setup easily E-commerce Tracking and Goals because everything process with in a page without redirect to any success page.

1. First Install Google Tag Manager on Ajax Website for Set Up E-commerce Tracking using Google Tag Manager

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

2. Write a Jquery to track Ajax and Custom Javascript to Set Up E-commerce Tracking using Google Tag Manager

Google Analytics AJAX e-commerce tracking

Analytics AJAX E-commerce Tracking

3.  Now written a custom for Ajax E-commerce tracking including a data layer code and create trigger to setup E-commerce tracking and also created custom event trigger to fire e-commcerce tracking 

Google Analytics AJAX e-commerce tracking

Google Analytics E-commerce tracking for AJAX Website

3.  Now it’s time to verify ajax Google ecommerce tracking with Google Analytic tracking implemented through Google Tag Manager 

Ajax E-commerce Tracking in Google Anaytic

E-commerce tracking for Ajax

Warning:if you do n’t know about javascript or do n’t have developing knowledge then do n’t try to Google Analytic Ajax Ecommerce Tracking 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

No Fields Found.

Leave a Reply

Your email address will not be published. Required fields are marked *