Funnel API
The Data Studio > Funnel page in the navigator uses an API that you can leverage to analyze funnel conversions in your own tools. For more information on the feature, see Funnel.
post
https://api.mediarithmics.com
/v1/datamarts/:datamartId/user_activities_analytics
Retrieve dimensions values autocomplete
Here is a sample body payload
1
{
2
"date_ranges": [
3
{
4
"start_date": "2021-04-22T00:00:00",
5
"end_date": "2021-04-29T23:59:59"
6
}
7
],
8
"dimensions": [
9
{
10
"name": "TYPE"
11
}
12
],
13
"dimension_filter_clauses": {
14
"operator": "OR", // OR or AND
15
"filters": [
16
{
17
"dimension_name": "TYPE",
18
"operator": "LIKE", // LIKE, EXACT or IN_LIST
19
"expressions": [
20
""
21
]
22
}
23
]
24
},
25
"metrics": []
26
}
Copied!
post
https://api.mediarithmics.com
/v1/datamarts/:datamartId/user_analytics_funnel
Submit a funnel for results
Here is a sample payload:
1
{
2
"for": [
3
{
4
"name": "Step 1",
5
"filter_clause": {
6
"operator": "OR",
7
"filters": [
8
{
9
"dimension_name": "TYPE",
10
"not": false,
11
"operator": "EXACT",
12
"expressions": [
13
"DISPLAY_AD"
14
]
15
}
16
]
17
}
18
},
19
{
20
"name": "Step 2",
21
"filter_clause": {
22
"operator": "AND",
23
"filters": [
24
{
25
"dimension_name": "EVENT_TYPE",
26
"not": false,
27
"operator": "EXACT",
28
"expressions": [
29
"$transaction_confirmed"
30
]
31
},
32
{
33
"dimension_name": "CHANNEL_ID",
34
"not": false,
35
"operator": "IN_LIST",
36
"expressions": [
37
"8888",
38
"6666"
39
]
40
}
41
]
42
}
43
}
44
],
45
"in": {
46
"type": "DATES",
47
"start_date": "2021-04-23",
48
"end_date": "2021-05-01"
49
},
50
"limit": 5
51
}
Copied!

Dimensions

You can build queries with the following dimensions:
  • Activity Date DATE_TIME
  • Activity Type TYPE
  • Ad Group Id ORIGIN_SUB_CAMPAIGN_ID
  • Brand BRAND
  • Channel Id CHANNEL_ID
  • Campaign Id ORIGIN_CAMPAIGN_ID
  • Category 1 CATEGORY1
  • Category 2 CATEGORY2
  • Category 3 CATEGORY3
  • Category 4 CATEGORY4
  • Creative Id ORIGIN_CREATIVE_ID
  • Device Brand DEVICE_BRAND
  • Device Browser DEVICE_BROWSER_FAMILY
  • Device Carrier DEVICE_CARRIER
  • Device Form Factor DEVICE_FORM_FACTOR
  • Device Model DEVICE_MODEL
  • Device OS DEVICE_OS_FAMILY
  • Has conversion HAS_CONVERSION
  • Has clicked HAS_CLICKED
  • Has bounced HAS_BOUNCED
  • Event type EVENT_TYPE
  • Is in segment SEGMENT_ID
  • Campaign Id CAMPAIGN_ID
  • Goal Id GOAL_ID
  • Product Id PRODUCT_ID

Dimensions filters clause

This object represents a group of filters to apply in a request.
It has:
  • An operator field to apply either an AND or an OR between the filters
  • A filters array for the list filters to apply. For more information, see Dimensions filters.
1
"filter_clause": {
2
"operator": "OR", // OR or AND
3
"filters": [
4
...
5
]
6
}
Copied!

Dimensions filter

This object represents a filter in a filters clause.
It has;
  • A dimensions_name field to select the dimension it applies on. For more information, see Dimensions.
  • A not boolean field to apply boolean logic
  • An operator field to select one of the following queries:
    • EXACT will force the dimension to match the first expression set
    • LIKE will allow the dimension to only contain the first expression set
    • IN_LIST will allow the dimension to be one of the expressions set
  • A list of expressions representing the keywords to search for.

Examples

1
// TYPE should be DISPLAY_AD
2
{
3
"dimension_name": "TYPE",
4
"not": false,
5
"operator": "EXACT",
6
"expressions": [
7
"DISPLAY_AD"
8
]
9
}
10
11
// TYPE should contain SITE
12
// SITE_VISIT activities will be used
13
{
14
"dimension_name": "TYPE",
15
"not": false,
16
"operator": "LIKE",
17
"expressions": [
18
"SITE"
19
]
20
}
21
22
// TYPE should not contain SITE
23
{
24
"dimension_name": "TYPE",
25
"not": true,
26
"operator": "LIKE",
27
"expressions": [
28
"SITE"
29
]
30
}
31
32
// CHANNEL_ID should be either 8888 or 6666
33
{
34
"dimension_name": "CHANNEL_ID",
35
"not": false,
36
"operator": "IN_LIST",
37
"expressions": [
38
"8888",
39
"6666"
40
]
41
}
Copied!