Skip to main content

Tracking custom events with advanced tracking

For an introduction to advanced tracking and custom events, see Data tracking solutions.

You implement advanced tracking with a Frosmo Core function in modification content or shared code. For the function to work, the advanced tracking module must be enabled for the site.

Enabling and disabling advanced tracking for a site

Before you can use advanced tracking on a site, you need to enable the advanced tracking module for the site. You do this in the Frosmo Control Panel.

note

Only certain Frosmo users can enable and disable site modules. If you're a company-user, a Frosmo user enables and disables the modules for your site. For more information, contact Frosmo support.

To enable advanced tracking for a site:

  1. In the Frosmo Control Panel, in the header, click your username, and select Company.

  2. Click the quick menu button for the site, and select Set modules.

    Enabling advanced tracking for a site
  3. Click Add for Advanced tracking.

    Enabling advanced tracking for a site
  4. Click Close.

You have enabled advanced tracking for the site. You can now track custom events.

To disable advanced tracking for the site, follow the above steps, but click Active for Advanced tracking.

Disabling advanced tracking for a site

Tracking custom events for modifications

To trigger a custom event for a modification, call the frosmo.easy.tracking.event() function:

frosmo.easy.tracking.event(action, payload)
Function parameters
ParameterDescriptionTypeRole

action

Name of the action that the event represents.

String (32)

Required

payload

Identifies the modification and variation to which the event is bound.

The stringified length of the object must be 1500 characters or less.

If you omit this parameter, the event is not bound to any modification and will therefore not be visible anywhere in the Frosmo Control Panel.

Object

Optional

payload object properties
PropertyDescriptionTypeRole

modificationId

ID of the modification to which the event is bound.

tip

If you trigger the event from within modification content, use the message.id variable to get the current modification ID.

Integer

Required

variationId

ID of the modification variation to which the event is bound.

tip

If you trigger the event from within modification content, use the message.revision variable to get the current variation ID.

Integer

Required

You can view the custom event statistics in the Frosmo Control Panel.

Custom event examples

The following examples trigger a custom event when the visitor clicks the blue link in a modification with multiple links. The first example uses hardcoded IDs. The second example, which is used within modification content, retrieves the IDs dynamically from the message variable. You would trigger separate events for the other links in the modification.

frosmo.easy.tracking.event('click_blue_button', {
modificationId: 1,
variationId: 1
});
frosmo.easy.tracking.event('click_blue_button', {
modificationId: message.id,
variationId: message.revision
});