Ninja Form Submissions with Google Tag Manager

Standard

Ninja Forms Submission Tracking with Google Tag Manager

Recently one of client ask me to track Ninja form submission using Google Tag Manager, once I have looked and test form submission for Ninja , Found two way tracking using either on Success message tracking or using Custom Javascript using Google Tag Manager.

Ninja Form actually built with Ajax form Submission so need to understand actually, How it’s work because ninja form submission without reloading page/Refreshing Pages, write a ajax form submission jquery/Data layer and Fire ajax code on DOM then it will work on Ajax form Submission 

  1. Tracking on Success message making trigger on it 
  2. Using  Jquery Custom Javascript to Track Form Submission
<script>
jQuery( document ).ready( function() {
//Setup our on formSumbit Listener.
jQuery( document ).on( nfFormSubmitResponse, function() {

 

  1. First Install Google Tag Manager on WordPress for tracking Ninja Form Submissions with 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 custom ajax form submission  javascript using jquery on loading (nfFormSubmitResponse) using Google Tag Manager custom html 

Ninja Forms Submission Tracking

Tracking Ninja form submissions with Google Tag Manager

Warning:if you do n’t know about javascript/ Datalayer/Jquery or do n’t have developing knowledge then do n’t try Event tracking Ninja Forms Submissions with Google Tag Manager a Ajax 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.

Tracking Ecommerce tracking with GTM URL query parameters

Standard

Ecommerce Tracking URL Query Parameters with Google Tag Manager

Recently once client asks me to E-commerce/eCommerce tracking with GTM query with URL to work transaction details in Google Analytic. Once I will look success url / Thank You page URL of the query that passing all the value in the URL, so that I saw two possibilities either I need to write a data layer on Success page or use custom javascript a Get URL query using Google Tag Manager.

Require to Ecommerce Tracking URL Query Parameter using Google Tag Manager

Ecommerce Tracking URL Query Parameter

  1. First Install Google Tag Manager on Your E-commerce  Shop to Ecommerce Tracking URL query parameters 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. Written JavascripT to get the value of product name, product price and Total using google tag manager for Tracking Ecommerce tracking with GTM URL query parameters

After that getting all value create a data layer custom html and creating a trigger using a javascript on query so that fire correct place Ecommerce tracking based URL query.

See screen get all value using URL String using Google Tag Manager

3. Now it’s time verify URl query e-commerce tracking using Google Tag Manager that help you identify whether it’s working e-commerce tracking or not ?

Warning:if you do n’t know about javascript/ Datalayer/Jquery or do n’t have developing knowledge then do n’t try Ecommerce Tracking URL Query Parameters with 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.