批量分段指南
创建对象:
- 用户
批量分段是一种分段评估方法,允许您一次移动所有用户档案数据以创建相应的受众。
通过批处理分段,您可以创建详细且丰富的受众,并运行分段作业以确定何时希望将此数据传播到下游服务。
符合条件的查询类型
所有查询均适合批量分段。
创建受众
您可以创建通过使用分段服务API或通过UI中的受众门户使用批次分段进行评估的受众。
API格式
POST /segment/definitions
请求
curl -X POST https://platform.adobe.io/data/core/ups/segment/definitions
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'Content-Type: application/json' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
-d '{
"name": "People in the USA",
"description: "An audience that looks for people who live in the USA",
"expression": {
"type": "PQL",
"format": "pql/text",
"value": "homeAddress.country = \"US\""
},
"evaluationInfo": {
"batch": {
"enabled": true
},
"continuous": {
"enabled": false
},
"synchronous": {
"enabled": false
}
},
"schema": {
"name": "_xdm.context.profile"
}
}'
响应
成功的响应会返回HTTP状态200以及新创建的区段定义的详细信息。
{
"id": "4afe34ae-8c98-4513-8a1d-67ccaa54bc05",
"schema": {
"name": "_xdm.context.profile"
},
"profileInstanceId": "ups",
"imsOrgId": "{ORG_ID}",
"sandbox": {
"sandboxId": "28e74200-e3de-11e9-8f5d-7f27416c5f0d",
"sandboxName": "prod",
"type": "production",
"default": true
},
"name": "People in the USA",
"description": "An audience that looks for people who live in the USA",
"expression": {
"type": "PQL",
"format": "pql/text",
"value": "homeAddress.country = \"US\""
},
"evaluationInfo": {
"batch": {
"enabled": true
},
"continuous": {
"enabled": false
},
"synchronous": {
"enabled": false
}
},
"dataGovernancePolicy": {
"excludeOptOut": true
},
"creationTime": 0,
"updateEpoch": 1579292094,
"updateTime": 1579292094000
}
有关使用此端点的详细信息,请参阅区段定义端点指南。
在受众门户中,选择 创建受众。
此时会出现弹出窗口。 选择 生成规则 以进入区段生成器。
创建区段定义后,选择 批次 作为 评估方法。
要了解有关创建区段定义的更多信息,请参阅区段生成器指南
检索受众
您可以在UI中使用分段服务API或通过Audience Portal检索使用批次分段评估的所有受众。
通过对/segment/definitions
端点发出GET请求,检索使用贵组织内的批次分段评估的所有区段定义的列表。
API格式
您必须在请求路径中包含查询参数evaluationInfo.batch.enabled=true
,以检索使用批处理分段评估的区段定义。
GET /segment/definitions?evaluationInfo.batch.enabled=true
请求
curl -X GET \
'https://platform.adobe.io/data/core/ups/segment/definitions?evaluationInfo.batch.enabled=true' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'Content-Type: application/json' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
响应
成功的响应会返回HTTP状态200,其中包含组织中使用批处理分段评估的区段定义数组。
{
"segments": [
{
"id": "15063cb-2da8-4851-a2e2-bf59ddd2f004",
"schema": {
"name": "_xdm.context.profile"
},
"ttlInDays": 30,
"imsOrgId": "{ORG_ID}",
"sandbox": {
"sandboxId": "",
"sandboxName": "",
"type": "production",
"default": true
},
"name": " People who are NOT on their homepage ",
"expression": {
"type": "PQL",
"format": "pql/text",
"value": "select var1 from xEvent where var1._experience.analytics.endUser.firstWeb.webPageDetails.isHomePage = false"
},
"evaluationInfo": {
"batch": {
"enabled": true
},
"continuous": {
"enabled": false
},
"synchronous": {
"enabled": false
}
},
"creationTime": 1572029711000,
"updateEpoch": 1572029712000,
"updateTime": 1572029712000
},
{
"id": "f15063cb-2da8-4851-a2e2-bf59ddd2f004",
"schema": {
"name": "_xdm.context.profile"
},
"ttlInDays": 30,
"imsOrgId": "{ORG_ID}",
"sandbox": {
"sandboxId": "",
"sandboxName": "",
"type": "production",
"default": true
},
"name": "Homepage_continuous",
"description": "People who are on their homepage - continuous",
"expression": {
"type": "PQL",
"format": "pql/text",
"value": "select var1 from xEvent where var1._experience.analytics.endUser.firstWeb.webPageDetails.isHomePage = true"
},
"evaluationInfo": {
"batch": {
"enabled": true
},
"continuous": {
"enabled": true
},
"synchronous": {
"enabled": false
}
},
"creationTime": 1572021085000,
"updateEpoch": 1572021086000,
"updateTime": 1572021086000
}
],
"page": {
"totalCount": 2,
"totalPages": 1,
"sortField": "creationTime",
"sort": "desc",
"pageSize": 2,
"limit": 100
},
"link": {}
}
有关返回的区段定义的更多详细信息可在区段定义终结点指南中找到。
通过使用Audience Portal中的筛选条件,您可以检索贵组织中支持批量分段的所有受众。 选择
在可用筛选器内,转到 更新频率 并选择“批次”。 使用此过滤器可显示贵组织中使用批处理分段评估的所有受众。
要了解有关在Experience Platform中查看受众的更多信息,请阅读受众门户指南。