边缘分段
边缘分段能够在边缘即时评估Adobe Experience Platform中的区段定义,启用同一页面和下一页面个性化用例。
快速入门
本开发人员指南要求您实际了解各种 Adobe Experience Platform 边缘分段涉及的服务。 在开始本教程之前,请查看以下服务的文档:
- Real-Time Customer Profile:根据来自多个来源的汇总数据,实时提供统一的用户用户档案。
- Adobe Experience Platform Segmentation Service:允许您从构建受众 Real-Time Customer Profile 数据。
- Experience Data Model (XDM):用于实现此目标的标准化框架 Platform 组织客户体验数据。
要成功调用任何Experience PlatformAPI端点,请阅读以下指南: Platform API快速入门 了解所需的标头以及如何读取示例API调用。
边缘分段查询类型 query-types
为了使用边缘分段来评估区段,查询必须遵循以下准则:
chain(xEvent, timestamp, [A: WHAT(eventType = "addToCart")])
homeAddress.countryCode = "US"
homeAddress.countryCode = "US" and chain(xEvent, timestamp, [A: WHAT(eventType = "addToCart")])
not(chain(xEvent, timestamp, [A: WHAT(eventType = "homePageView")]))
chain(xEvent, timestamp, [X: WHAT(eventType = "addToCart") WHEN(< 24 hours before now)])
homeAddress.countryCode = "US" and chain(xEvent, timestamp, [X: WHAT(eventType = "addToCart") WHEN(< 24 hours before now)])
homeAddress.countryCode = "US" and not(chain(xEvent, timestamp, [X: WHAT(eventType = "addToCart") WHEN(< 24 hours before now)]))
chain(xEvent, timestamp, [A: WHAT(eventType = "homePageView") WHEN(< 24 hours before now) COUNT(5) ] )
homeAddress.countryCode = "US" and chain(xEvent, timestamp, [A: WHAT(eventType = "homePageView") WHEN(< 24 hours before now) COUNT(5) ] )
not(chain(xEvent, timestamp, [A: WHAT(eventType = "homePageView") WHEN(< 24 hours before now) COUNT(5) ] ))
chain(xEvent, timestamp, [X: WHAT(eventType = "homePageView") WHEN(< 24 hours before now)]) and chain(xEvent, timestamp, [X: WHAT(eventType = "checkoutPageView") WHEN(< 24 hours before now)])
homeAddress.countryCode = "US" and chain(xEvent, timestamp, [X: WHAT(eventType = "homePageView") WHEN(< 24 hours before now)]) and chain(xEvent, timestamp, [X: WHAT(eventType = "checkoutPageView") WHEN(< 24 hours before now)])
homeAddress.countryCode = "US" and inSegment("existing segment")
chain(xEvent, timestamp, [A: WHAT(eventType = "addToCart") WHERE(externalSegmentMapProperty.values().exists(stringProperty="active"))])
此外,区段 必须 绑定到在Edge上处于活动状态的合并策略。 有关合并策略的更多信息,请参阅 合并策略指南.
区段定义将 非 在以下情况下启用边缘分段:
- 区段定义包括单个事件和
inSegment
事件。- 然而,倘分部包含在
inSegment
事件仅用于配置文件,区段定义 将 启用边缘分段。
- 然而,倘分部包含在
- 区段定义使用“忽略年份”作为其时间限制的一部分。
检索为边缘分段启用的所有区段
您可以通过对以下网站发出GET请求,检索您的组织中启用了边缘分段的所有区段的列表: /segment/definitions
端点。
API格式
要检索为边缘分段启用的区段,您必须包括查询参数 evaluationInfo.synchronous.enabled=true
在请求路径中。
GET /segment/definitions?evaluationInfo.synchronous.enabled=true
请求
curl -X GET \
'https://platform.adobe.io/data/core/ups/segment/definitions?evaluationInfo.synchronous.enabled=true' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
响应
成功的响应会返回组织中启用了边缘分段的一系列区段。 有关返回的区段定义的更多详细信息,请参阅 区段定义端点指南.
{
"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": false
},
"continuous": {
"enabled": false
},
"synchronous": {
"enabled": true
}
},
"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": false
},
"continuous": {
"enabled": false
},
"synchronous": {
"enabled": true
}
},
"creationTime": 1572021085000,
"updateEpoch": 1572021086000,
"updateTime": 1572021086000
}
],
"page": {
"totalCount": 2,
"totalPages": 1,
"sortField": "creationTime",
"sort": "desc",
"pageSize": 2,
"limit": 100
},
"link": {}
}
创建启用边缘分段的区段
您可以通过对以下对象发出POST请求,创建启用边缘分段的分段: /segment/definitions
与以下项之一匹配的端点: 上面列出的边缘分段查询类型.
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-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-d '{
"schema": {
"name": "_xdm.context.profile"
},
"ttlInDays": 30,
"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": false
},
"continuous": {
"enabled": false
},
"synchronous": {
"enabled": true
}
}
}'
响应
成功的响应会返回为边缘分段启用的新创建区段定义的详细信息。
{
"id": "f15063cb-2da8-4851-a2e2-bf59ddd2f004",
"schema": {
"name": "_xdm.context.profile"
},
"ttlInDays": 30,
"imsOrgId": "{ORG_ID}",
"sandbox": {
"sandboxId": "{SANDBOX_ID}",
"sandboxName": "{SANDBOX_NAME}",
"type": "production",
"default": true
},
"name": "Homepage_continuous",
"description": "People who are on their homepage - continuous",
"expression": {
"type": "PQL",
"format": "pql/text",
"value": "chain(xEvent, timestamp, [X: WHAT(var1._experience.analytics.endUser.firstWeb.webPageDetails.isHomePage = "true")])"
},
"evaluationInfo": {
"batch": {
"enabled": false
},
"continuous": {
"enabled": false
},
"synchronous": {
"enabled": true
}
},
"creationTime": 1572021085000,
"updateEpoch": 1572021086000,
"updateTime": 1572021086000
}
后续步骤
现在,您已了解如何创建支持边缘分段的区段,接下来可以使用它们启用同一页面和下一页面个性化用例。
要了解如何使用Adobe Experience Platform用户界面执行类似操作和处理区段,请访问 区段生成器用户指南.
附录
以下部分列出了有关边缘分段的常见问题解答:
区段需要多久才能在Edge Network上可用?
在Edge Network上提供一个区段最多需要一小时。