Pages

This document introduces the advanced tracking feature from a developer's perspective, and shows you how to use the feature to track custom events for modifications.

To implement advanced tracking for a site, you need to understand how the Frosmo Platform works.

What is advanced tracking?

The advanced tracking feature extends the basic tracking functionality of the Frosmo Platform with custom events. Custom events allow you to track modifications beyond clicks, displays, and true displays, which the platform handles automatically. A custom event can be about anything that you can do with or change in a modification. The platform calculates statistics for custom events, and you can access the statistics through the Frosmo Control Panel.

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

For a broader introduction to custom events, see Modification statistics.

Enabling and disabling advanced tracking for a site

Before you can use advanced tracking on a site, you must enable the advanced tracking module for the site. You do this through the Control Panel.

Only certain Frosmo users can enable and disable site modules. If you're a company user, your Frosmo team enables and disables the modules for your sites.

To enable advanced tracking for a site:

  1. In the Control Panel, click your user name, and select Company Settings.

    Enabling advanced tracking for a site

  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 track custom events on a site, the advanced tracking module must be enabled for the site.

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

frosmo.easy.tracking.event(action, payload)

Table: Function parameters

ParameterDescriptionTypeRole
actionName 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 Control Panel.

ObjectOptional

Table: Payload object properties

PropertyDescriptionTypeRole
modificationId

ID of the modification to which the event is bound.

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

IntegerRequired
variationId

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

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

IntegerRequired

You can access the custom event statistics through the Control Panel.

Example

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
});
  • No labels