Skip to content

Instantly share code, notes, and snippets.

@msure
Created July 22, 2016 19:28
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 msure/fc1ea3dc0efd8233e8582a8e719580a3 to your computer and use it in GitHub Desktop.
Save msure/fc1ea3dc0efd8233e8582a8e719580a3 to your computer and use it in GitHub Desktop.
Example of How To Push Marketo Form Values to DataLayer
<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