與Adobe Analytics互動

概觀 overview

Adobe Analytics資料收集的運作方式是將XDM資料轉譯成Adobe Analytics可以理解的格式。 多個XDM欄位是自動對應到Analytics變數的。 您也可以手動將XDM值對應至舊版Analytics變數。

若要讓Adobe Analytics能夠接收來自伺服器API的資料,您需要設定資料流,以在資料流設定頁面中輸入報表套裝ID,將事件轉送至Adobe Analytics。

Adobe Analytics資料流組態

與Adobe Analytics互動 interacting-analytics

API格式 format

POST /ee/v2/interact?dataStreamId={DATASTREAM_ID}

請求 request

下列範例包含來自_experience.analytics欄位群組的數個自動對應值。 它也包括以JSON為基礎的資料層。 雖然這些資料層無法自動對應,但可以使用資料收集的資料準備將這些值對應到包含上述欄位群組的結構描述。

使用者對應到這些欄位的所有值都會自動對應到適當的Analytics值,就像這些值包含在API請求中一樣。

curl -X POST "https://server.adobedc.net/ee/v2/interact?dataStreamId={DATASTREAM_ID}" \
-H "Authorization: Bearer {TOKEN}"
-H "x-gw-ims-org-id: {ORG_ID}"
-H "x-api-key: {API_KEY}"
-H "Content-Type: application/json" \
-d '{
   "event": {
      "xdm": {
         "eventType": "web.webpagedetails.pageViews",
         "web": {
            "webPageDetails": {
               "URL": "https://alloystore.dev",
               "name": "Home Page"
            },
            "webReferrer": {
               "URL": ""
            }
         },
         "device": {
            "screenHeight": 1440,
            "screenWidth": 3440,
            "screenOrientation": "landscape"
         },
         "environment": {
            "type": "browser",
            "browserDetails": {
               "viewportWidth": 3440,
               "viewportHeight": 1440
            }
         },
         "placeContext": {
            "localTime": "2022-03-22T22:45:21.193-06:00",
            "localTimezoneOffset": 360
         },
         "timestamp": "2022-03-23T04:45:21.193Z",
         "implementationDetails": {
            "name": "https://ns.adobe.com/experience/alloy/reactor",
            "version": "2.8.0+2.9.0",
            "environment": "browser"
         },
         "_experience": {
            "analytics": {
               "customDimensions": {
                  "eVars": {
                     "eVar14": "eVar14"
                  }
               },
               "event1to100": {
                  "event13": {
                     "value": 1
                  },
                  "event14": {
                     "value": 2
                  }
               }
            }
         }
      }
   },
   "data": {
      "page": {
         "pageInfo": {
            "pageName": "Promotions",
            "siteSection": "Home"
         },
         "promos": {
            "heroPromos": "purse,shoes,sunglasses"
         },
         "customVariables": {
            "testGroup": "orange/black theme"
         },
         "events": {
            "homePage": true
         },
         "products": [
            {
               "productSKU": "abc123",
               "productName": "shirt"
            }
         ]
      }
   }
}'

回應 response

{
   "requestId": "d2ad6364-5675-4a86-ba41-50e7a4c4a299",
   "handle": []
}
recommendation-more-help
f36c2cef-1417-40aa-a11d-5d0abaee121b