Learn how to create and edit a trigger, and define the evaluation point and rules for firing the trigger.
For hands-on examples of creating different types of triggers, see Trigger examples.
To create a trigger:
Define the trigger settings.
To edit a trigger:
The following table describes the settings you can define for a trigger in the Frosmo Control Panel.
Table: Trigger settings
Setting | Description | Role |
---|---|---|
Name | Enter a name for the trigger. | Required |
Description | Enter a description for the trigger. You can use the description to, for example, explain when the trigger is fired. | Optional |
Evaluation point | Define the evaluation point for the trigger. To define the evaluation point:
| Required |
Rules | Define rules for firing the trigger. To define a rule:
To add another rule, click Add new rule again. To remove a rule, click ✕ for the rule. If you define no rules, the trigger is fired every time the trigger event, as defined by the evaluation point, takes place. | Optional |
Alias | Define an alias for a trigger. You can use the alias to bind a JavaScript function to the trigger. | Optional |
Figure: Defining the trigger settings
An evaluation point determines the event on a web page that causes the Frosmo Platform to check whether to fire the trigger. The following table lists the evaluation points supported by the platform.
Table: Supported trigger evaluation points
Evaluation point | Options | Description | |
---|---|---|---|
Core event | Event | A specific Frosmo Core event has occurred. If you select this event, also define the event type. You can select from the following event types:
If you select Other predefined event, enter the name of the event. | |
Data layer event | Data has been pushed to the data layer. Every | ||
DOM element ready | Element Timeout (seconds) | A specific DOM element has been loaded and parsed, and is ready to be manipulated. If you select this event, also define the element whose readiness fires the trigger and, optionally, the timeout (in seconds) after which the Frosmo Platform stops trying to fire the trigger. Define the element using a CSS selector; jQuery selectors are not supported. If you define no timeout (or set it to "0"), the platform keeps trying indefinitely. | |
DOM event | Event Element | A specific DOM event has occurred. If you select this event, also define the event type and the element to which the event must happen. Define the element using a CSS selector; jQuery selectors are not supported. You can select from the following event types:
For example, to fire the trigger on a link click, select Click as the event type, and define the element with the CSS selector "a". | |
DOM ready | All DOM elements have been loaded and parsed, and are ready to be manipulated. | ||
Frosmo script loaded | Frosmo Core has been loaded and is ready to be initialized.
| ||
Frosmo script ready | Frosmo Core has been initialized. Frosmo context data (visitor data stored in
| ||
JavaScript variable ready | Variable Timeout (seconds) | A specific JavaScript variable defined in the If you select this event, also define the variable name and, optionally, the timeout (in seconds) after which the Frosmo Platform stops trying to fire the trigger. If you define no timeout (or set it to "0"), the platform keeps trying indefinitely.
| |
URL change | A URL change through the
For more information about the |
Define the rules for firing the trigger. If you define no rules, the trigger is fired every time the trigger event, as defined by the evaluation point, takes place.
The Frosmo Platform supports the following rules:
Trigger rules support matching against Boolean values when the rule contains a value defined as "is exactly true" or "is exactly false". |
The trigger is fired based on the value stored in a cookie. You can get the value by cookie name.
ExampleThe trigger is fired when the value of the |
The trigger is fired if there is a specific DOM element on the page. To define the element, add a CSS selector and an attribute or property identifying the element:
prop:
, the element node property must match.attr:
, the element node attribute must match.ExampleThe trigger is fired when the value of the |
The trigger is fired based on data passed by a predefined event. Specifically, the rule checks whether the value of an event data property matches a value you provide.
This rule is available only for the following evaluation points:
The available properties on which to base the rule depend on the selected evaluation point and, in some cases, the selected event type. Depending on your selection, you either select the property from a list of predefined properties or manually define the property name.
The following table lists the available properties based on the selected evaluation point and, if relevant, event type.
Table: Available event data properties based on evaluation point and event type
Evaluation point | Event type | Event data properties |
---|---|---|
Core event | Conversion |
|
Frosmo custom action |
| |
Modification display/click/true display |
| |
Other predefined event | Depends on the event data. | |
Product purchase |
| |
Visitor location change |
| |
Data layer event | Any | Depends on the event data. |
DOM element ready | Any |
|
DOM event | Any |
|
URL change | Any |
|
ExampleThe trigger is fired when the modification event is registered for a modification with the ID |
If you use the Event data rule with the Data layer event evaluation point, define both the name and value of the property. You can use either dot notation or bracket notation to access a nested property (for example, Note the following:
Example of the expected event data object when the property is
|
If multiple event data arguments are passed to the triggered event using the |
The trigger is fired based on your own JavaScript code. The code must return a value to be matched.
ExampleThe trigger is fired when the visitor is using a desktop device. |
The trigger is fired based on a JavaScript variable value on the page. The variable must be available on the window
object.
If you need to check the value of a nested object property on the page, use dot notation to reference the property, for example, object.object.property
.
ExampleThe trigger is fired when a JavaScript variable named |
The trigger is fired based on data stored in local storage. You can get the data by the key name.
ExampleThe trigger is fired when the value of the |
The trigger is fired when the visitor arrives from a specific page.
You can define the page based on:
http://www.example.com/index.html
http://www.example.com/index.html
, the domain is www.example.com
.http://www.example.com/index.html
, the path is /index.html
.http://example.com/?search=word&count=10
, the complete query parameters are search=word&count=10
, and the query key for search is word
.ExampleThe trigger is fired when the visitor arrives from a page whose domain contains the string |
The trigger is fired on a specific page.
You can define the page based on:
http://www.example.com/index.html
http://www.example.com/index.html
, the domain is www.example.com
.http://www.example.com/index.html
, the path is /index.html
.http://example.com/?search=word&count=10
, the complete query parameters are search=word&count=10
, and the query key for search is word
.ExampleThe trigger is fired when the visitor is on a page whose path begins with the string |
You can define an alias for a trigger. You can use the alias to bind a JavaScript function to the trigger. For example, use the following code to bind an alias named "myTriggerAlias" to a trigger:
frosmo.easy.events.on('myTriggerAlias', function (trigger) {...}); |
The bound function will be called every time the trigger fires. The function receives the trigger object as an argument. If you want to call the bound function once, use the frosmo.easy.events.once()
function.