We’ve migrated our documentation to a new site, which means some URLs have changed.
Audience

/segment/validate

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

id

String

Yes

Identifier for the segmentation rule to be validated.

siteGroupId

String

Yes

The site group identifier to validate the segmentation rule against.

type

String

Defaults to traffic

A new type of the segment, and must be either traffic (the default), external or dmp. A traffic segment has members derived from a traffic filter, while a external segment receives members using

/segment/data/update

. A dmp segment is a segment that extracts members by evaluating dmp event filter. It's not possible to change the type of a segment.

filters

Array of Object

For type traffic

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).

active

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

.

expandFilters

boolean

No

True if segment traffic filters must be expanded with traffic filters from referenced segments (going through all referenced segments recursively).

detailedCost

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: initialCost and detailedCostFilters.

Response

The response object for a successful query has the following fields:

Name

Type

Description

realtimeCompatible

boolean

True if the segment is compatible with realtime targeting.

segmentCostLimitExceeded

boolean

True if the segment has exceeded the cost limit set by the platform. Returned only if validated segment is active.

segmentCostLimit

number

The segment cost limit set by the platform. Returned only if validated segment is active.

segmentCost

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 detailedCost in that case is not available.

segmentCountLimitExceeded

boolean

True if the segment has exceeded the customer's segment count limit.

segmentCountLimit

number

The customer's segment count limit that the segment has exceeded. Returned only if segmentCountLimitExceeded is True.

totalItemsCount

number

The total number of traffic filter items in the segment (including all referenced segments recursively).

maxFilterItemsCount

number

The maximum number of items within a single traffic filter across all segment filters (going through referenced segments recursively).

totalFiltersCount

number

The total number of traffic filters in the segment (going through all referenced segments recursively).

totalSegmentsCount

number

The total number of referenced segments in the segment (going through all referenced segments recursively).

filterNestingLevel

number

The maximum level of traffic filters nesting in the segments (going through all referenced segments recursively).

segmentNestingLevel

number

The maximum level of segments nesting in the segments (going through all referenced segments recursively).

expandedFilters

number

The traffic filters of the segment being expanded with traffic filters from referenced segments (going through all referenced segments recursively). Returned only if expandFilters request parameter is True.

initialCost

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).

detailedCostFilters

number

The traffic filters of the segment but with an additional field cost inside each filter showing the cost spent on that particular filter node (including all its children).

Examples

Bash
$ 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"
}

Last updated: