使用外部整合進行個人化 integrations-personalization

在此頁面上:​瞭解行銷人員如何套用已設定的整合來個人化電子郵件、簡訊和推播內容,並將一個API呼叫鏈結到另一個以取得更豐富的動態訊息。

在內容中使用外部整合之前,請確認管理員已設定​ 並啟動 ​每個整合(端點、驗證、原則、回應裝載和啟動),如使用整合中所述。

您可以在訊息上新增每個​ 片段 ​最多​ 3 ​個整合,以及最多​ 5 ​個整合。 僅來自片段的整合不會計入​5。

將整合個人化套用至您的內容 apply-integration-personalization

身為行銷人員,您可以使用已設定的整合來個人化您的內容。 請依照下列步驟操作:

  1. 存取您的行銷活動內容,然後按一下[文字]或[HTML 元件]中的[新增個人化​]​。

    進一步瞭解元件

  2. 瀏覽至​ 整合 ​區段,然後按一下​ 開啟整合 ​以檢視所有使用中的整合。

    請注意,Journey Optimizer片段​可與整合搭配使用,但僅支援傳出頻道。 片段發佈後,會停用新增和儲存新的整合,以避免對現有歷程和行銷活動造成影響。

  3. 選取整合併按一下​儲存。

  4. 啟用​ Pills ​模式以解除鎖定進階整合功能表。

  5. 當您編寫整合個人化時,整合協助程式會包含​ required ​欄位,以定義失敗或遺失資料如何與預設內容互動:

    • required=true (預設):該訊息的轉譯停止。 此傳送已與​ ExternalDataLookupExclusion ​一起排除,而且此排除記錄在​ 訊息意見資料集 ​中。

    • required=false:結果變數已設為​null,且轉譯作業會繼續進行。 在範本中使用預設文字、後援或條件式邏輯,這樣在整合未傳回資料時,設定檔就不會接收空白內容。

  6. 若要完成整合設定,請定義先前在組態期間指定的整合屬性。

    您可以使用靜態值(保持常數)或設定檔屬性(動態地從使用者設定檔中提取資訊)來指派值給這些屬性。

  7. 定義整合屬性後,您現在可以按一下 新增 圖示,將內容中的整合欄位用於個人化傳訊。

    note
    NOTE
    範本中的權杖只能使用管理員在整合設定中公開的欄位。 例如,{{weatherResponse.temperature}}在temperature公開時有效;如果humidity未公開,編輯器中會拒絕{{weatherResponse.humidity}}。
  8. 按一下​儲存。

您的整合個人化現在已成功套用至您的內容,確保每位收件者都能根據您設定的屬性獲得量身打造的相關體驗。

將一個API呼叫對應至另一個API呼叫 map-integration-chain

您可以連結整合,讓某個呼叫的結果饋送至下一個呼叫,例如路徑區段、標題或查詢引數。 這些呼叫會在相同的訊息中依序執行,支援更豐富的個人化,而不需要自訂程式碼。

開始之前,請確定:

  • 管理員已設定並啟動您所需的每項整合。 請參閱設定整合。
  • 變數路徑預留位置、標題和查詢引數是在具有行銷人員專用標籤的整合設定中設定。
  • 管理員會在每個整合的​ 回應承載 ​中公開您所需的回應欄位,以便在編寫時顯示。

以下範例使用訂位整合,從設定檔的預訂傳回航班號碼,然後使用航班資訊整合,將該號碼用於即時狀態(延遲、目的地)。 將第二個整合的輸入對應到第一個呼叫的回應。

  1. 開啟您的訊息或片段,然後開啟個人化編輯器。

  2. 在​ 整合 ​中,按一下​開啟整合。

  3. 新增其回應將饋送下個呼叫的整合,例如,包括航班識別碼的預訂或預訂資料。

  4. (選用)如果要將具名變數繫結到保留回應,請開啟​ 協助程式函式 ​功能表,並新增協助程式,例如Let函式。

    note
    NOTE
    只有管理員定義的​ 回應承載 ​中公開的欄位才可用。 您無法參考設定中未公開的屬性。
  5. 如果您使用協助程式變數,請將該變數對應至預訂整合傳回以供下游使用的欄位,例如,乘客或預訂裝載中的航班號碼。

  6. 從​ 開啟整合 ​功能表,新增第二個整合,例如,航班狀態。

  7. 在第二個整合中,開啟​整合屬性。 對於必須重複使用來自第一次呼叫的資料的每個輸入,例如路徑變數、標題或查詢引數,請從第一次整合回應中選取對應來源。

    在​ Pills ​體驗中,您可以將第一次呼叫輸出直接對應到第二次呼叫輸入,而不需要Let陳述式。 如果您使用Let,可以改為透過該變數進行對應。

  8. 使用 新增 控制項(例如航班資訊回應的目的地),將第二次整合的Token插入內容。

  9. 儲存您的內容。

在​ 模擬 ​或傳送上,Journey Optimizer會依下列順序執行整合:第一個呼叫使用您設定的設定檔內容,其結果會建置第二個要求。 指定的整合是在模擬或傳送時間執行,取決於您的設定和管道。

在您的內容中使用Adobe Target Recommendations use-adobe-target-in-templates

本節說明如何在Adobe Journey Optimizer中使用​整合,在傳送時從​ Adobe Target ​擷取個人化資料,並將其用於您的訊息內容(無論是在範本中還是內嵌中撰寫)。 此變數假設Target傳送API已設定為整合。

如需設定步驟,請參閱使用整合和Adobe Target Recommendations範例。

Target傳送API傳回prefetch.mboxes陣列。 每個mbox包含具有content和type欄位的options物件。 type值決定您在範本中使用content的方式。 開啟與您的mbox回應相符的標籤,然後依照步驟在訊息中使用該資料。

JSON內容

當type是json時,content欄位是​JSON字串。 在存取巢狀欄位之前先加以剖析。 以下範例顯示JSON mbox的典型傳送API回應。

code language-json
{
  "status": 200,
  "prefetch": {
    "mboxes": [
      {
        "index": 0,
        "name": "SummerOffer",
        "options": {
          "content": "{\"recommendations\":[{\"productId\":\"p101\",\"name\":\"Noise Smartwatch\",\"price\":2999},{\"productId\":\"p205\",\"name\":\"Boat Earbuds\",\"price\":1499}],\"strategy\":\"collaborative-filtering\"}",
          "type": "json"
        }
      }
    ]
  }
}

依序使用三個協助程式來擷取、擷取及剖析Target回應。

  1. 擷取目標回應。 呼叫您設定的Target與externalDataLookup的整合。 將integrationName設定為該整合的​名稱 (取代範例預留位置target_recommendations)。 使用result引數來命名包含完整傳送API裝載的範本變數,例如targetResponse。

    您也可以在個人化編輯器左側導覽的​ 整合 ​功能表中,直接選取整合。 請參閱將整合個人化套用至您的內容。

    code language-handlebars
    {{externalDataLookup integrationName="target_recommendations" result="targetResponse"}}
    
  2. 使用valueAtPath擷取特定mbox。 valueAtPath透過其以0為基礎的索引從陣列中擷取元素,並將其指派給範本變數。 使用idx引數指定要存取的元素。

    code language-handlebars
    {{valueAtPath targetResponse.prefetch.mboxes idx=0 result="summerOffer"}}
    
    table 0-row-2 1-row-2 2-row-2 3-row-2
    參數 說明
    path 陣列的路徑(位置,無關鍵字)
    idx 0型索引,用於陣列存取(選擇性)
    result 儲存擷取值的變數名稱
    note
    NOTE
    如果idx超出範圍,演算會擲回例外狀況。 當索引可能無效時,保護具有{%#if idx >= 0 and idx < count(targetResponse.prefetch.mboxes)%}的無效索引。 PQL運算式無法當作路徑使用。 自2025.9.0發行後可用。
  3. 使用parseJson剖析JSON字串。 mbox options.content欄位是原始JSON字串。 parseJson將其轉換為結構化物件,然後可以在範本中直接存取其欄位。

    code language-handlebars
    {{parseJson jsonStr=summerOffer.options.content result="summerOfferContent"}}
    
    table 0-row-2 1-row-2 2-row-2
    參數 說明
    jsonStr 包含有效JSON的字串欄位的路徑
    result 儲存剖析物件的變數名稱
    note
    NOTE
    如果JSON字串無效或參考為Null,則result設定為null — 不會擲回演算錯誤。 以您的實際Target回應進行測試,以確認內容是有效的JSON。 推出日期: 2026.6.0
  4. 存取資料。 剖析後,請使用點標籤法來存取summerOfferContent中的欄位。 若要呈現建議清單:

    code language-handlebars
    {{externalDataLookup integrationName="target_recommendations" result="targetResponse"}}
    {{valueAtPath targetResponse.prefetch.mboxes idx=0 result="summerOffer"}}
    {{parseJson jsonStr=summerOffer.options.content result="summerOfferContent"}}
    
    Strategy: {{summerOfferContent.strategy}}
    {{#each summerOfferContent.recommendations as |rec|}}
      {{rec.name}} — {{rec.price}}
    {{/each}}
    
HTML內容

當type為html時,content欄位是準備呈現的HTML字串。 您不需要剖析。 以下範例顯示HTML mbox的典型傳送API回應。

code language-json
{
  "status": 200,
  "prefetch": {
    "mboxes": [
      {
        "index": 0,
        "name": "SummerOffer",
        "options": {
          "content": "<div class=\"offer\"><h2>Summer Sale</h2><p>50% off Smartwatch</p></div>",
          "type": "html"
        }
      }
    ]
  }
}

擷取並擷取mbox,然後直接轉譯content。 略過parseJson。

code language-handlebars
{{externalDataLookup integrationName="target_recommendations" result="targetResponse"}}
{{valueAtPath targetResponse.prefetch.mboxes idx=0 result="summerOffer"}}
{{{summerOffer.options.content}}}
note
NOTE
使用​三重大括弧 {{{...}}}將HTML內容依原樣呈現。 雙大括弧{{...}}將逸出HTML實體並轉譯原始標籤字串而非HTML。

作法影片 video

此影片說明​ 整合 ​如何將Adobe Journey Optimizer連線至外部API,以便您可以將即時資料和內容提取至​ 傳出頻道 ​電子郵件、簡訊和推播,以進行更相關的個人化。

AI Knowledge Reference

This section contains structured knowledge intended to support interpretation, retrieval, and question answering related to this topic.

For complete understanding, this information should be combined with the documentation on this page. Neither source is intended to stand alone; the page describes the feature, while this section provides additional context that helps disambiguate terminology, intent, applicability, and constraints.

  • TL;DR: This page explains how marketers apply configured external integrations to personalize email, SMS, and push content, chain one API call’s response into another, and use Adobe Target Delivery API responses in message templates.

Intents:

  • Apply a configured integration to personalize Text or HTML content via Add personalization
  • Control fallback behavior with the required field when an integration fails or returns no data
  • Chain integrations so one call’s response feeds the next call’s inputs
  • Map first-call output to second-call input using Pills mode or a Let helper
  • Use Adobe Target Recommendations by fetching, extracting, and parsing the Target Delivery API response
  • Render JSON or HTML mbox content with the externalDataLookup, valueAtPath, and parseJson helpers

Glossary:

  • required field: An Integrations helper field that defines how failures or missing data interact with default content (product-specific)
  • Pills mode: A mode that unlocks the advanced integration menu and lets you map first-call output directly to second-call input without a Let statement (product-specific)
  • externalDataLookup: The helper that calls a configured integration and stores its full response in a named result variable (product-specific)
  • valueAtPath: The helper that extracts an element from an array by its 0-based index and assigns it to a template variable (product-specific)
  • parseJson: The helper that converts a raw JSON string field into a structured object for direct field access (product-specific)
  • Simulation: The mode in which Journey Optimizer runs chained integrations in order, alongside send (product-specific)

Guardrails:

  • You can add up to 3 integrations per Fragment and up to 5 on the message; integrations that come only from fragments do not count toward the 5.
  • Journey Optimizer Fragments are available with Integrations but support outbound channels only.
  • Once a fragment is published, adding and saving new integrations is disabled to avoid impact on existing journeys and campaigns.
  • An administrator must have configured and activated each integration (endpoint, authentication, policies, response payload, and activation) before use.
  • Tokens in a template must use only fields the administrator exposed in the integration configuration; unexposed fields are rejected in the editor.
  • With required=true (default), rendering stops for that message, the send is excluded with ExternalDataLookupExclusion, and the exclusion is recorded in the message feedback dataset; with required=false, the result variable is set to null and rendering continues.
  • For valueAtPath, if idx is out of bounds, rendering throws an exception; PQL expressions cannot be used as the path. Available since release 2025.9.0.
  • For parseJson, if the JSON string is invalid or the reference is null, result is set to null and no rendering error is thrown. Available since 2026.6.0.

Terminology:

  • Canonical name: External integrations for personalization — Acronym: n/a — variants: Integrations, integration personalization
  • Synonyms: “required=true” = “default”
  • Do not confuse: “required=true” (rendering stops, send excluded) ≠ “required=false” (result set to null, rendering continues)
  • Do not confuse: JSON content (type is json; parse content with parseJson) ≠ HTML content (type is html; render content directly with triple braces)

FAQ:

  • Q: How many integrations can I add? — Up to 3 per Fragment and up to 5 on the message; fragment-only integrations do not count toward the 5.
  • Q: What happens if an integration returns no data? — With required=true the message rendering stops and the send is excluded (ExternalDataLookupExclusion, recorded in the message feedback dataset); with required=false the result is null and rendering continues, so use fallbacks or conditional logic.
  • Q: Can I feed one integration’s response into another? — Yes; chain integrations so calls run in order in the same message, mapping first-call output to second-call input in Pills mode or through a Let variable.
  • Q: How do I use an Adobe Target JSON mbox response? — Fetch it with externalDataLookup, extract the mbox with valueAtPath, then parse options.content with parseJson before accessing nested fields.
  • Q: How do I render an Adobe Target HTML mbox response? — Fetch and extract the mbox, then render content directly with triple braces; skip parseJson.
recommendation-more-help
journey-optimizer-help