決定ポリシーでのフラグメントの活用 fragments

このページ:​決定ポリシー内で Journey Optimizer コンテンツフラグメントと AEM コンテンツフラグメントを活用します。これにより、チャネルをまたいでコンテンツ決定が提供するコンテンツをパーソナライズおよび最適化できます。

決定項目では、決定ポリシー内でメッセージを作成する際に活用できる 2 つのタイプのフラグメントコンテンツをサポートしています。

Journey Optimizer コンテンツフラグメント ajo-fragments

決定ポリシーにAJO コンテンツフラグメントを含む決定項目が含まれている場合、決定ポリシー内のメッセージを、決定が使用可能なすべてのチャネル(コードベースのエクスペリエンス、電子メール、プッシュ、モバイル、ジャーニー)でオーサリングする際に、これらのフラグメントを活用できます。

例えば、複数のモバイルデバイスモデルに対して異なるコンテンツを表示するとします。 決定ポリシーで使用している決定項目に、それぞれ異なる電話モデルに関連する指定されたフラグメントを追加します。 決定項目にフラグメントを追加する方法の詳細情報。

フラグメント参照とプレースメントキーを示す決定項目の「フラグメント」セクション。 {width="70%"}

完了したら、次のいずれかの方法を使用できます。

コードを直接挿入する

以下のコードブロックを決定ポリシーコードにコピー&ペーストするだけです。 variable をフラグメント ID に、placement をフラグメント参照キーに置き換えます。

code language-handlebars
{% let variable =  get(item._experience.decisioning.offeritem.contentReferencesMap, "placement").id %}
{{fragment id = variable required=false}}
詳細な手順に従う
  1. 「ヘルパー関数」に移動し、コードパネルに Let 関数 {% let variable = expression %} {{variable}} を追加します。ここでフラグメントの変数を宣言できます。

    コードパネルに追加された Let ヘルパー関数を示す決定ポリシーコードエディター。

  2. Map/Get 関数 {%= get(map, string) %} を使用して、式を作成します。 マップは、決定項目で参照されるフラグメントです。 文字列は、決定項目で​ フラグメント参照キー ​として入力したデバイスモデルに指定できます。

    フラグメントマップとフラグメント参照キーの参照に使用される Map 関数と Get 関数。

  3. また、このデバイスモデル ID を含むコンテキスト属性を使用することもできます。

    デバイスモデル識別子に対して選択されたコンテキスト属性。

  4. フラグメントに選択した変数をフラグメント ID として追加します。

    決定ポリシーコードの決定項目から設定されたフラグメント ID 変数。

フラグメント ID と参照キーは、決定項目の「フラグメント」セクションから選択されます。

WARNING
フラグメントキーが正しくない場合や、フラグメントコンテンツが有効でない場合、レンダリングは失敗し、Edge 呼び出しでエラーが発生することがあります。
フラグメントが一時的に使用できない場合のエラーを回避するには、required=false フラグを使用すると、代わりにフラグメントをスキップできます。 一時的に使用できないフラグメントの詳細情報

使用状況とガードレール fragments-guardrails

次のガードレールは、決定項目で使用される AJO コンテンツフラグメント​に特に適用されます。

メールのコンテンツフラグメントと式フラグメントのシミュレート
メール​チャネルの場合、本配信前確認を送信​するか、キャンペーンがアクティブ化された際に、決定項目に関連付けられた式フラグメントが正しく表示されます。 ただし、コンテンツをシミュレート​しても、決定項目の式フラグメントは表示されません。
メール内のビジュアルフラグメントと決定項目
決定項目に​ ビジュアルフラグメント ​を割り当てることはできません。このコンテキストでサポートされているのは​ 式フラグメント ​のみです。
決定項目とコンテキスト属性

Journey Optimizer のフラグメントでは、決定項目属性とコンテキスト属性はデフォルトでサポートされていません。 ただし、以下に説明するように、代わりにグローバル変数を使用できます。

例えば、フラグメントで sport 変数を使用するとします。

  1. フラグメント内でこの変数を参照します。例:

    code language-text
    Elevate your practice with new {{sport}} gear!
    
  2. 決定ポリシーブロック内で、Let 関数を使用して変数を定義します。 以下の例では、決定項目属性を使用して sport が定義されています。

    code language-handlebars
    {#each decisionPolicy.13e1d23d-b8a7-4f71-a32e-d833c51361e0.items as |item|}}
    {% let sport = item._cjmstage.value %}
    {{fragment id = get(item._experience.decisioning.offeritem.contentReferencesMap, "placement1").id }}
    {{/each}}
    
決定項目フラグメントコンテンツの検証
  • これらのフラグメントは動的な性質を持つため、キャンペーンで使用する場合、決定項目で参照されるフラグメントでは、キャンペーンコンテンツ作成時のメッセージ検証がスキップされます。

  • フラグメントコンテンツの検証は、フラグメントの作成時と公開時にのみ行われます。

  • JSON タイプの式フラグメントの場合、フラグメントを保存すると、コンテンツが構文的に検証されます。 検証エラーはアラートとして表示されます。

実行時に、キャンペーンコンテンツ(決定項目のフラグメントコンテンツを含む)が検証されます。 検証に失敗した場合、キャンペーンはレンダリングされません。

一時的に使用できないフラグメントがスキップされる {#temporary-unavailable-fragments}

ジャーニーまたはキャンペーンが決定項目に添付されたフラグメントを参照する際、更新されたフラグメントが Edge で使用可能になるまでに短い同期遅延が発生する場合があります。

フラグメントが一時的に使用できない場合のエラーを回避するために、フラグメントでは、ジャーニーまたはキャンペーンが失敗する代わりにスキップされるように、デフォルトで required フラグが false に設定されるようになりました。

つまり、Edge でフラグメントが一時的に使用できない場合、フラグメントは無視されます。 フラグメントが使用可能な場合は、通常どおりレンダリングされます。

例

決定ポリシーが 2 つのオファーとして選定され、それぞれに「20%オフ」や「30%オフ」などのフラグメントが含まれている場合、2 番目のフラグメントが一時的に使用できない状況でも、required=false が設定されていると、システムはジャーニーやキャンペーンを失敗させることなく、使用可能なオファー(20%オフ)を表示し、もう一方のフラグメント(30%オフ)をスキップします。 これにより、コンテンツの同期中であっても信頼性が向上します。

NOTE
required フラグを true に設定すると、フラグメントを必須としてマークできます。 ただし、フラグメントが一時的に欠落していると、ジャーニーやキャンペーンのレンダリングが失敗する場合があります。

AEM コンテンツフラグメント aem-fragments-decisioning

AVAILABILITY
この機能は、決定をサポートするチャネルで使用できます。
決定の AEM コンテンツフラグメントは、Adobe Journey Optimizer と Adobe Experience Manager as a Cloud Service または Managed Services を統合するお客様が使用できます。 詳細情報

決定ポリシーで AEM コンテンツフラグメントを活用する前に、次の点を確認してください。

パーソナライゼーションエディターでは、ポリシーによって選択された決定項目に関連付けられたすべての AEM コンテンツフラグメントが使用できます。 フラグメントキー名ごとに 1 つのフォルダーが表示されます。

➡️ Journey Optimizer 決定を含む AEM コンテンツフラグメントの使用方法をビデオで確認

この例では、決定ポリシーには、参照名を通じて AEM フラグメントが関連付けられている 2 つの決定項目が含まれています。

決定ポリシーでフラグメントキー名ごとに使用可能な AEM コンテンツフラグメントを示すパーソナライゼーションエディター。

  1. 「+」ボタンをクリックして、目的のフラグメントを式に追加します。

    1 つの参照名に、異なるオファー項目をまたいで複数のフラグメントが関連付けられている場合、決定では、決定ポリシーのランキング条件に基づいて、各顧客に配信する最適なフラグメントを判断します。

  2. フラグメントを選択したら、画像 URL やテキストフィールド、その他のコンテンツなどの属性を活用し、決定を使用して、適切なコンテンツを適切な顧客に適切なタイミングで提供できます。

    決定ポリシー式でパーソナライズに使用可能な、選択した AEM コンテンツフラグメント属性。

  3. キャンペーンやジャーニーをアクティブ化する前に、いずれかのシミュレーション方法を使用して、AEM コンテンツフラグメントのフィールド値がどのようにレンダリングされるかをプレビューします。 ​ コンテンツのシミュレートの詳細情報

チャネルをまたいだ AEM コンテンツフラグメントの使用 aem-fragments-channels

決定ポリシーから AEM コンテンツフラグメント属性を挿入する方法は、作業中のチャネルによって異なります。

メール

決定ポリシーを使用して、AEM コンテンツフラグメント属性をメールに挿入するには:

  1. E メールデザイナーでメールのドラフトを開き、右側のパネルの 決定 アイコンをクリックして、決定ポリシーパネルを開きます。

  2. 組み立てた選択戦略を選択し、プレースメント​を指定して、オファーが入力されるメールの領域を定義します。

  3. + アイコンをクリックし、その領域でレンダリングする必要がある AEM コンテンツフラグメント(例:ヒーロー画像 URL フィールド)から特定のフィールドを選択します。

    プレースメント用に AEM コンテンツフラグメントフィールドが選択された E メールデザイナーの決定ポリシーパネル。

  4. 公開前に、「コンテンツをシミュレート」をクリックして結果をプレビューし、最も優先度の高いオファーとそのコンテンツフラグメントがテストプロファイルに対して期待どおりにレンダリングされることを確認します。

コードベースのエクスペリエンス(JSON)

JSON ベースのコードベースのエクスペリエンスを作成する際、次の構造を使用して、決定ポリシーから AEM コンテンツフラグメント属性をレンダリングします。

code language-handlebars
[
{{#each decisionPolicy.YOUR_POLICY_ID.items as |item|}}
{% let frag = get(item._experience.decisioning.offeritem.aemContentReferencesMap, "YOUR_REFERENCE_KEY").id %}
{{fragment id = frag result='YOUR_REFERENCE_KEY' required=false}}
{
  "fieldName": "{{{YOUR_REFERENCE_KEY.fieldName}}}"
},
{{/each}}
]
note
NOTE
AEM コンテンツフラグメントでは、aemContentReferencesMap を使用して、参照キーでフラグメントを検索します。 これは、Journey Optimizer コンテンツフラグメントに使用される contentReferencesMap とは異なります。

JSON ペイロードを作成する際は、次の点に注意してください。

  • JSON 配列のブラケット [ と ] を #each ループの​ 外側 ​に配置します。
  • JSON 文字列内のフィールド値には、特殊文字の HTML エスケープを防ぎ、有効な JSON 出力を確保するために、三重括弧({{{ }}})を使用します。
  • result='YOUR_REFERENCE_KEY' パラメーターは、解決されたフラグメントのコンテンツをその名前で取得するので、YOUR_REFERENCE_KEY.fieldName でそのフィールドを参照できます。

JSON の決定ポリシーからレンダリングされた AEM コンテンツフラグメント属性を示すコードベースのエクスペリエンスエディター。

コードベースのエクスペリエンス(HTML)

HTML ベースのコードベースのエクスペリエンスの場合は、フィールドレンダリングに標準の二重括弧を使用します。

code language-handlebars
{{#each decisionPolicy.YOUR_POLICY_ID.items as |item|}}
{% let frag = get(item._experience.decisioning.offeritem.aemContentReferencesMap, "YOUR_REFERENCE_KEY").id %}
{{fragment id = frag result='YOUR_REFERENCE_KEY' required=false}}
<div>{{YOUR_REFERENCE_KEY.fieldName}}</div>
{{/each}}

AEM コンテンツフラグメントからのアセットの使用 aem-cf-assets

AEM コンテンツフラグメントには、AEM に保存されているアセットを参照する画像フィールドが含まれている場合があります。 Journey Optimizer は、これらのアセットの​ 相対パス ​のみを受信するので、完全な公開 URL を先頭に付加しない限り、画像が読み込まれない場合があります。

NOTE
コンテンツフラグメント内の AEM アセット参照のネイティブ解決はまだサポートされていません。 以下のアプローチは、そのサポートが追加されるまで使用できる回避策です。
AEM パブリッシュドメインを先頭に追加
  1. AEM インスタンス URL から、オーサードメイン (例:author-p12345-e67890.adobeaemcloud.com)を特定します。

    パブリッシュドメインの取得に使用されたオーサードメインを示す AEM インスタンス URL。

  2. author を publish に置き換えて、パブリッシュドメイン(publish-p12345-e67890.adobeaemcloud.com)を取得します。

  3. Journey Optimizer パーソナライゼーションエディターで、コンテンツフラグメントからアセット参照フィールドにドメインを公開する前に追加します。

    コンテンツフラグメントアセット参照フィールドの前に AEM パブリッシュドメインが追加されたパーソナライゼーションエディター。

画像は、配信時に完全な公開 URL に解決されます。

公開 URL をテキストフィールドに保存
  1. コンテンツフラグメントを AEM で開きます。

  2. JSON プレビューに移動し、「参照」セクションを確認して、公開されたアセット URLを見つけます。

    公開されたアセット URLを示す AEM コンテンツフラグメント JSON プレビューの「参照」セクション。

  3. 公開 URL をコピーし、コンテンツフラグメント内の専用のテキストフィールドにペーストします。

    参照されたアセットのコピーされた公開 URL を含む AEM コンテンツフラグメントのテキストフィールド。

  4. Journey Optimizer では、そのテキストフィールドをパーソナライゼーション式の画像ソースとして直接参照します。

    コンテンツフラグメントのテキストフィールドを画像ソースとして参照する Journey Optimizer パーソナライゼーション式。

このアプローチにより、URL の手動での作成が回避され、公開 URL はコンテンツフラグメント自体の中に保持されます。

チュートリアルビデオ video

Adobe Experience Manager コンテンツフラグメントを Journey Optimizer 決定と連携し、コンテンツをパーソナライズおよび最適化する方法について説明します。

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: Shows how to leverage Journey Optimizer content fragments and AEM Content Fragments within decision policies, so you can personalize and optimize the content decisioning delivers across channels.

Intents:

  • Leverage Journey Optimizer content fragments when authoring a message within a decision policy, either by directly inserting the code or by following the detailed steps.
  • Use global variables when decision item attributes or contextual attributes are needed in a Journey Optimizer fragment.
  • Decide with the required flag whether a temporarily unavailable Journey Optimizer content fragment used in a decision item is skipped or marked as mandatory.
  • Leverage AEM Content Fragments in a decision policy, using their attributes (such as image URLs, text fields, or other content) to surface the right content to the right customer at the right time.
  • Insert AEM Content Fragment attributes from a decision policy into an email or into a code-based experience (JSON or HTML).
  • Use images from AEM Content Fragments that reference assets stored in AEM, with one of the two workarounds.

Glossary:

  • Journey Optimizer content fragments (product-specific): one of the two types of fragment content that decision items support; reusable expression fragments created in Journey Optimizer and added to the decision item’s Fragments section.
  • AEM Content Fragments (product-specific): the other type of fragment content that decision items support; content authored in Adobe Experience Manager, mapped to the decision item’s attributes, and selected in the personalization editor by key name. In the personalization editor, all AEM Content Fragments associated with the decision items selected by the policy are available, with one folder per fragment key name.
  • Fragment reference key (product-specific): key entered in the decision item for a Journey Optimizer content fragment.
  • Reference name (product-specific): name through which AEM fragments are tied to decision items. A single reference name may have multiple fragments tied to it across different offer items; Decisioning then determines the best one to deliver to each customer based on the decision policy’s ranking criteria.
  • Let function (product-specific): helper function {% let variable = expression %} {{variable}}, added to the code pane, where you can declare the variable for your fragment.
  • Get function (Map > Get) (product-specific): function {%= get(map, string) %} used to build the expression; the map is the fragment referenced in the decision item, and the string can be the device model entered in the decision item as the Fragment reference key.
  • required flag (product-specific): flag set in the code that references a fragment, for example required=false.
  • result parameter (product-specific): the result='YOUR_REFERENCE_KEY' parameter captures the resolved fragment content under that name so you can reference its fields with YOUR_REFERENCE_KEY.fieldName.
  • Placement (product-specific): in the decision policy panel of the Email Designer, the area of the email where the offer will populate.

Guardrails:

  • Simulate content and expression fragments in emails (AJO content fragments used in decision items): for the Email channel, expression fragments associated with a decision item display correctly when you Send proof or when the campaign is activated; however, Simulate content does not display the expression fragment from the decision item.

  • Visual fragments and decision items in emails (AJO content fragments used in decision items): you cannot assign a Visual fragment to a decision item; only expression fragments are supported in this context.

  • Decision item and context attributes (AJO content fragments used in decision items): decision item attributes and contextual attributes are not supported by default in Journey Optimizer fragments; however, you can use global variables instead.

  • Decision item fragment content validation (AJO content fragments used in decision items):

    • Due to the dynamic nature of these fragments, when used in a campaign, message validation during campaign content creation is skipped for fragments referenced in decision items.
    • The validation of the fragment content happens only during the fragment creation and publication.
    • For JSON-type expression fragments, the content is syntactically validated upon saving the fragment; validation errors are displayed as alerts.
    • At runtime, the campaign content (including fragment content from decision items) is validated; in case of a validation failure, the campaign will not get rendered.
  • Temporarily unavailable fragments are skipped (AJO content fragments used in decision items): when journeys or campaigns reference fragments attached to decision items, there can be short synchronization delays before updated fragments are available on Edge.

    • To avoid failures when a fragment is temporarily unavailable, fragments have the required flag set to false by default so that they are skipped instead of causing the journey or campaign to fail: if the fragment is temporarily unavailable on Edge, it is simply ignored; if the fragment is available, it renders normally.
    • You can still mark a fragment as mandatory by setting the required flag to true; however, if a fragment is temporarily missing, it may cause journey or campaign rendering to fail.
  • AEM Content Fragments: native resolution of AEM asset references inside Content Fragments is not yet supported.

  • JSON-based code-based experience (AEM Content Fragments): when building your JSON payload, keep in mind to place the JSON array brackets [ and ] outside the #each loop, and to use triple braces {{{ }}} for field values inside JSON strings to prevent HTML escaping of special characters and ensure valid JSON output.

  • HTML-based code-based experience (AEM Content Fragments): use standard double braces for field rendering.

Prerequisites and permissions:

  • AEM Content Fragments in a decision policy: before leveraging them, make sure you have:

    • Created your Content Fragment in Adobe Experience Manager and tagged it with ajo-enabled:{OrgId}/{SandboxName} so that it is discoverable by Journey Optimizer.
    • Tied the fragment to the AEM Fragments section of the offer item by assigning it a unique reference name.
  • Journey Optimizer content fragments: your decision policy contains decision items including AJO content fragments.

Applicability:

  • Applies to Journey Optimizer content fragments (AJO content fragments): you can leverage them when authoring a message within the decision policy across all channels where Decisioning is available (code-based experience, Email, Push, Mobile, and journeys).
  • Applies to AEM Content Fragments in Decisioning: available for channels with Decisioning support, and available to customers integrating Adobe Experience Manager as a Cloud Service or Managed Services with Adobe Journey Optimizer.

Terminology:

  • Canonical name: Journey Optimizer content fragments — variants: AJO content fragments
  • Canonical name: AEM Content Fragments — variants: AEM content fragment, AEM fragments, Content Fragment
  • Canonical name: Adobe Journey Optimizer — Acronym: AJO — variants: Journey Optimizer
  • Canonical name: Adobe Experience Manager — Acronym: AEM
  • Do not confuse: aemContentReferencesMap (used by AEM Content Fragments to look up fragments by reference key) ≠ contentReferencesMap (used for Journey Optimizer content fragments)

FAQ:

  • Can I assign a Visual fragment to a decision item? No, you cannot assign a Visual fragment to a decision item; only expression fragments are supported in this context.
  • Does Simulate content display the expression fragment from a decision item in an email? No. For the Email channel, expression fragments associated with a decision item (AJO content fragments used in decision items) display correctly when you Send proof or when the campaign is activated; however, Simulate content does not display the expression fragment from the decision item.
  • What happens when a fragment is temporarily unavailable on Edge? For AJO content fragments used in decision items, fragments have the required flag set to false by default, so a fragment that is temporarily unavailable on Edge is skipped (simply ignored) instead of causing the journey or campaign to fail. If you mark a fragment as mandatory by setting the required flag to true, a temporarily missing fragment may cause journey or campaign rendering to fail.
  • Can I use decision item attributes or contextual attributes in a Journey Optimizer fragment? They are not supported by default in Journey Optimizer fragments. However, you can use global variables instead.
  • Why may images from AEM Content Fragments not load? AEM Content Fragments may include image fields that reference assets stored in AEM. Because Journey Optimizer receives only the relative path of those assets, images may not load unless the full publish URL is prepended.
  • How can I preview AEM Content Fragment field values before activating a campaign or journey? When you insert AEM Content Fragment attributes into an email using a decision policy, click Simulate content before publishing to preview the result and verify that the highest-priority offer and its content fragment render as expected for a test profile.

Troubleshooting:

  • Rendering may fail and cause an error in the Edge call (Journey Optimizer content fragments section): the fragment key is incorrect, or the fragment content is not valid.

  • Images may not load (image fields of AEM Content Fragments that reference assets stored in AEM): Journey Optimizer receives only the relative path of those assets. Two workarounds, available until native support for AEM asset references is added:

    • Prepend the AEM publish domain to the asset reference field from the Content Fragment in the personalization editor; the image then resolves to its full publish URL at delivery time.
    • Store the publish URL in a dedicated text field within the Content Fragment and reference that text field directly as the image source in your personalization expression; this approach avoids manual URL construction and keeps the publish URL within the Content Fragment itself.

Examples:

  • Journey Optimizer content fragments for mobile device models: to display different contents for several mobile device models, add the specified fragments, each pertaining to a different phone model, to the decision item you are using in the decision policy; in the detailed steps, the string of the Get function can be the device model entered in the decision item as the Fragment reference key, or a contextual attribute that would contain this device model ID.
  • Global variable in a Journey Optimizer fragment: to use the sport variable in your fragment, reference it in the fragment, for example Elevate your practice with new {{sport}} gear!, and define it with the Let function within the decision policy block; here sport is defined with the decision item attribute: {% let sport = item._cjmstage.value %}.
  • Temporarily unavailable fragments (AJO content fragments used in decision items): if your decision policy qualifies for two offers and each has a fragment, for example “20% off” and “30% off”, and the second fragment is temporarily unavailable, with required=false the system renders the available offer (20% off) and skips the other fragment (30% off) instead of failing the journey or campaign. This improves reliability when content is still synchronizing.
  • AEM Content Fragment field in an email: select the specific field from the AEM content fragment that should render in the area defined by the placement, for example the hero image URL field.
  • AEM publish domain: the author domain author-p12345-e67890.adobeaemcloud.com becomes the publish domain publish-p12345-e67890.adobeaemcloud.com when author is replaced with publish.

Related pages:

Personas:

  • marketer: Can leverage Journey Optimizer content fragments in a decision policy by directly inserting the code or following the detailed steps. Can use global variables where AJO content fragments used in decision items do not support decision item attributes or contextual attributes by default. Can set the required flag to true to mark an AJO content fragment used in a decision item as mandatory; the default is false. The page states that, for AJO content fragments used in decision items, you cannot assign a Visual fragment; only expression fragments are supported. The page states that, for AJO content fragments used in decision items, Simulate content does not display the expression fragment on the Email channel. Can leverage AEM Content Fragments in a decision policy after making sure the fragment is tagged with ajo-enabled:{OrgId}/{SandboxName} and tied to the offer item. Can insert AEM Content Fragment attributes into an email by specifying a placement, or into a code-based experience in JSON or HTML with aemContentReferencesMap. Can use two workarounds for images from AEM Content Fragments: prepend the AEM publish domain, or store the publish URL in a text field. Where: “Leverage fragments in decision policies”.

Onboarding:

  • Level: Experienced
  • First minimal step: Add your Journey Optimizer content fragments to the Fragments section of the decision item you use in the decision policy.
  • Success check: For the Email channel, expression fragments associated with a decision item display correctly when you use Send proof or when the campaign is activated.
  • Previous: Before leveraging Journey Optimizer content fragments in a decision policy, to add fragments to the decision item you are using: Learn how to add fragments to a decision item; Before leveraging AEM Content Fragments in a decision policy, to create and assign a tag so that the fragment is discoverable by Journey Optimizer: Learn how to create and assign a tag
  • Next: Before activating your campaign or journey, to preview how AEM Content Fragment field values will render: Learn more on simulating content
recommendation-more-help
journey-optimizer-help