For the complete documentation index, see llms.txt. This page is also available as Markdown.

Activities analytics

How the platform duplicates activities for performance analytics, and how to make custom events count.

Your goal

Understand what the platform builds from your activities so that session duration, conversions, and funnels are populated - and get your custom events counted when renaming your tracking is not an option.

Expected outcome

Built-in dashboards and funnel analytics showing your real volumes, not zeros.

Why a separate store exists

Data entering your datamart is stored in a multi-model database, optimised for different usages. To display performance analytics - session duration, conversions, funnels - the platform duplicates some user activities and information and optimises them.

That duplication is what analytics reads. And it only happens for predefined events.

A sample event that analytics can use:

{
    "$ts": 3489009384393,
    "$event_name": "$transaction_confirmed",
    "$properties": {
        "$items": [
            {
                 "$id": "product_ID",
                 "$qty": 20,
                 "$price": 102.8,
                 "$brand": "Apple",
                 "$category1": "Category 1",
                 "$category2": "Category 2",
                 "$category3": "Category 3",
                 "$category4": "Category 4"
            }
        ],
        "$currency": "EUR"
    }
}

Which events feed which analytics, and which properties matter, is tabulated in UserActivity & UserEvent.

Retention

Activities analytics data is kept 4 months, in order to optimise performance.

This is not configurable. If you need a longer analytical history, extract it - see Export your data and Data retention.

Transforming your custom events

If you already send custom events and cannot change your tracking, you can declare an event transformation so analytics still works.

The transformation

A transformation is linked to a datamart:

Property
Type
Description

datamart_id

Integer

The datamart where the transformation applies.

channel_id

Integer

The channel where it applies.

source_event_name

String

The name of your custom event.

target_event_name

String

The predefined event it becomes. Allowed values: $transaction_confirmed, $item_view, $basket_view, $list_item_view.

mapping_id

Integer

The property mapping to apply.

Manage them with:

The property mapping

A mapping decides which property of your custom event becomes which property of the predefined event. Each entry pairs a target_attribute_name with a source_attribute_path, and paths can be nested through sub_path.

A mapping for $transaction_confirmed

This maps $properties.order.order_products[] onto $items[], and each product's fields onto the $items fields analytics expects:

Things to note:

  • The target attributes are fixed. You cannot use target attributes other than the ones above, but they are not all mandatory - an unused target uses its default value.

  • absolute_path: true reads from the root of the event rather than from the mapped item. In the example, $category2 takes event.$event_name instead of a field inside each product.

  • If the event has no repeated element, you can map $properties directly onto $items - it is then treated as an array of one item.

Verify

  • Built-in dashboards show non-zero conversions and amounts.

  • Funnel analytics can filter by product ID, brand, and category.

  • After declaring a transformation, new events appear in analytics - and you have not expected old ones to.

Last updated

Was this helpful?