Events pattern

This guide is only available for Analytics Suite Delta analysis

 

Send events

Events are sent through GET or POST requests, in the query parameter events. This parameter takes an array of objects, each object being an event.

Example:

https://YOURSSLCOLLECTDOMAIN/pixel?s=YOURSITEID&events=[{<eventObject>}]
 

Event object pattern

An event object is following this pattern:

PropertyTypeDescription
namestringEvent name
dataobjectEvent data model properties
 

Event example

{
  "name": "av.heartbeat",
  "data": {
    "av_content_id": "bc35",
    "av_session_id": "799d9f3b-7307-4113-a260-2e1371e35fe6",
    "av_content": "Broadchurch 3.5",
    ...
  }
}
 

Reference

 

events query parameter (array)

Events are sent in the query parameter events, containing an URI encoded array of objects, each one representing an event:

[
  EventObject (object),
  EventObject (object),
  EventObject (object)
]
 

EventObject (object)

Event object must follow this pattern:

{
  "name": EventName (string),
  "data": EventData (object)
}
 

EventName (string)

Event name must follow these rules:

  • lowercase (our processing will automatically lowercase it)
  • authorized characters: a→z 0→9 . _ -
  • no space

Example: page.display

 

EventData (object)

Event data is an object following this pattern:

{
  PropKey (string): PropValue (any),
  PropKey (string): PropValue (any)
}
 

PropKey (string)

Property key must follow these rules:

  • lowercase (our processing will automatically lowercase it)
  • authorized characters: a→z 0→9 _
  • no space
  • begin with a→z
  • can’t begin with : m_ visit_ or a number
  • JSON object will be flattened with _ in your data model (e.g: {'page': {'name':'foo'}} = {'page_name':'foo'}
  • $ will be considered as the root of the parent (e.g: {'page': {'$':'foo'}} = {'page':'foo'})
 

Property type

In order to type the property, you can use a prefix:

  • s: → string
  • f: → float
  • n: → integer
  • b: → boolean
  • d: → date
  • a:X: → array of X type (e.g: a:s: means array of strings)

Properties ending with _date, _utc, _timestamp and _ts are automatically casted as dates if the format is:

  • Timestamp in seconds
  • ISO

If the type prefix is not set, the JSON type will be assigned to the property:

  • string
  • float (any number will be considered as a float)
  • boolean
  • object (JSON object)
 

PropValue (any)

Property value can be of any JSON valid type.

Cet article a-t-il été utile ?

Last update: 30/07/2020