Home / Admin / om-webhook-response-redirect.js
Duplicate Snippet

Embed Snippet on Your Site

om-webhook-response-redirect.js

Code Preview
html
<script>
document.addEventListener('om.Optin.success', function( evt ) {
	if ( 'CAMPAIGN_SLUG' !== evt.detail.Campaign.id ) {
		return;
	}
	var response = evt.detail.response;
	if ( response && response.data && response.data.redirect ) {		
		document.addEventListener('om.Action.redirect', function( evt ) {
			evt.detail.Action.options.url = response.data.redirect;
		});
	}
});
</script>

Comments

Add a Comment