Content API for Shopping を使用して販売者アカウントのコンバージョン ソースを管理する方法は次のとおりです。
Merchant Center のコンバージョン ソースを使用すると、無料 リスティングとウェブサイトのコンバージョン データを販売者 アカウントで確認できます。
Content API for Shopping でコンバージョン ソースを管理するには、 自動タグ設定を設定し 、ウェブサイトの所有権を主張する 必要があります。
Google アナリティクス 4 をリンクする
Google アナリティクス を使用すると、無料リスティングとウェブサイトのコンバージョンをトラッキングできます。
Google アナリティクス 4 プロパティの管理者権限がある場合は、Google アナリティクス 4 のコンバージョン ソースを作成して、プロパティを販売者アカウントにリンクできます。
販売者
アカウントに Google アナリティクス 4 の新しい
ConversionSource オブジェクトを作成するサンプルを次に示します。
POST https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/conversionsources/
{
"googleAnalyticsLink": {
"propertyId": {propertyId}
}
}
ConversionSource オブジェクトを含むレスポンスのサンプルを次に示します。Google アナリティクス 4 のコンバージョン ソースには、googleAnalyticsLink フィールドが設定され、conversionSourceId が galk: で始まります。
{
"conversionSourceId": "galk:{propertyId}",
"googleAnalyticsLink": {
"propertyId": "{propertyId}",
"attributionSettings": {
"attributionLookbackWindowInDays": 90,
"atributionModel": "CROSS_CHANNEL_DATA_DRIVEN",
"conversionType": [
{
"name": "purchase",
"includeInReporting": true
}
]
},
"propertyName": "My Property Name"
},
"state": "ACTIVE",
"controller": "MERCHANT"
}
Google タグを使用する
Google アナリティクス 4 プロパティがない場合は、Google タグを使用してウェブサイトのコンバージョン ソースを作成し、コンバージョン データ を販売者アカウントに直接送信できます。 Google タグ マネージャー API を使用して既存の Google タグを設定することも、新しい ウェブサイトのコンバージョン ソースを追加したときに自動的に作成される新しいタグを使用することもできます。
販売者アカウントのウェブサイト トラッキング用に新しい ConversionSource オブジェクトを作成するサンプルを次に示します。
POST https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/conversionsources/
{
"merchantCenterDestination": {
"displayName": "My tag destination",
"attributionSettings": {
"attributionLookbackWindowInDays": 60,
"attributionModel": "CROSS_CHANNEL_LAST_CLICK"
},
"currencyCode": "CHF"
}
}
ConversionSource オブジェクトを含むレスポンスのサンプルを次に示します。ウェブサイトのコンバージョン ソースには、merchantCenterDestination フィールドが設定され、conversionSourceId が mcdn: で始まります。
{
"conversionSourceId": "mcdn:12341241234",
"merchantCenterDestination": {
"destinationId": "MC-ABCD1234",
"attributionSettings": {
"attributionLookbackWindowInDays": 60,
"attributionModel": "CROSS_CHANNEL_LAST_CLICK"
},
"displayName": "My tag destination",
"currencyCode": "CHF"
},
"state": "ACTIVE",
"controller": "MERCHANT"
}
作成したら、コンバージョン ソースの destinationId を Google
タグ で使用して、ウェブサイトからコンバージョン データを直接取得できます。