Created
March 11, 2022 19:26
-
-
Save ericakfranz/1442ee2996836d8e88bda67fd6123415 to your computer and use it in GitHub Desktop.
Autofill the optin email field and hide it. Specifically for use with gamified (spinning wheel) campaigns to allow spinning the wheel without collecting an email.
This file contains hidden or 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
document.addEventListener('om.Campaign.afterShow', function(event) { | |
// Replace YOUR_DUMMY_EMAIL with the email address you want to autofill the field with. | |
// A validly formatted email address is required here. | |
var emailValue = "YOUR_DUMMY_EMAIL"; | |
document.getElementById("{{ns}}-field-email").value = emailValue; | |
}); |
This file contains hidden or 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
/* Hide the email field */ | |
html div#om-{{id}} #{{ns}}-field-email { opacity: 0; height: 0; visibility: hidden; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment