建立測試設定檔 create-test-profiles

在歷程中使用測試模式時需要測試設定檔。 若要瞭解如何使用測試模式,請參閱 本節.

在Adobe Experience Platform中建立測試設定檔有不同的方式。 在本檔案中,我們著重介紹兩種方法:上傳 csv檔案 和使用 API呼叫. 您也可以上傳資料集中的json檔案,請參閱 資料擷取檔案.

這些匯入方法也可讓您更新設定檔屬性。 如此一來,您就可以將現有的設定檔轉換為測試設定檔。 只需使用類似的檔案或API呼叫,且僅加入值為「true」的「testProfile」欄位。

建立測試設定檔與在Adobe Experience Platform中建立一般設定檔類似。 如需詳細資訊,請參閱 即時客戶個人檔案檔案.

先決條件 test-profile-prerequisites

為了能夠建立設定檔,您首先需要在Adobe Experience Platform中建立結構描述和資料集。

首先,您需要 建立結構描述. 請按照以下步驟操作:

  1. 在Adobe Experience Platform中,按一下 Schemas,位於左側功能表。
  2. 按一下 Create schema,然後選取結構描述型別,例如 XDM Individual Profile.
  3. 選擇結構描述的名稱。
  4. Mixins 區段,按一下 Add
  5. 選取適當的mixin。 請務必新增 Profile test details mixin。 按一下「Add mixin」。

    Mixin清單會顯示在架構概觀畫面上。
  6. 在欄位清單中,按一下要定義為主要身分的欄位。
  7. Field properties 右側面板,勾選 IdentityPrimary Identity 選項並選取名稱空間。 如果您希望主要身分識別是電子郵件地址,請選擇 Email 名稱空間。 按一下「Apply」。
  8. 選取結構描述並啟用 Profile 中的選項 Schema properties.
  9. 按一下「Save」。
NOTE
有關建立架構的詳細資訊,請參閱 XDM檔案.

之後,您需要 建立資料集 將在其中匯入設定檔。 請按照以下步驟操作:

  1. 在Adobe Experience Platform中,按一下 Datasets,然後在左側功能表中按一下 Create dataset.
  2. 選擇 Create dataset from schema.
  3. 選取先前建立的綱要,然後按一下 Next.
  4. 選擇名稱,然後按一下 Finish.
  5. 啟用 Profile 選項。
NOTE
如需建立資料集的詳細資訊,請參閱 目錄服務檔案.

使用csv檔案建立測試設定檔 create-test-profiles-csv

在Adobe Experience Platform中,您可以上傳包含不同設定檔欄位的csv檔案來建立設定檔至您的資料集。 這是最簡單的方法。

  1. 使用試算表軟體建立簡單的csv檔案。
  2. 為每個所需欄位新增一欄。 請務必新增主要身分欄位(以上範例中為「personID」),並將「testProfile」欄位設為「true」。
  3. 為每個設定檔新增一行,並填寫每個欄位的值。
  4. 將試算表儲存為csv檔案。 請務必使用逗號做為分隔符號。
  5. 在Adobe Experience Platform中,按一下 Workflows,位於左側功能表。
  6. 選擇 Map CSV to XDM schema,然後按一下 Launch.
  7. 選取您要將設定檔匯入的資料集。 按一下「Next」。
  8. 按一下 Choose files 並選取您的csv檔案。 上傳檔案時,按一下 Next.
  9. 將來源csv欄位對應到結構描述欄位,然後按一下 Finish.
  10. 資料匯入隨即開始。 狀態將從「 」移至「 」 ProcessingSuccess. 按一下 Preview data set,位於右上方。
  11. 檢查測試設定檔是否已正確新增。

您的測試設定檔已新增,現在可用於測試歷程。 請參閱本節

NOTE
如需csv匯入的詳細資訊,請參閱 資料擷取檔案.

使用API呼叫建立測試設定檔 create-test-profiles-api

您也可以透過API呼叫建立測試設定檔。 請參閱此頁面

您必須使用包含「設定檔測試詳細資料」mixin的設定檔結構描述。 testProfile旗標是此mixin的一部分。

建立設定檔時,請務必傳遞值: testProfile = true。

請注意,您也可以更新現有的設定檔,將其testProfile標幟變更為「true」。

以下為建立測試設定檔的API呼叫範例:

curl -X POST \
'https://dcs.adobedc.net/collection/xxxxxxxxxxxxxx' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-H 'Postman-Token: xxxxx' \
-H 'cache-control: no-cache' \
-H 'x-api-key: xxxxx' \
-H 'x-gw-ims-org-id: xxxxx' \
-d '{
"header": {
"msgType": "xdmEntityCreate",
"msgId": "xxxxx",
"msgVersion": "xxxxx",
"xactionid":"xxxxx",
"datasetId": "xxxxx",
"imsOrgId": "xxxxx",
"source": {
"name": "Postman"
},
"schemaRef": {
"id": "https://example.adobe.com/mobile/schemas/xxxxx",
"contentType": "application/vnd.adobe.xed-full+json;version=1"
}
},
"body": {
"xdmMeta": {
"schemaRef": {
"contentType": "application/vnd.adobe.xed-full+json;version=1"
}
},
"xdmEntity": {
"_id": "xxxxx",
"_mobile":{
"ECID": "xxxxx"
},
"testProfile":true
}
}
}'
recommendation-more-help
4f4a00c1-77c9-4eee-84df-bbe6206c3ab9