Developer
User guidesDeveloper websiteHelp centerLog in
  • Welcome!
  • Organisations structure
    • Datamart
    • Users and roles
  • User points
    • User identifiers
      • Networks IDs
        • Device-based Network IDs
          • Custom Device ID integration
          • ID5
          • First ID
        • User-based Network IDs
          • Custom User ID integration
          • UTIQ martechpass
      • Accounts
      • Emails
      • Device identifiers
    • User activities and events
    • Compartments
    • User profiles
    • User segments
    • Hyper point & Quarantine
  • Data model
    • Defining your schema
    • Computed fields
      • Concepts
      • Setup
      • Development
      • Examples
  • Data ingestion
    • Real time user tracking
      • Website tracking
      • Mobile apps tracking
      • Ads exposure tracking
      • AMP tracking
      • Conversions tracking
      • Email views and clicks
      • Tracking API
      • Event rules
      • Activity analyzers
    • Bulk processing
      • Imports
        • User activities import
        • User profiles import
        • User choices import
        • Segments import
      • Deletions
        • User identifiers deletion
        • Device points deletion
        • User points deletion
      • User identifiers association
      • Integration batch
    • Activities analytics
    • Data warehouse
      • Preliminary setup
        • BigQuery
      • Create data warehouse
  • Querying your data
    • OTQL queries
    • OTQL examples
    • GraphQL queries
    • UserPoint API
    • User activities
    • Activities analytics queries
      • API Quickstart
      • Dimensions and metrics
      • Use cases
    • Funnel API
  • Alerting
    • Alert configurations
  • Data visualisation
    • Quickstart
    • Dashboards
    • Sections and cards
    • Charts
    • Datasets and data sources
      • Using a data file data source
    • Transformations
    • Filters
    • Cookbook
    • Reference
  • Advanced usages
    • Audience segmentation
      • Audience features
      • Segment builders
      • Audience segment metrics
      • Audience segment feed
        • Building new feeds
        • Monitoring a feed
        • Curated Audiences (SDA)
      • Edge segments
      • Cohort-based Lookalike
    • Contextual targeting
      • Setup
      • Activation
        • Google Ad Manager
        • Xandr (through prebid.js)
      • API documentation
    • Exporting your data
      • Query Exports
      • Datamart replication
    • Data privacy compliance
      • User choices
      • Cleaning rules
      • Exercise of user rights
      • Cookies
    • Campaigns
    • Automations
      • Email routers
      • Email renderers
      • Opt-in provider
      • Custom action plugins
      • Usage limits for automations
    • Plugins
      • Concepts
      • Creation & Deployment
      • Coding your plugin
      • Manage existing plugins
      • Layouts
      • Presets
      • Monitoring
      • Throttling
      • Batching (for external feeds)
    • Platform monitoring
      • Resources usage
        • Dimensions and metrics
      • Collection volumes
        • Dimensions and metrics
      • Events ingestion monitoring
        • Dimensions and metrics
    • Data Clean Room
      • Bunker
      • Clean room
  • Resources
    • Tutorial: Data Ingestion
      • Your first events
        • Add the mediarithmics tag
          • Getting the tag
          • Adding the tag
        • Send events using the tag
          • Adding event properties
          • Finding the UserEvent type in your schema
          • Matching your schema
          • Standard events
      • Your first bulk imports
        • API basics
          • Authentication
          • Your first API call
        • Send documents using the API
          • Requirements
          • Sending documents
    • Using our API
      • Authentication
    • Tools & libraries
      • mics CLI
      • JS Tag
      • Plugin SDK
    • Data cubes
      • Creating a report
      • Reference
Powered by GitBook
On this page
  • Activities analytics data retention
  • Transforming important events into your custom events
  • Event transformations
  • Property mappings
  • Get existing transformations
  • Create an event transformation
  • Update an event transformation
  • Remove an event transformation
  • Get property mappings
  • Create property mappings
  • Delete property mappings

Was this helpful?

Export as PDF
  1. Data ingestion

Activities analytics

PreviousIntegration batchNextData warehouse

Last updated 2 years ago

Was this helpful?

Data coming into your datamart is stored in a multi-model database, optimizing it for different usages. To display performance analytics for elements like session duration, conversions, and funnel, the platform duplicates some and information and optimizes them.

For that purpose, it is important that you use when possible. Custom events won't be taken into account when calculating metrics. For example, don't create order events when tracking an e-commerce site, but the $transaction_confirmed . $transaction_confirmed events are used when calculating conversions and amounts but not order events.

Here is a sample event that can be used in analytics:

{
    "$ts": 3489009384393,
    "$event_name": "$transaction_confirmed", // Conversion detected
    "$properties": {
        "$items": [
            {
                 "$id": "product_ID", // Used to filter in funnel analytics
                 "$qty": 20, // Used for conversion amounts
                 "$price": 102.8, // Used or conversion amounts
                 "$brand": "Apple" // Used to filter in funnel analytics
                 "$category1": "Category 1", // Used to filter in funnel analytics
                 "$category2": "Category 2", // Used to filter in funnel analytics
                 "$category3": "Category 3", // Used to filter in funnel analytics
                 "$category4": "Category 4" // Used to filter in funnel analytics
             },
             {
                 "$id": "product_ID2",
                 "$qty": 12,
                 "$price": 3.4,
                 "$brand": "Microsoft"
             }
        ],
        "$currency": "EUR"
    }
}

The list of predefined events that are used in analytics are as follows.

Event name

Usage

Important properties

$transaction_confirmed

Home dashboards (E-Commerce Engagement)

Segment dashboards (E-Commerce Engagement)

Funnel Analytics

$items : list of products in the transaction

$items.$qty : for the conversion amounts

$items.$price: for the conversion amounts

$items.$id : for the product IDs in funnel analytics

$items.$brand: for the brand filter in funnel analytics

$items.$category1, $items.$category2, $items.$category3 and $items.$category4 : for the categorization in funnel analytics

$item_view

Funnel Analytics

$items : contains only one product

$items.$price: for the conversion amounts

$items.$id : for the product IDs in funnel analytics

$items.$brand: for the brand filter in funnel analytics

$items.$category1, $items.$category2, $items.$category3 and $items.$category4 : for the categorization in funnel analytics

$basket_view

Funnel Analytics

$items : list of products in the basket

$items.$qty : for the conversion amounts

$items.$price: for the conversion amounts

$items.$id : for the product IDs in funnel analytics

$items.$brand: for the brand filter in funnel analytics

$items.$category1, $items.$category2, $items.$category3 and $items.$category4 : for the categorization in funnel analytics

Activities analytics data retention

Activities analytics data is kept 4 month in order to optimize performances.

Transforming important events into your custom events

While it is better to use predefined events when possible, it isn't always the best solution for you. To keep having analytics correctly stored, you can transform your custom events to predefined ones.

Only events coming into the datamart after an event transformation has been defined will be transformed.

Event transformations

An event transformation is linked to a datamart. Here is a sample transformation:

{
    "id": 15, // Read only
    "datamart_id": "3333", // Read only
    "created_ts": <>, // Read only
    "created_by": <>, // Read only
    "last_modified_by": <>, // Read only
    "last_modified_ts": <>, // Read only

    "channel_id": "8888",
    "source_event_name": "order",
    "target_event_name": "$transaction_confirmed",
    "mapping_id": 15
}

Property

Type

Description

datamart_id

Integer

The ID of the datamart where the transformation is applied

channel_id

Integer

The ID of the channel where the transformation is applied

source_event_name

String

The name of your custom event you wish to transform into a predefined event

target_event_name

String

The name of the predefined event it is transformed into. Allowed values are :

  • $transaction_confirmed

  • $item_view

  • $basket_view

  • $list_item_view

mapping_id

Integer

Property mappings

Event transformations use property mappings to choose which property in your custom event becomes which property in the predefined event.

Here is a sample property mapping to start with for $transaction_confirmed events.

// Comments are here to help you understand, 
// remove them before uploading mappings as they are not accepted in JSON
{
  "id": 17, // Read only
  "created_by": <>, // Read only
  "created_ts": <>, // Read only
  "mapping": {
    "values": [
      {
          // Maps $properties.order.order_products[] to $items[]
           "target_attribute_name": "$items",
           "source_attribute_path": {
               "attribute_name": "$properties",
               "sub_path": {
                   "attribute_name": "order",
                   "sub_path": {
                        "attribute_name": "order_products"
                   }
               }
           },
           // Alternative : mapping directly $properties if there are no multiple
           // elements in the event. It will be treated as an array of only one item
           "target_attribute_name": "$items",
           "source_attribute_path": {
                "attribute_name": "$properties"
           },
           
           // Maps $properties.order.order_products.xxx to $items.xxx
           // You can't use other target attributes than the ones 
           // in this example.
           // But they are not all mandatory : a non used target 
           // attribute will use the default value
           "children": [
               // $properties.order.order_products.product.id
               // becomes $items.$id
               // to be used by analytics database
               {
                   "target_attribute_name": "$id",
                   "source_attribute_path": {
                     "attribute_name": "product",
                     "sub_path": {
                        "attribute_name": "id"
                     }
                   }
               },
               // $properties.order.order_products.qty
               // becomes $items.$qty
               // to be used by analytics database
               {
                   "target_attribute_name": "$qty",
                   "source_attribute_path": {
                     "attribute_name": "qty"
                   }
               },
               {
                   "target_attribute_name": "$price",
                   "source_attribute_path": {
                     "attribute_name": "price"
                   }
               },
               {
                   "target_attribute_name": "$ean",
                   "source_attribute_path": {
                     "attribute_name": "ean",
                   }
               },
               {
                   "target_attribute_name": "$brand",
                   "source_attribute_path": {
                     "attribute_name": "brand",
                   }
               },
               {
                   "target_attribute_name": "$category1",
                   "source_attribute_path": {
                     "attribute_name": "cat1"
                   }
               },
               {
                   // In this example $category2 will be 
                   // event.$event_name instead of 
                   // $properties.order.order_products[].$event_name
                   // thanks to absolute_path
                   "target_attribute_name": "$category2",
                   "source_attribute_path": {
                     "absolute_path": true,
                     "attribute_name": "$event_name",
                   }
               },
               {
                   "target_attribute_name": "$category3",
                   "source_attribute_path": {
                     "attribute_name": "cat3"
                   }
               },
                {
                   "target_attribute_name": "$category4",
                   "source_attribute_path": {
                     "attribute_name": "cat4"
                   }
               }
           ]
       }
    ]
  }
}

Get existing transformations

GET https://api.mediarithmics.com/v1/datamarts/:datamartId/analytics_event_transformation

Path Parameters

Name
Type
Description

datamartId

integer

The datamart ID

{
    "status": "ok",
    "data": [
        {
          "datamart_id": ":datamartId",
          "channel_id": "8888",
          "source_event_name": "order",
          "target_event_name": "$transaction_confirmed",
          "mapping_id": xxx
        },
        {
            ...
        }
    ]
}

Create an event transformation

POST https://api.mediarithmics.com/v1/datamarts/:datamartId/analytics_event_transformation

Path Parameters

Name
Type
Description

datamartId

integer

The datamart ID

Request Body

Name
Type
Description

Body

string

The event transformation object

Update an event transformation

PUT https://api.mediarithmics.com/v1/datamarts/:datamartId/analytics_event_transformation/:transformationId

Path Parameters

Name
Type
Description

transformationId

integer

The transformation ID

datamartId

integer

The datamart ID

Request Body

Name
Type
Description

Body

string

The event transformation object

Remove an event transformation

DELETE https://api.mediarithmics.com/v1/datamarts/:datamartId/analytics_event_transformation/:transformationId

Path Parameters

Name
Type
Description

transformationId

integer

The transformation ID

datamartId

integer

The datamart ID

Get property mappings

GET https://api.mediarithmics.com/v1/datamarts/:datamartId/analytics_mapping

Path Parameters

Name
Type
Description

datamartId

integer

The datamart ID

Create property mappings

POST https://api.mediarithmics.com/v1/datamarts/:datamartId/analytics_mapping

Path Parameters

Name
Type
Description

datamartId

integer

The datamart ID

Request Body

Name
Type
Description

Body

object

The property mapping object

{
  "status": "ok",
  "data": {
      id: 17,
      created_by: <>
      ...
  }
}

Delete property mappings

DELETE https://api.mediarithmics.com/v1/datamarts/:datamartId/analytics_mapping/:mappingId

Path Parameters

Name
Type
Description

mappingId

integer

The mapping ID

datamartId

integer

The datamart ID

{
    "status": "ok"
}
{
    "status": "error",
    "error": "Deleting a property mapping used in a transformation is forbidden",
    "error_code": "BAD_REQUEST_DATA",
    "error_id": "9460be23-0f80-4acb-9a33-dd8a1c5d08a9"
}

Those transformations don't transform user activities and events anywhere else. You should use to transform them everywhere.

To learn about predefined events, see

The ID of the to apply when transforming the event

Map events JSON as it is stored in the database and visible in user's timelines (post ).

activity analyzers
activity analyzers
Property mapping
user activities
predefined
event
predefined event names and properties
Predefined event names