Skip to content

Instantly share code, notes, and snippets.

@walkergv
Created September 20, 2022 20:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save walkergv/5de2da75aa935bed1750a2166f213288 to your computer and use it in GitHub Desktop.
Save walkergv/5de2da75aa935bed1750a2166f213288 to your computer and use it in GitHub Desktop.
Data Layer Push for GTM Customer Event with Elementor
// Always endure you have given each form a Form ID in the Elementor backend or else action will not track.
jQuery( document ).ready(function( $ ){
jQuery( document ).on('submit_success', function(event) {
// for example, to submit a custom event to GTM DataLayer
//dataLayer.push({event:"GAEvent",eventCategory:"Form Submission", eventAction:event.target.id ,eventLabel:undefined});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment