邊緣分段
邊緣區段能讓您在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 Platform API端點,請閱讀以下指南: 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上提供區段最多需要一小時的時間。