Skip to content

Instantly share code, notes, and snippets.

@MatthewZaso
Created May 15, 2020 17:21
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 MatthewZaso/73350eb4a168ab1cbaa79f07b1834248 to your computer and use it in GitHub Desktop.
Save MatthewZaso/73350eb4a168ab1cbaa79f07b1834248 to your computer and use it in GitHub Desktop.
gtm-js/uberflip email submission js
/* You should be able to use this function as-is */
function recordGtmEmailSubmission(email) {
return new Promise((resolve, reject) => {
if (window.IntercomGTM && window.IntercomGTM.pageviewId) {
resolve(window.IntercomGTM.recordEmailSubmissionWithOptions({
email: email,
createQualifiedProspect: true,
pageViewId: window.IntercomGTM.pageviewId,
opts: {
source: "marketo-form",
},
disableMarketoIntegration: true,
}));
} else {
reject();
}
});
}
/* emailValue will be a string with the email address submitted */
recordGtmEmailSubmission(emailValue).then(() => {
// Submit form information and redirect here
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment