Segment builders
You have access to three tools to segment your audience using queries:
  • Leverage audience features to build your queries in the standard segment builder (Audience > Builders > Standard). Once set up, this is the preferred solution for fast queries building and visualising the segment in a dashboard before saving it.
  • Drag and drop fields from your schema into a visual OTQL query builder with the advanced segment builder (Audience > Builders > Advanced). It doesn't require any setup but requires knowledge about the schema. May not be the best option for casual users.
  • Build OTQL queries directly in Data Studio > Query tool. This requires a solid knowledge of your schema and OTQL.

Standard segment builder set up

You enable this feature when you set up at least:
You can set up multiple segment builder to create templates once you identify common segment queries that you often use.
Each segment builder has a list of default audience features that are automatically used in it.
You can create and edit segment builders through the UI by going to Settings > Datamart > Your datamart > Segment builders. You can also manage them by API.
get
https://api.mediarithmics.com
/v1/datamarts/{datamart_id}/audience_builders
List standard segment builders
get
https://api.mediarithmics.com
/v1/datamarts/{datamart_id}/audience_builders/{audience_builders_id}
Get a standard segment builder
post
https://api.mediarithmics.com
/v1/datamarts/{datamart_id}/audience_builders
Create a standard segment builder
1
// Create a standard segment builder payload
2
{
3
"datamart_id": "string",
4
"demographics_features_ids": [
5
"string"
6
],
7
"name": "string"
8
}
Copied!
You cannot create more than 20 standard segment builder instances per datamart.
put
https://api.mediarithmics.com
/v1/datamarts/{datamart_id}/audience_builders/{audience_builders_id}
Edit a standard segment builder
1
// Edit a standard segment builder payload
2
{
3
"datamart_id": "string",
4
"demographics_features_ids": [
5
"string"
6
],
7
"name": "string"
8
}
Copied!

Dashboards API

This API helps you upload dashboards.
get
https://api.mediarithmics.com
/v1/data_file/data?uri=mics://data_file/tenants/{organisation_id}/dashboards/{datamart_id}/AUDIENCE_BUILDER-{audience_builder_id}.json
List dashboards for standard segment builder
put
https://api.mediarithmics.com
/v1/data_file/data?uri=mics://data_file/tenants/{organisation_id}/dashboards/{datamart_id}/AUDIENCE_BUILDER-{audience_builder_id}.json
Create & edit dashboards for standard segment builder
1
// Create a dashboard payload example
2
[
3
{
4
"id": "1",
5
"name": "Standard segment builder",
6
"type": "AUDIENCE_BUILDER",
7
"datamart_id": "xxxx",
8
"components": [
9
{
10
"layout": {
11
"h": 1,
12
"static": false,
13
"w": 6,
14
"x": 0,
15
"y": 0
16
},
17
"component": {
18
"id": 2,
19
"component_type": "COUNT",
20
"title": "User Profiles",
21
"query_id": "22252"
22
}
23
},
24
{
25
"layout": {
26
"h": 1,
27
"static": false,
28
"w": 6,
29
"x": 6,
30
"y": 0
31
},
32
"component": {
33
"id": 2,
34
"component_type": "COUNT",
35
"title": "User Cookies",
36
"query_id": "22264"
37
}
38
},
39
{
40
"layout": {
41
"h": 3,
42
"static": false,
43
"w": 12,
44
"x": 0,
45
"y": 1
46
},
47
"component": {
48
"id": 5,
49
"component_type": "MAP_BAR_CHART",
50
"title": "Genre",
51
"show_legend": true,
52
"query_id": "47031",
53
"sortKey": "A-Z",
54
"percentage": true,
55
"labels": {
56
"enable": true,
57
"filterValue": "",
58
"format": "{point.y}%"
59
},
60
"tooltip": {
61
"formatter": "{point.y}% ({point.count})"
62
}
63
}
64
},
65
{
66
"layout": {
67
"h": 3,
68
"static": false,
69
"w": 12,
70
"x": 0,
71
"y": 4
72
},
73
"component": {
74
"id": 5,
75
"component_type": "COUNT_BAR_CHART",
76
"labels_enabled": true,
77
"plot_labels": [
78
"Email",
79
"Print",
80
"Sms",
81
"Tel",
82
"Web",
83
"App"
84
],
85
"title": "Contactabilité",
86
"show_legend": false,
87
"query_ids": [
88
"47033",
89
"47034",
90
"47035",
91
"47036",
92
"47037",
93
"47038"
94
]
95
}
96
}
97
]
98
}
99
]
Copied!

Final values import

In ordre to be able to select audience features thanks to final values, you should first import your final values thanks to a csv file. For more information about the search by final feature, please read the search by final value feature guider.

Requirements

Your csv file should have:
  • The following format: 1 level min and 8 levels max, final_value,
1
level1,level2, ... ,final_value
Copied!
Example
1
level1,level2,level3,level4,final_value
2
activities,channel_id,,,my channel id1
3
segments,creation_ts,,,123
4
...
Copied!
Don't need to specify UserPoint for the level1, it's implicit.
  • A maximum of 100 000 lines, each line should match your schema,
  • Final values' field of type String or [String].

API

post
https://api.mediarithmics.com
/v1/datamarts/{datamart_id}/reference_table_job_executions
Upload final values csv file
Example
1
curl -k --location --request POST 'https://api.mediarithmics.com/v1/datamarts/{datamart_id}/reference_table_job_executions' \
2
-H 'Content-Type: text/csv' \
3
-H 'Authorization: TOKEN' \
4
--data-binary '@./final_value_file.csv'
Copied!