Created
January 7, 2022 20:35
-
-
Save Garconis/780b2ce7af105fb5b029ff8d53ea2653 to your computer and use it in GitHub Desktop.
Gravity Forms | Track Google Ads conversion with Ajax successful submission
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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