Created
April 7, 2018 15:40
-
-
Save EastSideCode/ba1a188c72df870bb6e5c93d52af5690 to your computer and use it in GitHub Desktop.
Alternate contact form 7 tracking
This file contains hidden or 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
| jQuery(document).ajaxComplete(function() { | |
| if (jQuery('.wpcf7-mail-sent-ok').length) { | |
| if (typeof gtag !== 'undefined') { | |
| gtag('event', 'Submit', { | |
| 'event_category': 'Contact Form', | |
| 'event_callback': function() { | |
| console.log("contact form tracking sent successfully"); | |
| } | |
| }); | |
| } // end if variable defined | |
| } // end length | |
| }); // end document ajax complete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment