Using Event-Driven Rules

The Mezzobit TMS can assist in creating event-driven rules. Rules can already be used to direct a tag to fire on a certain page or for users with certain attributes before the page is fully loaded, which are called page load rules.

Our powerful rules engine also allows you to designate the firing of tags when certain events occur, such as the user scrolling down a certain page depth, a change made to a form, or a mousedown. These event-driven rules can be repeated one or multiple times, or can be triggered should an event not occur.

Both page load and event-driven rules can consist of one or more activation conditions in the rules editor screen. If any component of a rule evaluates as true, then the entire rule is true (an implied "or" operator).

As always, rules can be combined with other rules to provide fine-grained control over tag activities. Just add more components to the Activation Conditions field in the tag editor screen. Each rule must evaluate as true for the entire expression to trigger the tag (an implied "and" operator).


Event-driven rule topics:


Activating on scroll depth

Activation can be set to equal a certain pixel distance, after scrolling greater than a set distance, or less than a certain distance. Here is a sample activation condition from the rules editor screen that triggers the rule when the user scrolls deeper than 500 pixels from the top of the page.


 Checking the only once box means the rule will return true only the first time the conditions are satisfied.


Activating on DOM-loaded event

Activation can be set to trigger on the completion of the DOM load.


Or, activation also can be set if the DOM is not be fully loaded by a certain time (in this case, 3,000 milliseconds).


Delayed activation or repeated firing of a tag

As mentioned earlier, if the only once box in the rule editor screen is left unchecked, the tag will repeatedly fire every time the event occurs. In this example, the tag would fire repeatedly every 5 seconds.

Variable editor screen:

Rule editor screen:

Ability to attach any DOM event to a variable

This example attaches a mouseover event to a variable.

Variable editor screen:


Rule editor screen:


Attaching user input change to a variable

Once a user changes a placeholder or enters text into a field, #text1 in this example, the tag will fire. 

Variable editor screen:


Rule editor screen:


Activation on an element click can be attached to a variable

If a user clicks within the area designated by id: social, this tag will fire.

Variable editor screen:

Rule editor screen:


Activation on a form submit

Variable editor screen:

Rule editor screen:


Attaching generic user-triggered event to a variable

In this example, a mouseup, or generic click-release event.

Variable editor screen

Rule editor screen:

Have more questions? Submit a request


Please sign in to leave a comment.