Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Popup attribution from Mailchimp form
doc.find("#takeMeThere").click(function(){
_targetWindow.nostojs(function(api){
var cookie = api.internal.overlay.discountPopup.instance.readCookie(<POPUP_CAMPAIGN_ID>);
if (cookie && !cookie.coupon) {
api.internal.overlay.discountPopup.instance.writeCookie(<POPUP_CAMPAIGN_ID>, "coupon", <COUPON_CODE>);
api.internal.couponGiven(<POPUP_CAMPAIGN_ID>, <COUPON_CODE>);
api.customer({
email: <EMAIL>,
newsletter: true,
source: 'discount-popup',
source_id: <POPUP_CAMPAIGN_ID>
});
}
_targetWindow.location = "redirect_url";
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment