Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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