Gravity Forms Google Analytics tracking in Tag Manager

Step 1:

Create a formID datalayer variable

tag-manager-gravity-forms-formid-datalayer-variable
tag-manager-gravity-forms-formid-datalayer-variable

Step 2:

Create custom HTML tag, to push Gravity Forms into the datalayer:

tag-manager-gravity-forms-html-tag-datalayer-push
tag-manager-gravity-forms-html-tag-datalayer-push
<script type="text/javascript">
 jQuery(document).ready(function() {
   jQuery(document).bind("gform_confirmation_loaded", function(event, formID) {
     window.dataLayer = window.dataLayer || [];
     window.dataLayer.push({
       event: "formSubmission",
       formID: formID
     });
   });
 });
</script>

Step 3:

Create Trigger for Gravity Forms:

tag-manager-gravity-forms-trigger

Step 4:

Create Form Event Tag:

tag-manager-gravity-forms-tag-event
tag-manager-gravity-forms-tag-event

Similar Posts