Skip to content

Instantly share code, notes, and snippets.

@Cheffheid
Last active July 1, 2022 12:11
Show Gist options
  • Save Cheffheid/32a6fb84f602936514c8 to your computer and use it in GitHub Desktop.
Save Cheffheid/32a6fb84f602936514c8 to your computer and use it in GitHub Desktop.
Simple Universal Analytics event trigger for Gravity Forms (AJAX)
// Can be added on any page with a gravity form, it will hook into GF's own event that triggers when the confirmation is loaded (confirmed conversion).
(function($) {
$(document).bind("gform_confirmation_loaded", function(e, form_id) {
// Send event with category 'Form', action 'Submit', label 'Contact Us', and value 100.
ga('send', 'event', 'Form', 'Submit', 'Contact Us', 100);
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment