Created
July 22, 2016 19:28
-
-
Save msure/fc1ea3dc0efd8233e8582a8e719580a3 to your computer and use it in GitHub Desktop.
Example of How To Push Marketo Form Values to DataLayer
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
<script> | |
MktoForms2.whenReady(function (form) { | |
form.onSubmit(function(){ | |
var vals = form.vals(); | |
dataLayer.push({ | |
'event': 'marketoFormSubmit', | |
'marketoCompany': vals['Company'], | |
'marketoLeadSource': vals['LeadSource'], | |
'marketoOriginalSource': vals['Original_Source_Detail__c'], | |
'marketoCurrentSource': vals['Source_Detail__c'] | |
}); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment