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.
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:
-
In the Frosmo Control Panel, in the header, click your username, and select Company.
-
Click the quick menu button for the site, and select Set modules.
-
Click Add for Advanced tracking.
-
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.
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)
Parameter | Description | Type | Role |
---|---|---|---|
| Name of the action that the event represents. | String (32) | Required |
| 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 |
Property | Description | Type | Role |
---|---|---|---|
| ID of the modification to which the event is bound. tip If you trigger the event from within modification content, use the | Integer | Required |
| ID of the modification variation to which the event is bound. tip If you trigger the event from within modification content, use the | 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
});