コンバージョンの発生元を管理する

Content API for Shopping を使用して販売アカウントのコンバージョンの発生元を管理する手順は次のとおりです。

Merchant Center のコンバージョンの発生元を使用すると、販売アカウントの無料リスティングウェブサイトのコンバージョン データを表示できます。

Content API for Shopping を使用してコンバージョンの発生元を管理するには、販売アカウントで自動タグ設定を設定し、ウェブサイトを申請する必要があります。

Google アナリティクスを使用すると、無料リスティングとウェブサイトのコンバージョンをトラッキングできます。

Google アナリティクスのプロパティの管理者権限をお持ちの場合は、Google アナリティクス コンバージョンの発生元を作成することで、プロパティを販売アカウントにリンクできます。

以下は、Google アナリティクスの販売アカウントに新しい ConversionSource オブジェクトを作成する例です。

POST https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/conversionsources/
{
 "googleAnalyticsLink": {
   "propertyId": {propertyId}
  }
}

ConversionSource オブジェクトを含むレスポンスの例を次に示します。Google アナリティクスのコンバージョンの発生元には googleAnalyticsLink フィールドが設定され、galk: で始まる conversionSourceId があります。

{
  "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 アナリティクスのプロパティをお持ちでない場合は、Google タグを使ってウェブサイト コンバージョンの発生元を作成すると、コンバージョン データを販売アカウントに直接送信できます。Google Tag Manager 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 フィールドが設定され、mcdn: で始まる conversionSourceId があります。

{
  "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"
}

作成した後は、コンバージョンの発生元の destinationIdGoogle タグを使用して、コンバージョン データをウェブサイトから直接取得できます。