SAP Marketing Cloud(旧Hybris Marketing)は、ユーザーデータを一元化されたハブに統合することで、個々の顧客と匿名の訪問者に関するリアルタイムのコンテキストベースのデータを提供するマーケティングソリューションです。これにより、ブランドは、マーケティングチャネルやデバイスに関係なく、カスタマージャーニー全体を通じて一貫性のある、コンテキストに沿った、関連性の高いエクスペリエンスを提供できます。このソリューションの機能には以下が含まれます:
- Data Management — ブランドとやり取りする人々の360度のビューを提供し、リアルタイムで適切なコンテキストでターゲティングできるようにします。
- Recommendations — 顧客にタイムリーで非常に関連性の高い推奨事項を提供し、顧客の関心をコンバージョンに変換するのに役立ちます。
- Segmentation — リアルタイムで高性能なオーディエンスセグメンテーションを提供し、複数のチャネルにわたってパーソナライズされたキャンペーンを可能にします。
SAP Marketing Cloudは、エコシステム内の複数のサービスでOpen Data Protocol(OData)の原則に厳密に従っているため、以下が可能な柔軟なソリューションを構築できます:
- OData Protocolを使用してSAP Marketing Cloud製品にデータをエクスポート、更新、削除します。
- SAP Marketing Cloudが提供するカスタムユースケースをサポートします SAP Marketing Cloud - Integration APIs。たとえば、以下のことができます:
- Interaction Contactを特定のターゲットグループに割り当てる: 例: SAP Marketing Cloud - Structure of OData Service API_MKT_TARGET_GROUP_SRV
- 連絡先関係データを更新または作成する: 例: SAP Marketing Cloud - Structure of OData Service API_MKT_CONTACTS
- SAP Marketing Cloud - API Hubにリストされている関連するインタラクションを組み込む
- Treasure Data™の基本知識
- SAP Marketing Cloudの基本知識
- Open Data Protocolの基本知識
- SAP通信ユーザーアカウント
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/
Treasure Dataでは、クエリを実行する前にデータ接続を作成して設定する必要があります。データ接続の一部として、統合にアクセスするための認証を提供します。
TD Consoleを開きます。
Integrations Hub > Catalogに移動します。
SAP Marketing Cloudを検索して選択します。

- Create Authenticationを選択します。

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

| Parameter | Description |
|---|---|
| Username | SAP Marketing Cloud通信ユーザー名 |
| Password | SAP Marketing Cloud通信ユーザーのパスワード |
| Tenant ID | SAP Marketing CloudテナントID |
Continueを選択します。
接続の名前を入力します。
Doneを選択します。
Data Workbench > Queriesに移動します。
New Queryを選択します。
クエリを入力します。
Runを選択してクエリを実行し、結果セットを検証します。

- Export Resultsを選択します。

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

新しい統合を作成


| Field | Description |
|---|---|
| Service Name | ターゲットSAP Marketing Cloudサービス名 |
| Service Version | 使用するサービスのバージョン |
Target Type | 使用するターゲットタイプ:
これは、選択したアクションに対してURLがどのように構築されるかに影響します。詳細については、Appendixを参照してください。 |
| Entity Name | データをエクスポートするエンティティ |
| Custom Path URL | リソース用のCustom Path URLテンプレート。 これは、標準のODataエンティティでは処理できない複雑なパスに必要です。このオプションは、screen-shot{{name}}—screen-shotの形式に従います。これは、名前が統合に転送された実際のデータ行に置き換えられることを意味します。 例: screen-shotTargetGroups(guid'{{TargetGroupUUID}}')/TargetGroupInteractionContactsscreen-shot |
| Action | データに適用されるアクション
|
| Batch Size | API呼び出しごとにエグレスするレコード数 |
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.
Navigate to Data Workbench > Queries
Create a new query or select an existing query.
Next to Schedule, select None.

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

Drop-down Value Description 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. None No schedule.

| Cron Value | Description |
|---|---|
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 Value | Example | Example 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. |
- (Optional) You can delay the start time of a query by enabling the Delay execution.
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.
You can also send segment data to the target platform by creating an activation in the Audience Studio.
- Navigate to Audience Studio.
- Select a parent segment.
- Open the target segment, right-mouse click, and then select Create Activation.
- In the Details panel, enter an Activation name and configure the activation according to the previous section on Configuration Parameters.
- 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.
- + Add string to create strings for export. Select from the following values:
- Set a Schedule.

- Select the values to define your schedule and optionally include email notifications.
- 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をご覧ください。
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 |
|---|---|---|---|---|
| username | SAP Marketing Cloud通信ユーザー名 | N/A | Yes | |
| password | SAP Marketing Cloud通信ユーザーのパスワード | N/A | Yes | |
| tenant_id | SAP Marketing CloudテナントID | N/A | No | |
| service_name | ターゲットSAP Marketing Cloudサービス名 | N/A | Yes | |
| api_version | 使用するサービスのバージョン | N/A | Yes | |
| target_type | 使用するターゲットタイプ |
| entity_name | No |
| custom_path_url | 複雑なパスに必要なリソース用のCustom path URLテンプレート | 例:
| target_typeがcustom_pathの場合はYes | |
| entity_name | データをエクスポートするエンティティ | N/A | target_typeがentity_nameの場合はYes | |
| action | データに適用されるアクション |
| Yes | |
| batch_size | API呼び出しごとにフラッシュするレコード数 | 1000 | No | |
| skip_invalid_records | 無効なレコードを無視するかどうかを示します |
| true | No |
| retry_limit | 各API呼び出しの最大再試行回数 | 数値 | 5 | No |
| initial_retry_wait | 最初の再試行の待機時間(秒) | 数値 | 60 | No |
| max_retry_wait | API呼び出しが諦める前の最大待機時間(秒) | 数値 | 120 | No |
| connection_timeout_secs | API呼び出しごとの最大接続タイムアウト(秒) | 数値 | 120 | No |
| read_timeout_secs | API呼び出しごとの最大読み取りタイムアウト(秒) | 数値 | 120 | No |
| write_timeout_secs | API呼び出しごとの最大書き込みタイムアウト(秒) | 数値 | 120 | No |
次の例では、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次の例では、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 prestoEntity Nameはさまざまな方法で取得できます。ここでは2つの例を示します:
- Integration APIs Documentの使用
- Integration APIsの使用
この例では、API_MKT_CONTACT_SRVがターゲットサービスとして使用されます。
Integration APIs Documentを使用してデータを取得するには:
- SAP Marketing Cloud - Integration APIsにアクセスして、利用可能なパブリックAPIを見つけます。
- 対応するサービスのOData Service Structureに移動します(例: Structure of OData Service API_MKT_CONTACTS)。
構造、エンティティセット、およびサポートされる操作に関する関連情報がここで利用できます。
Integration APIsを使用してデータを取得するには:
- ターゲットサービスの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)}'レスポンスドキュメントから、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>取り込みたいscreen-shotEntitySetscreen-shotを選択します。
screen-shotName=screen-shot引用符内のテキストをコピーします。 この名前はGUIで使用されます: 例: Contacts、MarketingAreas、MarketingLocations、ContactOriginDataなど。
ターゲットタイプは、選択したアクションに対して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-000000000001custom pathのURLエンドポイントは次のようになります:
https://my_tenant.s4hana.ondemand.com/sap/opu/odata/sap/API_MKT_CONTACT_SRV/TargetGroups(guid'00000000-0000-0000-0000-000000000001')/TargetGroupInteractionContacts