Pages

A custom action is any visitor activity or state that you want to track on a website, such as a button click, form submission, or login status. You can use custom actions to segment visitors, fire triggers, and control whether to display modifications.

The Frosmo Platform supports the following custom action types:

  • Basic custom action tracks an activity or state that in some way reflects what a visitor is doing on the site.
  • Geolocation custom action tracks the visitor's real-world geographic location.

You can use the data layer to track basic custom actions. You track visitor geolocation through the Frosmo Control Panel.

Tracking basic custom actions with the data layer means triggering a custom action event whenever a visitor completes an action or enters a state that qualifies as a basic custom action.

The data layer supports the custom action object for triggering custom action events.

For more information about custom actions, see the custom actions guide.

Implementing segmentation with custom actions

You can implement segmentation with a custom action in one of two ways:

  • Implement the data layer calls on your site, wait for visitors to trigger the custom action event so that it gets stored in the Frosmo back end along with its values, and then create the related segments in the Control Panel.
  • Create the custom action with the necessary values in the Control Panel, create the related segments, and then implement the data layer calls on your site.

Triggering custom action events

To trigger a custom action event, call dataLayer.push() with a custom action object:

Custom action object model
{
    frosmoEvent: 'string',
    frosmoValue: 'string'
}

The call triggers the event and sends the custom action data to the Frosmo back end, allowing you to reference the action from a segmentation rule, a trigger evaluation point, or modification state settings. If an action with the same name already exists, the value is added to the existing action. If the value, too, already exists, no new data is stored, and the event is simply triggered.

Custom action object

The custom action object describes a custom action event. The object properties together define the custom action data.

Table: Custom action object properties

PropertyDescriptionTypeRole
frosmoEvent

Name of the custom action. The name uniquely identifies the custom action.

This property maps to the Name field of a custom action in the Control Panel.

String (128)Required
frosmoValue

Value of the custom action. The value is case-sensitive.

This property maps to a Value field of a custom action in the Control Panel.

String (128)Required

Examples

Example: Triggering a custom action event
dataLayer.push({
    frosmoEvent: 'Cookie policy accepted',
    frosmoValue: 'true'
});
Example: Triggering a custom action event with a dynamic value
// Set the productCategory variable

dataLayer.push({
    frosmoEvent: 'Product category',
    frosmoValue: productCategory
});
  • No labels