Home / Admin / om.DisplayRules.afterRun
Duplicate Snippet

Embed Snippet on Your Site

om.DisplayRules.afterRun

Code Preview
js
document.addEventListener('om.DisplayRules.afterRun', function(event) {
	var DisplayRules = event.detail.DisplayRules;
	var Campaign = event.detail.Campaign;
	if ( 'YOUR-CAMPAIGN-ID' === Campaign.id && DisplayRules.show ) {
		if ( 'pepperoni' !== window.pizza ) {
			// Only allow rules to pass if pizza variable exists
			// and it's value is 'pepperoni'.
			DisplayRules.show = false;
		}
	}
} );

Comments

Add a Comment