Track Gravity Form Event Tracking Submissions Using Google Tag Manager
Recently, one of the client has asked me to track Gravity form submissions tracking using Google Tag Manager, they said, they have tried so many method few other people written on internet because that’s not firing on actual form submission and also said it’s fail when a gravity form of pop up. I know very well why it’s not working on actual because most people does not know, How to work gravity form and also behind in Gravity form coding and API..
Which I have developed javascript it will working on Pop Gravity Form as Normal Gravity Form on Successful Form Submission.
Gravity form Fired on AJAX-enabled forms when the confirmation page (gform_confirmation_loaded) is loaded. so that you need to understand loading of ajax gravity form on confirmation page.
Successfully Track Gravity Form Event Tracking Submissions Using Google Tag Manager
- First Install Google Tag Manager on WordPress for tracking gravity form submission using 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 –>
<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 data layer window.dataLayer.push using jquery on loading gform_confirmation_loaded) using Google Tag Manager custom html
<script type=
"text/javascript"
>
jQuery(document).ready(
function
(){
jQuery(document).bind(
'gform_confirmation_loaded'
,
function
(){
Warning:if you do n’t know about javascript/ Datalayer/Jquery or do n’t have developing knowledge then do n’t try Track Gravity Form Event Tracking Submissions 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.