Skip to content

Instantly share code, notes, and snippets.

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 Garconis/780b2ce7af105fb5b029ff8d53ea2653 to your computer and use it in GitHub Desktop.
Save Garconis/780b2ce7af105fb5b029ff8d53ea2653 to your computer and use it in GitHub Desktop.
Gravity Forms | Track Google Ads conversion with Ajax successful submission
// run the event code if Gravity Form 6 was successfully submitted
jQuery(document).ready(function($){
// Google Ads conversion tracking when Contact Form is successfully submitted
jQuery(document).on('gform_confirmation_loaded', function(event, formId){
if(formId == 6) {
// Event snippet to log Google Ads conversion of Contact Form
gtag('event', 'conversion', {'send_to': 'AW-123456790/abcdefghijk'});
}
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment