Adobeは、Destination SDKの一環として、宛先の設定とテストを支援する開発者ツールを提供します。 ここでは、メッセージ変換テンプレートの作成およびテスト方法について説明します。 宛先のテスト方法について詳しくは、 宛先設定のテスト.
宛先 メッセージ変換テンプレートの作成とテスト Adobe Experience Platformのターゲットスキーマと、宛先でサポートされるメッセージ形式の間で、 テンプレートオーサリングツール 以下で詳しく説明します。 詳しくは、 メッセージ形式ドキュメント.
次の図に、メッセージ変換テンプレートが 宛先設定ワークフロー Destination SDK:
Destination SDKでの宛先を作成する最初の手順の 1 つは、セグメントメンバーシップ、ID、プロファイル属性のデータ形式がAdobe Experience Platformから宛先に書き出される際にどのように変換されるかを考えることです。 で宛先スキーマ XDMAdobeとの変換に関する情報を見つけます。 メッセージ形式ドキュメント.
変換を正常に実行するには、次の例のような変換テンプレートを指定する必要があります。 セグメント、ID およびプロファイル属性を送信するテンプレートの作成.
Adobeは、AdobeXDM 形式のデータを、宛先でサポートされる形式に変換するメッセージテンプレートを作成およびテストできるテンプレートツールを提供します。 このツールには、次の 2 つの API エンドポイントを使用できます。
テンプレートを作成する準備が整う前に、次の手順を実行してください。
maxUsersPerRequest
パラメーター。
maxUsersPerRequest=1
宛先への API 呼び出しに単一のプロファイルを含める場合は、そのセグメント認定、ID、プロファイル属性を含めます。maxUsersPerRequest
宛先への API 呼び出しに複数のプロファイルと、そのセグメント認定、ID、プロファイル属性を含める場合は、値が 1 より大きい。destinationDelivery.destinationServerId
.メッセージ変換テンプレートを作成および編集する前に、まず レンダリングテンプレート API エンドポイント 変換を適用せずに生のプロファイルを書き出す単純なテンプレートを使用します。 シンプルなテンプレートの構文は次のとおりです。
"template": "{% for profile in input.profiles %}{{profile|raw}}{% endfor %}}"
テンプレートを取得してテストするプロセスは反復的です。 書き出されたプロファイルが宛先の想定されるデータ形式に一致するまで、以下の手順を繰り返します。
API リファレンスのドキュメントについて詳しくは、 「Get sample template API」操作.
以下に示すように、呼び出しに宛先 ID を追加すると、応答は宛先 ID に対応するテンプレートの例を返します。
curl --location --request GET 'https://platform.adobe.io/data/core/activation/authoring/testing/template/sample/5114d758-ce71-43ba-b53e-e2a91d67b67f' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-api-key: {API_KEY}' \
--header 'Authorization: Bearer {ACCESS_TOKEN}' \
--header 'x-gw-ims-org-id: {ORG_ID}' \
--header 'x-sandbox-name: {SANDBOX_NAME}' \
指定した宛先 ID が ベストエフォート集計 および maxUsersPerRequest=1
集計ポリシーでは、リクエストは次のようなサンプルテンプレートを返します。
{#- THIS is an example template for a single profile -#}
{#- A '-' at the beginning or end of a tag removes all whitespace on that side of the tag. -#}
{
"identities": [
{%- for idMapEntry in input.profile.identityMap -%}
{%- set namespace = idMapEntry.key -%}
{%- for identity in idMapEntry.value %}
{
"type": "{{ namespace }}",
"id": "{{ identity.id }}"
}{%- if not loop.last -%},{%- endif -%}
{%- endfor -%}{%- if not loop.last -%},{%- endif -%}
{% endfor %}
],
"AdobeExperiencePlatformSegments": {
"add": [
{%- for segment in input.profile.segmentMembership.ups | added %}
"{{ segment.key }}"{%- if not loop.last -%},{%- endif -%}
{% endfor %}
],
"remove": [
{#- Alternative syntax for filtering segments by status: -#}
{% for segment in removedSegments(input.profile.segmentMembership.ups) %}
"{{ segment.key }}"{%- if not loop.last -%},{%- endif -%}
{% endfor %}
]
}
}
指定した宛先 ID が、 設定可能な集計 または ベストエフォート集計 と maxUsersPerRequest
1 より大きい場合、リクエストは次のようなサンプルテンプレートを返します。
{#- THIS is an example template for multiple profiles -#}
{#- A '-' at the beginning or end of a tag removes all whitespace on that side of the tag. -#}
{
"profiles": [
{%- for profile in input.profiles %}
{
"identities": [
{%- for idMapEntry in profile.identityMap -%}
{%- set namespace = idMapEntry.key -%}
{%- for identity in idMapEntry.value %}
{
"type": "{{ namespace }}",
"id": "{{ identity.id }}"
}{%- if not loop.last -%},{%- endif -%}
{%- endfor -%}{%- if not loop.last -%},{%- endif -%}
{% endfor %}
],
"AdobeExperiencePlatformSegments": {
"add": [
{%- for segment in profile.segmentMembership.ups | added %}
"{{ segment.key }}"{%- if not loop.last -%},{%- endif -%}
{% endfor %}
],
"remove": [
{#- Alternative syntax for filtering segments by status: -#}
{% for segment in removedSegments(profile.segmentMembership.ups) %}
"{{ segment.key }}"{%- if not loop.last -%},{%- endif -%}
{% endfor %}
]
}
}{%- if not loop.last -%},{%- endif -%}
{% endfor %}
]
}
テンプレートを使用して宛先の想定される形式に一致するプロファイルをレンダリングする前に、テンプレートを文字エスケープする必要があります(下の画面での記録を参照)。
オンラインの文字エスケープツールを使用できます。 上記のデモでは、 JSON Escape フォーマッター.
メッセージ変換テンプレートを作成した後、 サンプルテンプレート API、 テンプレートをレンダリング をクリックして、書き出されたデータを生成します。 これにより、Adobe Experience Platformが宛先に書き出すプロファイルが、目的の宛先の想定される形式と一致しているかどうかを確認できます。
実行できる呼び出しの例については、 API リファレンスを参照してください。
テンプレートを編集し、書き出されたプロファイルが宛先の想定されるデータ形式に一致するまで、レンダリングテンプレート API エンドポイントを呼び出します。
メッセージの変換テンプレートの設定が完了したら、そのテンプレートを 宛先サーバーの設定、 httpTemplate.requestBody.value
.