Previews and estimates endpoints
As you develop a segment definition, you can use the estimate and preview tools within ۶Ƶ Experience Platform to view summary-level information to help ensure that you are isolating the audience you expect.
-
Previews provide paginated lists of qualifying profiles for a segment definition, allowing you to compare the results against what you expect.
-
Estimates provide statistical information on a segment definition, such as the projected audience size, confidence interval, and error standard deviation.
Getting started
The endpoints used in this guide are part of the ۶Ƶ Experience Platform Segmentation Service API. Before continuing, please review the getting started guide for important information that you need to know in order to successfully make calls to the API, including required headers and how to read example API calls.
How estimates are generated
When the ingestion of records into the Profile store increases or decreases the total profile count by more than 5%, a sampling job is triggered to update the count. The way data sampling is triggered depends on the method of ingestion:
- Batch ingestion: For batch ingestion, within 15 minutes of successfully ingesting a batch into the Profile store, if the 5% increase or decrease threshold is met, a job is run to update the count.
- Streaming ingestion: For streaming data workflows, a check is done on an hourly basis to determine if the 5% increase or decrease threshold has been met. If it has, a job is automatically triggered to update the count.
The sample size of the scan depends on the overall number of entities in your Profile store. These sample sizes are represented in the following table:
Create a new preview create-preview
You can create a new preview by making a POST request to the /preview
endpoint.
API format
POST /preview
Request
code language-shell |
---|
|
table 0-row-2 1-row-2 2-row-2 3-row-2 4-row-2 | |
---|---|
Property | Description |
predicateExpression |
The PQL expression to query the data by. |
predicateType |
The predicate type for the query expression under predicateExpression . Currently, the only accepted value for this property is pql/text . |
predicateModel |
The name of the Experience Data Model (XDM) schema class the profile data is based on. |
graphType |
The graph type that you want to get the cluster from. The supported values are none (performs no identity stitching) and pdg (performs identity stitching based on your private identity graph). |
Response
A successful response returns HTTP status 201 (Created) with details of your newly created preview.
code language-json |
---|
|
table 0-row-2 1-row-2 2-row-2 | |
---|---|
Property | Description |
state |
The current state of the preview job. When initially created, it will be in the “NEW” state. Subsequently, it will be in the “RUNNING” state until processing is complete, at which point it becomes “RESULT_READY” or “FAILED”. |
previewId |
The ID of the preview job, to be used for lookup purposes when viewing an estimate or preview, as outlined in the next section. |
Retrieve the results of a specific preview get-preview
You can retrieve detailed information about a specific preview by making a GET request to the /preview
endpoint and providing the preview ID in the request path.
API format
GET /preview/{PREVIEW_ID}
{PREVIEW_ID}
previewId
value of the preview you want to retrieve.Request
code language-shell |
---|
|
Response
A successful response returns HTTP status 200 with detailed information about the specified preview.
code language-json |
---|
|
table 0-row-2 1-row-2 | |
---|---|
Property | Description |
results |
A list of entity IDs, along with their related identities. The links provided can be used to look up the specified entities, using the profile access API endpoint. |
Retrieve the results of a specific estimate job get-estimate
Once you have created a preview job, you can use its previewId
in the path of a GET request to the /estimate
endpoint to view statistical information about the segment definition, including projected audience size, confidence interval, and error standard deviation.
API format
GET /estimate/{PREVIEW_ID}
{PREVIEW_ID}
previewId
value returned when the preview job was created.Request
The following request retrieves the results of a specific estimate job.
code language-shell |
---|
|
Response
A successful response returns HTTP status 200 with details of the estimate job.
code language-json |
---|
|
table 0-row-2 1-row-2 2-row-2 3-row-2 | |
---|---|
Property | Description |
estimatedNamespaceDistribution |
An array of objects showing the number of profiles within the segment definition broken down by identity namespace. The total number of profiles by namespace (adding together the values shown for each namespace) may be higher than the profile count metric because one profile could be associated with multiple namespaces. For example, if a customer interacts with your brand on more than one channel, multiple namespaces will be associated with that individual customer. |
state |
The current state of the preview job. The state will be “RUNNING” until processing is complete, at which point it becomes “RESULT_READY” or “FAILED”. |
_links.preview |
When the state is “RESULT_READY”, this field provides a URL to view the estimate. |
Next steps
After reading this guide you should have a better understanding of how to work with previews and estimates using the Segmentation API. To learn how to access metrics related to your Real-Time Customer Profile data, such as the total number of profile fragments and merged profiles within specific namespaces or the Profile data store as a whole, please visit the profile preview (/previewsamplestatus
) endpoint guide.