Comment on page
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.
You enable this feature when you set up at least:
- One segment builder
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
// Create a standard segment builder payload
{
"datamart_id": "string",
"demographics_features_ids": [
"string"
],
"name": "string"
}
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
// Edit a standard segment builder payload
{
"datamart_id": "string",
"demographics_features_ids": [
"string"
],
"name": "string"
}
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
// Create a dashboard payload example
[
{
"id": "1",
"name": "Standard segment builder",
"type": "AUDIENCE_BUILDER",
"datamart_id": "xxxx",
"components": [
{
"layout": {
"h": 1,
"static": false,
"w": 6,
"x": 0,
"y": 0
},
"component": {
"id": 2,
"component_type": "COUNT",
"title": "User Profiles",
"query_id": "22252"
}
},
{
"layout": {
"h": 1,
"static": false,
"w": 6,
"x": 6,
"y": 0
},
"component": {
"id": 2,
"component_type": "COUNT",
"title": "User Cookies",
"query_id": "22264"
}
},
{
"layout": {
"h": 3,
"static": false,
"w": 12,
"x": 0,
"y": 1
},
"component": {
"id": 5,
"component_type": "MAP_BAR_CHART",
"title": "Genre",
"show_legend": true,
"query_id": "47031",
"sortKey": "A-Z",
"percentage": true,
"labels": {
"enable": true,
"filterValue": "",
"format": "{point.y}%"
},
"tooltip": {
"formatter": "{point.y}% ({point.count})"
}
}
},
{
"layout": {
"h": 3,
"static": false,
"w": 12,
"x": 0,
"y": 4
},
"component": {
"id": 5,
"component_type": "COUNT_BAR_CHART",
"labels_enabled": true,
"plot_labels": [
"Email",
"Print",
"Sms",
"Tel",
"Web",
"App"
],
"title": "Contactabilité",
"show_legend": false,
"query_ids": [
"47033",
"47034",
"47035",
"47036",
"47037",
"47038"
]
}
}
]
}
]
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.
Your csv file should have:
- The following format: 1 level min and 8 levels max, final_value,
level1,level2, ... ,final_value
Example
level1,level2,level3,level4,final_value
activities,channel_id,,,my channel id1
segments,creation_ts,,,123
...
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]
.
post
https://api.mediarithmics.com
/v1/datamarts/{datamart_id}/reference_table_job_executions
Upload final values csv file
Example
curl -k --location --request POST 'https://api.mediarithmics.com/v1/datamarts/{datamart_id}/reference_table_job_executions' \
-H 'Content-Type: text/csv' \
-H 'Authorization: TOKEN' \
--data-binary '@./final_value_file.csv'
Last modified 2yr ago