API call to validate an audience segmentation rule.
The user must be authenticated and have write permissions to the siteGroup.
Request
The request object has the following fields:
|
Name |
Type |
Required |
Description |
|---|---|---|---|
|
|
String |
Yes |
Identifier for the segmentation rule to be validated. |
|
|
String |
Yes |
The site group identifier to validate the segmentation rule against. |
|
|
String |
Defaults to |
A new type of the segment, and must be either /segment/data/update . A |
|
|
Array of Object |
For type |
A new list of filters that define a subset of the audience. The filter syntax is documented here . Note that the segment should include a time-filter to specify the length of time of event traffic to use as basis for the segment. If not, the time period the segment covers is 24 hours. The maximum time period is 31 days, unless the sites are configured for long term storage (LTS) (see the warning above). |
|
|
boolean |
No |
True if the segment is going to be enabled for active usage. False if otherwise. No value means segment original value is preserved. Explained here . |
|
|
boolean |
No |
True if segment traffic filters must be expanded with traffic filters from referenced segments (going through all referenced segments recursively). |
|
|
boolean |
No |
True if the result segment cost must be broken down into smaller details. This results in 2 new fields returned in the response: |
Response
The response object for a successful query has the following fields:
|
Name |
Type |
Description |
|---|---|---|
|
|
boolean |
True if the segment is compatible with realtime targeting. |
|
|
boolean |
True if the segment has exceeded the cost limit set by the platform. Returned only if validated segment is |
|
|
number |
The segment cost limit set by the platform. Returned only if validated segment is |
|
|
number |
The evaluated cost of the validated segment. In case the segment incurs an extremely high cost so that we are not able to correctly evaluate it, a special value of 1_000_000_000 is returned instead and |
|
|
boolean |
True if the segment has exceeded the customer's segment count limit. |
|
|
number |
The customer's segment count limit that the segment has exceeded. Returned only if |
|
|
number |
The total number of traffic filter items in the segment (including all referenced segments recursively). |
|
|
number |
The maximum number of items within a single traffic filter across all segment filters (going through referenced segments recursively). |
|
|
number |
The total number of traffic filters in the segment (going through all referenced segments recursively). |
|
|
number |
The total number of referenced segments in the segment (going through all referenced segments recursively). |
|
|
number |
The maximum level of traffic filters nesting in the segments (going through all referenced segments recursively). |
|
|
number |
The maximum level of segments nesting in the segments (going through all referenced segments recursively). |
|
|
number |
The traffic filters of the segment being expanded with traffic filters from referenced segments (going through all referenced segments recursively). Returned only if |
|
|
number |
The cost spent on initial "pre-filtering" phase which includes, for instance, filtering by all the sites contained in the segment site group as well as filtering by the longest time period spanning across all the "time" filters in the segment (this is done purely for optimization purposes and guarantees that further "time" filtering is much less expensive). |
|
|
number |
The traffic filters of the segment but with an additional field |
Examples
$ python cx.py /segment/validate '{"siteGroupId":"10501", "filters":[{"type":"time", "start":"-2d", "filter":{"type":"event", "group":"referrerHost", "item":"google.com"}}]}'
{
"realtimeCompatible": "true"
}
$ python cx.py /segment/validate '{"siteGroupId":"10501", "type":"dmp", filters":[{"type":"user","having":{"min":1,"filter":{"type":"dmp-event","group":"origin","item":"user-filtering"}}}]}'
{
"realtimeCompatible": "false"
}