Skip to content
Last updated

SAP Marketing Cloud Export Integration

SAP Marketing Cloud(旧Hybris Marketing)は、ユーザーデータを一元化されたハブに統合することで、個々の顧客と匿名の訪問者に関するリアルタイムのコンテキストベースのデータを提供するマーケティングソリューションです。これにより、ブランドは、マーケティングチャネルやデバイスに関係なく、カスタマージャーニー全体を通じて一貫性のある、コンテキストに沿った、関連性の高いエクスペリエンスを提供できます。このソリューションの機能には以下が含まれます:

  • Data Management — ブランドとやり取りする人々の360度のビューを提供し、リアルタイムで適切なコンテキストでターゲティングできるようにします。
  • Recommendations — 顧客にタイムリーで非常に関連性の高い推奨事項を提供し、顧客の関心をコンバージョンに変換するのに役立ちます。
  • Segmentation — リアルタイムで高性能なオーディエンスセグメンテーションを提供し、複数のチャネルにわたってパーソナライズされたキャンペーンを可能にします。

この統合で何ができますか?

SAP Marketing Cloudは、エコシステム内の複数のサービスでOpen Data Protocol(OData)の原則に厳密に従っているため、以下が可能な柔軟なソリューションを構築できます:

前提条件

  • Treasure Data™の基本知識
  • SAP Marketing Cloudの基本知識
  • Open Data Protocolの基本知識

要件と制限事項

  • SAP通信ユーザーアカウント

Static IP Address of Treasure Data Integration

If your security policy requires IP whitelisting, you must add Treasure Data's IP addresses to your allowlist to ensure a successful connection.

Please find the complete list of static IP addresses, organized by region, at the following link:
https://api-docs.treasuredata.com/en/overview/ip-addresses-integrations-result-workers/

TD Consoleを使用して接続を作成

Treasure Dataでは、クエリを実行する前にデータ接続を作成して設定する必要があります。データ接続の一部として、統合にアクセスするための認証を提供します。

新しい認証を作成

  1. TD Consoleを開きます。

  2. Integrations Hub > Catalogに移動します。

  3. SAP Marketing Cloudを検索して選択します。

  1. Create Authenticationを選択します。

  1. 認証するための資格情報を入力します:

image2022-7-21_5-12-0.png

ParameterDescription
UsernameSAP Marketing Cloud通信ユーザー名
PasswordSAP Marketing Cloud通信ユーザーのパスワード
Tenant IDSAP Marketing CloudテナントID
  1. Continueを選択します。

  2. 接続の名前を入力します。

  3. Doneを選択します。

クエリの定義

  1. Data Workbench > Queriesに移動します。

  2. New Queryを選択します。

  3. クエリを入力します。

  4. Runを選択してクエリを実行し、結果セットを検証します。

結果エクスポートターゲットの指定

  1. Export Resultsを選択します。

  1. 出力に使用する外部サービスの既存の認証を選択するか、新しい認証を作成できます。以下のいずれかを選択します:

既存の統合を使用

新しい統合を作成

Field Description
Service NameターゲットSAP Marketing Cloudサービス名
Service Version使用するサービスのバージョン

Target Type

使用するターゲットタイプ:

  • Entity name
  • Custom path

これは、選択したアクションに対してURLがどのように構築されるかに影響します。詳細については、Appendixを参照してください。

Entity Nameデータをエクスポートするエンティティ
Custom Path URLリソース用のCustom Path URLテンプレート。
これは、標準のODataエンティティでは処理できない複雑なパスに必要です。このオプションは、screen-shot{{name}}—screen-shotの形式に従います。これは、名前が統合に転送された実際のデータ行に置き換えられることを意味します。
例: screen-shotTargetGroups(guid'{{TargetGroupUUID}}')/TargetGroupInteractionContactsscreen-shot
Actionデータに適用されるアクション
  • Create
  • Full Update
  • Partial Update
  • Delete
  • Upsert
Batch SizeAPI呼び出しごとにエグレスするレコード数

(Optional) Schedule Query Export Jobs

You can use Scheduled Jobs with Result Export to periodically write the output result to a target destination that you specify.

Treasure Data's scheduler feature supports periodic query execution to achieve high availability.

When two specifications provide conflicting schedule specifications, the specification requesting to execute more often is followed while the other schedule specification is ignored.

For example, if the cron schedule is '0 0 1 * 1', then the 'day of month' specification and 'day of week' are discordant because the former specification requires it to run every first day of each month at midnight (00:00), while the latter specification requires it to run every Monday at midnight (00:00). The latter specification is followed.

Scheduling your Job Using TD Console

  1. Navigate to Data Workbench > Queries

  2. Create a new query or select an existing query.

  3. Next to Schedule, select None.

  4. In the drop-down, select one of the following schedule options:

    Drop-down ValueDescription
    Custom cron...Review Custom cron... details.
    @daily (midnight)Run once a day at midnight (00:00 am) in the specified time zone.
    @hourly (:00)Run every hour at 00 minutes.
    NoneNo schedule.

Custom cron... Details

Cron ValueDescription
0 * * * *Run once an hour.
0 0 * * *Run once a day at midnight.
0 0 1 * *Run once a month at midnight on the morning of the first day of the month.
""Create a job that has no scheduled run time.
 *    *    *    *    *
 -    -    -    -    -
 |    |    |    |    |
 |    |    |    |    +----- day of week (0 - 6) (Sunday=0)
 |    |    |    +---------- month (1 - 12)
 |    |    +--------------- day of month (1 - 31)
 |    +-------------------- hour (0 - 23)
 +------------------------- min (0 - 59)

The following named entries can be used:

  • Day of Week: sun, mon, tue, wed, thu, fri, sat.
  • Month: jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec.

A single space is required between each field. The values for each field can be composed of:

Field ValueExampleExample Description
A single value, within the limits displayed above for each field.
A wildcard '*' to indicate no restriction based on the field.'0 0 1 * *'Configures the schedule to run at midnight (00:00) on the first day of each month.
A range '2-5', indicating the range of accepted values for the field.'0 0 1-10 * *'Configures the schedule to run at midnight (00:00) on the first 10 days of each month.
A list of comma-separated values '2,3,4,5', indicating the list of accepted values for the field.0 0 1,11,21 * *'Configures the schedule to run at midnight (00:00) every 1st, 11th, and 21st day of each month.
A periodicity indicator '*/5' to express how often based on the field's valid range of values a schedule is allowed to run.'30 */2 1 * *'Configures the schedule to run on the 1st of every month, every 2 hours starting at 00:30. '0 0 */5 * *' configures the schedule to run at midnight (00:00) every 5 days starting on the 5th of each month.
A comma-separated list of any of the above except the '*' wildcard is also supported '2,*/5,8-10'.'0 0 5,*/10,25 * *'Configures the schedule to run at midnight (00:00) every 5th, 10th, 20th, and 25th day of each month.
  1. (Optional) You can delay the start time of a query by enabling the Delay execution.

Execute the Query

Save the query with a name and run, or just run the query. Upon successful completion of the query, the query result is automatically exported to the specified destination.

Scheduled jobs that continuously fail due to configuration errors may be disabled on the system side after several notifications.

(Optional) You can delay the start time of a query by enabling the Delay execution.

Activate a Segment in Audience Studio

You can also send segment data to the target platform by creating an activation in the Audience Studio.

  1. Navigate to Audience Studio.
  2. Select a parent segment.
  3. Open the target segment, right-mouse click, and then select Create Activation.
  4. In the Details panel, enter an Activation name and configure the activation according to the previous section on Configuration Parameters.
  5. Customize the activation output in the Output Mapping panel.

  • Attribute Columns
    • Select Export All Columns to export all columns without making any changes.
    • Select + Add Columns to add specific columns for the export. The Output Column Name pre-populates with the same Source column name. You can update the Output Column Name. Continue to select + Add Columnsto add new columns for your activation output.
  • String Builder
    • + Add string to create strings for export. Select from the following values:
      • String: Choose any value; use text to create a custom value.
      • Timestamp: The date and time of the export.
      • Segment Id: The segment ID number.
      • Segment Name: The segment name.
      • Audience Id: The parent segment number.
  1. Set a Schedule.

  • Select the values to define your schedule and optionally include email notifications.
  1. Select Create.

If you need to create an activation for a batch journey, review Creating a Batch Journey Activation.

(オプション)ワークフローでエクスポート結果を設定

Treasure Data Workflow内で、この統合を使用してデータをエクスポートすることを指定できます。

詳細については、Using Workflows to Export Data with the TD Toolbeltをご覧ください。

(オプション)CLIを使用したエクスポート統合

TD ToolbeltをSAP Marketing Cloudへの結果エクスポートに使用することもできます。SAP Marketing Cloudへのエクスポート情報を、screen-shottd queryscreen-shotコマンドのscreen-shot--resultscreen-shotオプションとして指定する必要があります。screen-shottd queryscreen-shotの詳細については、Query Commandsを参照してください。

オプションの形式はJSONで、一般的な構造は次のとおりです。

{
  "type": "sap_marketing_cloud",
  "username": "user",
  "password": "pass}HrNAJE",
  "tenant_id": "mytenant",
  "service_name": "API_MKT_INTERACTION_SRV",
  "target_type": "entity_name",
  "api_version": null,
  "entity_name": "InteractionTags",
  "action": "create",
  "batchSize": 1000
}

パラメータ

Name Description Value Default Value Required
usernameSAP Marketing Cloud通信ユーザー名N/AYes
passwordSAP Marketing Cloud通信ユーザーのパスワードN/AYes
tenant_idSAP Marketing CloudテナントIDN/ANo
service_nameターゲットSAP Marketing Cloudサービス名N/AYes
api_version使用するサービスのバージョンN/AYes
target_type使用するターゲットタイプ
  • entity_name
  • custom_path
entity_nameNo
custom_path_url複雑なパスに必要なリソース用のCustom path URLテンプレート例:
  • TargetGroups(guid'{{TargetGroupUUID}}')/TargetGroupInteractionContacts
target_typecustom_pathの場合はYes
entity_nameデータをエクスポートするエンティティN/Atarget_typeentity_nameの場合はYes
actionデータに適用されるアクション
  • create
  • update
  • partial_update
  • delete
  • upsert
Yes
batch_sizeAPI呼び出しごとにフラッシュするレコード数1000No
skip_invalid_records無効なレコードを無視するかどうかを示します
  • true
  • false
trueNo
retry_limit各API呼び出しの最大再試行回数数値5No
initial_retry_wait最初の再試行の待機時間(秒)数値60No
max_retry_waitAPI呼び出しが諦める前の最大待機時間(秒)数値120No
connection_timeout_secsAPI呼び出しごとの最大接続タイムアウト(秒)数値120No
read_timeout_secsAPI呼び出しごとの最大読み取りタイムアウト(秒)数値120No
write_timeout_secsAPI呼び出しごとの最大書き込みタイムアウト(秒)数値120No

screen-shotentity_namescreen-shotケース

次の例では、target_typeとしてentity_nameを使用します。

td query \
  --result '{
    "type": "sap_marketing_cloud",
    "username": "user",
    "password": "pass",
    "tenant_id": "mytenant",
    "service_name": "API_MKT_INTERACTION_SRV",
    "api_version": null,
    "entity_name": "InteractionTags",
    "action": "create",
    "batchSize": 1000
  }' \
  -d sample_datasets \
  "SELECT * FROM interactiontags" \
  -T presto

screen-shotcustom_pathscreen-shotケース

次の例では、target_typeとしてcustom_pathを使用します。

td query \
  --result '{
    "type": "sap_marketing_cloud",
    "username": "user",
    "password": "pass",
    "tenant_id": "mytenant",
    "service_name": "API_MKT_TARGET_GROUP_SRV",
    "action": "create",
    "target_type": "custom_path",
    "custom_path_url": "TargetGroups(guid'\''{{TargetGroupUUID}}'\'')/TargetGroupInteractionContacts",
    "batch_size": 1000
  }' \
  -d sample_datasets \
  "SELECT * FROM targetGroupinteractioncontacts" \
  -T presto

付録

Entity Nameの決定方法

Entity Nameはさまざまな方法で取得できます。ここでは2つの例を示します:

  • Integration APIs Documentの使用
  • Integration APIsの使用

この例では、API_MKT_CONTACT_SRVがターゲットサービスとして使用されます。

integrations APIs Document

Integration APIs Documentを使用してデータを取得するには:

  1. SAP Marketing Cloud - Integration APIsにアクセスして、利用可能なパブリックAPIを見つけます。
  2. 対応するサービスのOData Service Structureに移動します(例: Structure of OData Service API_MKT_CONTACTS)。

構造、エンティティセット、およびサポートされる操作に関する関連情報がここで利用できます。

Integrations APIs

Integration APIsを使用してデータを取得するには:

  1. ターゲットサービスのscreen-shot$metadatascreen-shotエンドポイントを呼び出します。
curl --location --request GET \
  'https://{tenant}.s4hana.ondemand.com/sap/opu/odata/sap/API_MKT_CONTACT_SRV/$metadata' \
  --header 'x-csrf-token: Fetch' \
  --header 'Authorization: Basic {encode_base_64(username:password)}'
  1. レスポンスドキュメントから、screen-shotEntityContainer Name="{TARGET_SERVICE}_Entities"screen-shotを見つけます。この例では、screen-shotEntityContainer Name="API_MKT_CONTACT_SRV_Entities"screen-shotになります。

    <EntityContainer
      Name="API_MKT_CONTACT_SRV_Entities"
      m:IsDefaultEntityContainer="true"
      sap:supported-formats="atom json xlsx pdf">
      <EntitySet
        Name="MarketingAreas"
        EntityType="API_MKT_CONTACT_SRV.MarketingArea"
        sap:creatable="false"
        sap:deletable="false"
        sap:content-version="4"/>
      <EntitySet
        Name="MarketingLocations"
        EntityType="API_MKT_CONTACT_SRV.MarketingLocation"
        sap:creatable="false"
        sap:deletable="false"
        sap:content-version="4"/>
      <EntitySet
        Name="Contacts"
        EntityType="API_MKT_CONTACT_SRV.Contact"
        sap:creatable="false"
        sap:updatable="false"
        sap:deletable="false"
        sap:content-version="4"/>
      <EntitySet
        Name="ContactOriginData"
        EntityType="API_MKT_CONTACT_SRV.ContactOriginData"
        sap:creatable="false"
        sap:deletable="false"
        sap:content-version="4"/>
    </EntityContainer>
  2. 取り込みたいscreen-shotEntitySetscreen-shotを選択します。

  3. screen-shotName=screen-shot引用符内のテキストをコピーします。 この名前はGUIで使用されます: 例: ContactsMarketingAreasMarketingLocationsContactOriginDataなど。

Target Type

ターゲットタイプは、選択したアクションに対してURLがどのように構築されるかに影響します。Target Typeには2つのオプションがあります:

  • Entity name
  • Custom path

entity nameオプションを使用すると、URLのプレフィックスは、次のテンプレートを使用してscreen-shottenant_idscreen-shot、screen-shotservice_namescreen-shot、およびscreen-shotentity_namescreen-shotに基づいて構築されます:

https://{{tenant_id}}.s4hana.ondemand.com/sap/opu/odata/sap/{{service_name}}/{{entity_name}}

custom pathオプションを使用すると、URLのプレフィックスは、screen-shottenant_idscreen-shot、screen-shotservice_namescreen-shot、screen-shotcustom_path_urlscreen-shot、およびエクスポートされたデータに基づいて構築されます。custom pathは、エクスポートされたデータから提供された値を使用してscreen-shotcustom_path_urlscreen-shot内のタグを展開することによって構築されます。次に、共通のプレフィックスと組み合わされます。

https://{{tenant_id}}.s4hana.ondemand.com/sap/opu/odata/sap/{{service_name}}/{{custom path}

たとえば、次のcustom_path設定を使用する場合:

target_type: custom_path
tenant_id: my_tenant
service_name: API_MKT_CONTACT_SRV
custom_path_url: TargetGroups(guid'{{TargetGroupUUID}}')/TargetGroupInteractionContacts

次のエクスポートされたデータを使用する場合:

InteractionContactUUID,TargetGroupUUID
00000000-0000-0000-0000-000000000000,00000000-0000-0000-0000-000000000001

custom pathのURLエンドポイントは次のようになります:

https://my_tenant.s4hana.ondemand.com/sap/opu/odata/sap/API_MKT_CONTACT_SRV/TargetGroups(guid'00000000-0000-0000-0000-000000000001')/TargetGroupInteractionContacts