Analytics Queries
Introduction to Analytics Queries
Analytics Queries are built on Segments and provide post-event analytics. Segments are built in the same way as above, with the exception that instead of referencing previously created segments they are written inline.
Segments are sent as POST requests to the Analytics Queries API along with a name and type They will take a small amount of time to process (5-20 seconds).
-d name=Visited Main Stage on Friday or Saturday
-d type=DEVICES
Query Types
Name | Description |
---|---|
DEVICES | The number of devices that match the segment |
PEOPLE | The number of people that match the segment. Only available if scaling has been provided |
AVERAGE_DWELL | The average amount of time a device spends meeting the segment (totalled over all qualifying visits) |
AVERAGE_VISIT_DWELL | The average amount of time a device spends meeting the segment per visit, ie the average duration of all visits. |
VISIT_COUNT | The number of visits to the segment |
The API can also provide a list of previously run queries.
Here is an example of the inline segments:
{
"id":"2588a96c-37c7-459a-9d28-fbad22f3911e",
"name":"creative name",
"segmentType":"ALL",
"hidden":false,
"filters":[
{
"id":"411414e6-721a-4cea-ac25-3eae64991aa4",
"filterType":"IN_BETWEEN",
"regionId":"9235b8b5-5658-489f-8d38-686efedb933e",
"from":1535187600000,
"to":1535194800000
}
],
"orderedIds": ["411414e6-721a-4cea-ac25-3eae64991aa4"]
"segments":[
{
"id":"2588a96c-37c7-459a-9d28-fbad22f3911f",
"segmentType":"ALL",
"hidden":false,
"orderedIds": ["b00d0f24-9931-4f73-892e-433b68b50996"]
"filters":[
{
"id":"b00d0f24-9931-4f73-892e-433b68b50996",
"filterType":"IN_BETWEEN",
"regionId":"1bfa7921-7653-4c3e-b445-1722ab97813e",
"from":1535194800000,
"to":1535202000000
}
],
"segments":[
]
}
]
}