-
-
Save johnzuh/8657243 to your computer and use it in GitHub Desktop.
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).ready(function($){ | |
| $('form').submit(function(event){ | |
| //if analytics object exists | |
| if(window._gat){ | |
| event.preventDefault(); | |
| optinForm = this; | |
| _gaq.push(['_set','hitCallback', function(){ | |
| optinForm.submit(); | |
| }]); | |
| _gaq.push(['_trackEvent', 'Forms', 'Submit', 'hbsanewtraffic']); | |
| } | |
| //if no analytics object, service as normal | |
| }); | |
| }); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great resource. will test it for my forms