从 Content API for Shopping 迁移转化来源管理

借助 Merchant Center 转化来源,您可以在商家账号中查看非付费商品详情您网站带来的转化数据。借助 Merchant API,您可以管理商家账号的转化来源。如需了解详情,请参阅管理转化来源

本页介绍了如何将转化来源管理从 Content API 迁移到 Merchant API。

请求

下面的示例比较了 Content API for Shopping 与 Merchant Conversion Sources API 针对转化来源请求的使用方式:

Content API Merchant API
网址 GET https://shoppingcontent.googleapis.com/content/v2.1/{MERCHANT_ID}/conversionSources/{CONVERSIONSOURCE_ID} GET https://merchantapi.googleapis.com/conversions/v1beta/{NAME}
标识符 {MERCHANT_ID}/conversionSources/{CONVERSIONSOURCE_ID} {NAME}

方法

以下是 Conversion Sources API 中转化来源方法的变更:

方法 Content API for Shopping 中的网址 Merchant API 中的网址 Content API for Shopping 中的标识符 Merchant API 中的标识符 说明
create POST https://shoppingcontent.googleapis.com/content/v2.1/{MERCHANT_ID}/conversionSources POST https://merchantapi.googleapis.com/conversions/v1beta/accounts/{PARENT}/conversionSources {MERCHANT_ID} {PARENT} 在 Merchant API 中,propertyName 称为 property
更新 PATCH https://shoppingcontent.googleapis.com/content/v2.1/{MERCHANT_ID}/conversionSources/{CONVERSIONSOURCE_ID} PATCH https://merchantapi.googleapis.com/conversions/v1beta/accounts/{CONVERSIONSOURCE_NAME} {MERCHANT_ID}/conversionSources/{CONVERSIONSOURCE_ID} {CONVERSIONSOURCE_NAME} 在 Merchant API 中,destinationId 称为 destination
delete DELETE https://shoppingcontent.googleapis.com/content/v2.1/{MERCHANT_ID}/conversionSources/{CONVERSIONSOURCE_ID} DELETE https://merchantapi.googleapis.com/conversions/v1beta/accounts/{NAME} {MERCHANT_ID}/conversionSources/{CONVERSIONSOURCE_ID} {NAME} 在 Merchant API 中,attributionLookbackWindowInDays 称为 attributionLookbackWindowDays
在 Merchant API 中,includeInReporting 称为 report
undelete POST https://shoppingcontent.googleapis.com/content/v2.1/{MERCHANT_ID}/conversionSources/{CONVERSIONSOURCE_ID}:undelete POST https://merchantapi.googleapis.com/conversions/v1beta/accounts/{name}:undelete {MERCHANT_ID}/conversionSources/{CONVERSIONSOURCE_ID} {NAME} Merchant API 中的网址和标识符不同。
Conversion Sources API 会返回 ConversionSource,而不是 Empty
get GET https://shoppingcontent.googleapis.com/content/v2.1/{MERCHANT_ID}/conversionSources/{CONVERSIONSOURCE_ID} GET https://merchantapi.googleapis.com/conversions/v1beta/accounts/{NAME} {MERCHANT_ID}/conversionSources/{CONVERSIONSOURCE_ID} {NAME} Merchant API 中的网址和标识符不同。
list GET https://shoppingcontent.googleapis.com/content/v2.1/{MERCHANT_ID}/conversionSources GET https://merchantapi.googleapis.com/conversions/v1beta/{PARENT}/conversionSources {MERCHANT_ID} {PARENT} Merchant API 中的网址和标识符不同。

资源

下表列出了 Conversion Sources API 中转化来源资源的变更:

Content API for Shopping Merchant API 说明
googleAnalyticsLink: {

property_id: int64,

attributionSettings: object,

propertyName: string

}

googleAnalyticsLink: {

propertyId: int64,

attributionSettings: object,

property: string

}

在 Merchant API 中,propertyName 称为 property
merchantCenterDestination: {

destinationId: string,

attributionSettings: object,

displayName: string,

currencyCode: string

}

merchantCenterDestination: {

destination: string,

attributionSettings: object,

displayName: string,

currencyCode: string

}

在 Merchant API 中,destinationId 称为 destination
attributionSettings: {

attributionLookbackWindowDays: int32,

attributionModel: object,

repeated conversionType: {

name: string,

includeInReporting: bool

}

}

attributionSettings: {

attributionLookbackWindowDays: int32,

attributionModel: object,

repeated conversionType: {

name: string,

report: bool

}

}

在 Merchant API 中,attributionLookbackWindowInDays 称为 attributionLookbackWindowDays

在 Merchant API 中,includeInReporting 称为 report