Show Menu
主題×

設計概覽

關於可定義建議在頁面上出現方式的設計的概覽資訊。
Target 可展現建議的完整外觀與操作方式,如下圖所示。設計可以包含 HTML、JavaScript 和 CSS。
Target 也可以將您的建議當成 JSON 物件來傳送,然後就可用於電子郵件訊息、IoT (Internet of Things,物聯網) 裝置、主控台或語音使用案例中 (Amazon Alexa 或 Google 首頁)。

JSON 範例

下列範例顯示透過表單式編輯器來設定活動時,如何傳回 JSON 回應。
  1. 從「設計程式庫」或表單式工作流程內建立設計。如果您嘗試在可視化體驗撰寫器 (VEC) 工作流程內這樣做,則無法建立除了 HTML 設計以外的任何項目,此設計會包裝在  <div> 中作為點擊追蹤用途。
  2. 確定「HTML 設計」選項已關閉:
  3. 下列程式碼是您可貼到設計中的一個範例:
        #* 
        * "Return a simple list of recommended entity ids"   
        *#
    
        {   
          "notes":{   
          "purpose": "Return a simple list of recommended entity ids",   
          "use-case": "Use this approach if you prefer to do a real-time lookup of entity attribute details (such as inventory, price, rating) from another system (such as a CMS, PIM or ecommerce platform)",   
          "version": "01"   
          },   
          "recommendedItems": {   
            "key": "$key.id",   
            "slot-01": "$entity1.id",   
            "slot-02": "$entity2.id",   
            "slot-03": "$entity3.id",   
            "slot-04": "$entity4.id",   
            "slot-05": "$entity5.id",   
            "slot-06": "$entity6.id",   
            "slot-07": "$entity7.id",   
            "slot-08": "$entity8.id",   
            "slot-09": "$entity9.id",   
            "slot-10": "$entity10.id"   
          }   
        }  
    
    
  4. 設定一個使用此設計的表單式建議活動。
    1. 導覽至「活動」頁面。
    2. 按一下​ 「建立活動」
    3. 選取​ 「Recommendations」
    4. 在​ 「選擇體驗撰寫器」 ​下,選取​ 「表單」
    5. 在位置下,輸入文字: "Sample_Recs_Response"
    6. 在​ 「預設內容」 ​下,按向下箭頭,然後按一下​ 「新增建議」
    7. 選擇頁面類型。這會決定下一個畫面的起始篩選。
    8. 選取條件卡,然後按​ 「下一步」
    9. 選取您在上一步建立的設計,然後按一下​ 「儲存」
    10. 完成設定程序。
    11. 按一下​ 「非使用中」 ​旁的向右箭頭,然後選取​ 「啟動」
  5. 在設定並啟動活動之後,您可以設定請求範例來取回全新的 JSON 回應。
    從您儲存活動那時起,Target 需要建立模型來支援所選取的條件組態。根據許多因素而定,這需要一些時間。模型建立後就會顯示結果。
    例如:
    https://[YOUR_CLIENT_CODE].tt.omtrdc.net/m2/YOUR_CLIENT_CODE/ubox/raw?mbox=[YOUR_MBOX_NAME]&mboxContentType=text/html&mboxXDomain=disabled&entity.id=[ENTITY_ID]&mboxHost=rawbox_sample&at_property=[AT_PROPERTY_TOKEN]&mboxNoRedirect=true&mboxPC=1234-4321&mboxSession=9876-7000
    
    
    where
參數
[YOUR_CLIENT_CODE]
Target 用戶端代碼 (位於 ../target/products.html#recsSettings > Recommendations API Token > 用戶端代碼。
[YOUR_MBOX_NAME]
您在表單型Recommendations的「位置」區段中選取的名稱,在此例中為Sample_Recs_Response。
[ENTITY_ID ]
目錄中之項目的 entity.id
[AT_PROPERTY_TOKEN]
(可選) 如果您已在活動設定期間選取「屬性」(「企業權限」的部分),則新增。
當演算法執行之後,而且也有結果,則回應會如下所示:

其他 JSON 物件要訣和技巧

您也可以使用下列語法來設定設計,只傳回一份簡單的以逗號分隔的項目清單:
entity1.id, $entity2.id, $entity3.id, $entity4.id, $entity5.id, 

或者,您可以在回應中傳送其他資訊。下列程式碼檔案是較複雜的範例,不只傳回實體 ID,還有其相關聯的位置 (訂單)。此設計範例也傳回活動詳細資料、Target 設定檔詳細資料 (如適用),以及與傳回的項目相關聯的其他 entity.attributes
    {   
     "adobeRecommendations": {   
      "notes": {   
       "purpose": "Return a list of entity ids with their associated entity.attributes",   
       "use-case": "Use this approach to avoid looking up attribute details after receiving a response from Target",   
       "version": "01"   
      },   
      "recommendedItems": {   
       "slot-01": "$entity1.id",   
       "slot-02": "$entity2.id",   
       "slot-03": "$entity3.id",   
       "slot-04": "$entity4.id",   
       "slot-05": "$entity5.id",   
       "slot-06": "$entity6.id",   
       "slot-07": "$entity7.id",   
       "slot-08": "$entity8.id",   
       "slot-09": "$entity9.id",   
       "slot-10": "$entity10.id"   
      },   
      "activityDetails": {   
       "mbox.name": "email-mbox",   
       "campaign.name": "\${campaign.name}",   
       "campaign.id": "\${campaign.id}",   
       "campaign.recipe.name": "\${campaign.recipe.name}",   
       "campaign.recipe.id": "\${campaign.recipe.id}",   
       "offer.name": "\${offer.name}",   
       "offer.id": "\${offer.id}",   
       "criteria.title": "$criteria.title",   
       "algorithm.name": "$algorithm.name",   
       "algorithm.dayCount": "$algorithm.dayCount"   
      },   
      "visitorProfile": {   
       "profile.favorite-category": "\${profile.favorite-category}",   
       "profile.test": "\${profile.test}",   
       "user.endpoint.lastPurchasedEntity": "\${user.endpoint.lastPurchasedEntity}",   
       "user.endpoint.lastViewedEntity": "\${user.endpoint.lastViewedEntity}",   
       "user.endpoint.mostViewedEntity": "\${user.endpoint.mostViewedEntity}",   
       "user.endpoint.categoryAffinity": "\${user.endpoint.categoryAffinity}",   
       "profile.geolocation.city": "\${profile.geolocation.city}",   
       "profile.geolocation.dma": "\${profile.geolocation.dma}",   
       "profile.geolocation.state": "\${profile.geolocation.state}",   
       "profile.geolocation.country": "\${profile.geolocation.country}",   
       "profile.sessionCount": "\${profile.sessionCount}",   
       "profile.averageDaysBetweenVisits": "\${profile.averageDaysBetweenVisits}",   
       "profile.browserTime": "\${profile.browserTime}",   
       "user.activeActivities": "\${user.activeActivities}",   
       "user.pcId": "\${user.pcId}",   
       "user.isFirstSession": "\${user.isFirstSession}",   
       "user.isNewSession": "\${user.isNewSession}",   
       "user.header": "\${user.header}",   
       "user.parameter": "\${user.parameter}"   
      },   
      "recKey": {   
       "recKeyDetails": {   
        "id": "$key.id",   
        "name": "$key.name",   
        "category": "$key.category",   
        "pageUrl": "$key.pageUrl",   
        "thumbnailUrl": "$key.thumbnailUrl"   
       }   
      },   
      "recDetailedResults": {   
       "recEntity1Details": {   
        "id": "$entity1.id",   
        "name": "$entity1.name",   
        "category": "$entity1.category",   
        "pageUrl": "$entity1.pageUrl",   
        "thumbnailUrl": "$entity1.thumbnailUrl"   
       },   
       "recEntity2Details": {   
        "id": "$entity2.id",   
        "name": "$entity2.name",   
        "category": "$entity2.category",   
        "pageUrl": "$entity2.pageUrl",   
        "thumbnailUrl": "$entity2.thumbnailUrl"   
       },   
       "recEntity3Details": {   
        "id": "$entity3.id",   
        "name": "$entity3.name",   
        "category": "$entity3.category",   
        "pageUrl": "$entity3.pageUrl",   
        "thumbnailUrl": "$entity3.thumbnailUrl"   
       },   
       "recEntity4Details": {   
        "id": "$entity4.id",   
        "name": "$entity4.name",   
        "category": "$entity4.category",   
        "pageUrl": "$entity4.pageUrl",   
        "thumbnailUrl": "$entity4.thumbnailUrl"   
       },   
       "recEntity5Details": {   
        "id": "$entity5.id",   
        "name": "$entity5.name",   
        "category": "$entity5.category",   
        "pageUrl": "$entity5.pageUrl",   
        "thumbnailUrl": "$entity5.thumbnailUrl"   
       },   
       "recEntity6Details": {   
        "id": "$entity6.id",   
        "name": "$entity6.name",   
        "category": "$entity6.category",   
        "pageUrl": "$entity6.pageUrl",   
        "thumbnailUrl": "$entity6.thumbnailUrl"   
       },   
       "recEntity7Details": {   
        "id": "$entity7.id",   
        "name": "$entity7.name",   
        "category": "$entity7.category",   
        "pageUrl": "$entity7.pageUrl",   
        "thumbnailUrl": "$entity7.thumbnailUrl"   
       },   
       "recEntity8Details": {   
        "id": "$entity8.id",   
        "name": "$entity8.name",   
        "category": "$entity8.category",   
        "pageUrl": "$entity8.pageUrl",   
        "thumbnailUrl": "$entity8.thumbnailUrl"   
       },   
       "recEntity9Details": {   
        "id": "$entity9.id",   
        "name": "$entity9.name",   
        "category": "$entity9.category",   
        "pageUrl": "$entity9.pageUrl",   
        "thumbnailUrl": "$entity9.thumbnailUrl"   
       },   
       "recEntity10Details": {   
        "id": "$entity10.id",   
        "name": "$entity10.name",   
        "category": "$entity10.category",   
        "pageUrl": "$entity10.pageUrl",   
        "thumbnailUrl": "$entity10.thumbnailUrl"   
       }   
      }   
     }   
    }