<aside> 🚨 It’s best to put custom functions inside of the Custom Javascript Field inside of your campaign. If you do not have the Custom Javascript Field visible yet, reach out to us on Live Chat so that we can enable it for you.
</aside>
FUNCTIONS | EXAMPLE | |
---|---|---|
onShow | window.PopConvert.onShow(({ data }) => { data.campaign }) | |
onClick | window.PopConvert.onClick(({ data }) => { data.campaign }) | |
onClose | window.PopConvert.onClose(({ data }) => { data.campaign }) | |
onSubmit ( sub ) | window.PopConvert.onSubmit(({ data }) => { | |
data.type == 'subscriber' // true | ||
data.campaign | ||
data.form | ||
}) | ||
onSubmit ( redirect ) | window.PopConvert.onSubmit(({ data }) => { | |
data.type == 'redirect' // true | ||
data.campaign | ||
data.url | ||
}) |
NOTE: This code is no longer necessary. You can add a URL directly to the image block (see here)
// Change to whatever URL you want
var url = '<https://www.google.com>';
window.PopConvert.onClick(({ data }) => {
window.location.href = url;
// Or if you want to open the URL in a new tab:
// window.open(url, '_blank');
});