Last active
September 1, 2020 22:09
-
-
Save jtsternberg/23957786e3e9b6d3c6cb888f1eeba718 to your computer and use it in GitHub Desktop.
send arbitrary to the webhook via the debugInfo field
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> | |
document.addEventListener('om.Optin.init.submit', function( evt ) { | |
// Only do this for a specific campaign | |
if ( '<slug>' !== evt.detail.Campaign.id ) { | |
return; | |
} | |
var meta = { products_form: jQuery(document.forms.products_form).serialize() }; | |
// Add the meta field to the Optin fields data. | |
evt.detail.Optin.data.fields.meta = JSON.stringify( meta ) | |
} ); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment