新版 Search Ads 360 中的實體 ID 空間與舊版 Search Ads 360 不同。
    如要取得舊版和新版 Search Ads 360 之間的 ID 對應項目,請傳送 Reports.getIdMappingFile() 要求。回應包含指定廣告客戶的大部分實體 ID 對應項目。請參閱實體遺漏的常見原因,進一步瞭解為何實體可能會從對應檔案中省略。
以下是傳回檔案的範例 (CSV 格式,以 UTF-8 編碼):
Entity Type,Legacy IDs,New IDs
CUSTOMER,"{""agencyId"":""20700000000000125"",""advertiserId"":""2170000012345"",""engineAccountId"":""700000000042205""}","{""customerId"":""200001235""}"
  CSV 檔案含有 3 欄資料:
Entity Type:這個資料列的實體類型。Legacy IDs:舊版 Search Ads 360 中完整實體路徑的 JSON 字串New IDs:新版 Search Ads 360 中完整實體路徑的 JSON 字串
下表列出支援的實體和 ID 對應範例:
| 實體類型 | 說明 | 舊版 ID | 新 ID | 
|---|---|---|---|
| 客戶 | 以下 ID 對應: 管理員和代理商的對應項目無法使用。 | 
          
advertiser:
{
  "agencyId": "20700000000000125",
  "advertiserId": "2170000012345"
}
account:
{
  "agencyId": "20700000000000125",
  "advertiserId": "2170000012345",
  "engineAccountId": "700000000042205"
}
           | 
        
          
{
"customerId": "200001235"
}
           | 
      
| 廣告活動 | 廣告活動的 ID 對應。 | 
          
{
 "agencyId":"20700000000000125",
 "advertiserId":"2170000012345",
 "engineAccountId":"700000000042205",
 "campaignId":"71700000087192405"
}
           | 
        
          
{
  "customerId": "200001235",
  "campaignId": "14660344555"
}
           | 
      
| AD_GROUP | adGroup 的 ID 對應。 | 
          
{
  "agencyId": "20700000000000125",
  "advertiserId": "2170000012345",
  "engineAccountId": "700000000042205",
  "campaignId": "71700000084761225",
  "adGroupId": "58700007213529045"
}
           | 
        
          
{
  "customerId": "200001235",
  "campaignId": "13666840065",
  "adGroupId": "127701366165"
}
           | 
      
| 準則 | 廣告群組層級條件的 ID 對應: | 
          
adGroupTarget and negativeAdGroupTarget:
{
  "agencyId": "20700000000000125",
  "advertiserId": "2170000012345",
  "engineAccountId": "700000000042205",
  "campaignId": "71700000068948065",
  "adGroupId": "58700006123995025",
  "adGroupTargetId": "46700015332504045"
}
keyword:
{
  "agencyId": "20700000000000125",
  "advertiserId": "2170000012345",
  "engineAccountId": "700000000042205",
  "campaignId": "71700000068948065",
  "adGroupId": "58700006123995025",
  "criterionId": "46700015332504045"
}
negativeAdGroupKeyword:
{
  "agencyId": "20700000000000125",
  "advertiserId": "2170000012345",
  "engineAccountId": "700000000042205",
  "campaignId": "71700000068948065",
  "adGroupId": "58700006123995025",
  "negativeAdGroupCriterionId": "46700015332504045"
}
productGroup:
{
  "agencyId": "20700000000000125",
  "advertiserId": "2170000012345",
  "engineAccountId": "700000000042205",
  "campaignId": "71700000068948065",
  "adGroupId": "58700006123995025",
  "productGroupId": "92700000508010025"
}
           | 
        
          
{
  "customerId": "200001235",
  "campaignId": "14660344555",
  "adGroupId":"105138634255",
  "criterionId":"948710340465"
}
           | 
      
| AD | ad 的 ID 對應。 | 
          
{
  "agencyId": "20700000000000125",
  "advertiserId": "2170000012345",
  "engineAccountId": "700000000042205",
  "campaignId": "71700000065395945",
  "adGroupId": "58700005797210525",
  "adId": "44700029299414085"
}
           | 
        
          
{
  "customerId": "200001235",
  "campaignId": "15314179325",
  "adGroupId": "131599768485",
  "adId": "562719339005"
}
           | 
      
| CAMPAIGN_CRITERION | 廣告活動層級條件 ID 對應: | 
          
{
  "agencyId": "20700000000000125",
  "advertiserId": "2170000012345",
  "engineAccountId": "700000000042205",
  "campaignId": "71700000084403015",
  "campaignTargetId": "38700011011700285"
}
           | 
        
          
{
  "customerId": "200001235",
  "campaignId": "13467100745",
  "campaignCriterionId": "2125"
}
           | 
      
| CAMPAIGN_GROUP | 廣告活動群組的 ID 對應。 | 
          
{
  "agencyId": "20700000000000125",
  "advertiserId": "2170000012345",
  "budgetGroupId": "87700002234256082"
}
           | 
        
          
{
  "customerId": "200001235",
  "campaignGroupId": "1000665659"
}
           | 
      
| CAMPAIGN_GROUP_PERFORMANCE_TARGET | 廣告活動群組成效目標的 ID 對應。 | 
          
{
  "agencyId": "20700000000000125",
  "advertiserId": "2170000012345",
  "budgetGroupId": "87700002234256082",
  "budgetPlanId": "88700007187391026"
}
           | 
        
          
{
  "customerId": "200001235",
  "campaignGroupId": "1000665659"
  "campaignGroupPerformanceTargetId": "7624175"
}
           | 
      
| FEED_TABLE | 動態饋給資料表的 ID 對應。 | 
          
{
  "agencyId": "20700000000000125",
  "advertiserId": "2170000012345",
  "engineAccountId": "700000000042205",
  "feedTableId": "32700008040329135"
}
           | 
        
          
{
  "customerId": "200001235",
  "feedId": "207040045"
}
           | 
      
| FEED_ITEM | feedItem 的 ID 對應。 | 
          
{
  "agencyId": "20700000000000125",
  "advertiserId": "2170000012345",
  "engineAccountId": "700000000042205",
  "feedTableId": "32700014854183375",
  "feedItemRowId": "33700014854183415"
}
           | 
        
          
{
  "customerId": "200001235",
  "feedId": "377982485",
  "feedItemId": "235028589065"
}
           | 
      
缺少實體的常見原因
雖然廣告主的對應檔案會包含大部分實體,但仍有少數情況會遺漏實體。以下是幾個最常見的原因:
- 每個對應檔案都會每 3 天更新一次。如果在建立新實體後立即下載對應檔案,實體可能不會出現在對應檔案中。最多等待 3 天後,系統就會將其納入。
 - 實體所屬的帳戶會遭到移除。在這種情況下,我們不支援 ID 對應。
 - 新版 Search Ads 360 不支援引擎端實體 (例如廣告活動) 的更新。更新作業是透過建立新版 Search Ads 360 實體來處理,並隨後移除舊版 Search Ads 360 實體。
 - 舊版和新版 Search Ads 360 之間的同步處理可能會移除舊版對應項目,只保留最新的對應項目。系統會解決單一舊 ID 與多個新版 Search Ads 360 ID 之間的多個對應項目,並保留具有最新時間戳記的對應項目。
 - 舊版和新版 Search Ads 360 之間的同步處理發生錯誤,因此引擎帳戶未同步。
 - 帳戶遭到移除或停用。
 
下載報告
JSON
GET https://www.googleapis.com/doubleclicksearch/v2/agency/agencyId/advertiser/advertiserId/idmapping?alt=media
Python
def download_mapping_file(service, file_name, agency_id, advertiser_id): """Generate and save mapping file to a csv. Args: service: An authorized Doubleclicksearch service. file_name: Filename to write the ID mapping file. agency_id: DS ID of the agency. advertiser_id: DS ID of the advertiser. """ request = service.reports().getIdMappingFile_media(agencyId=agency_id, advertiserId=advertiser_id) f = open(file_name + '.csv', 'w') f.write(request.execute().decode('utf-8')) f.close()
物件 ID 唯一性
新版 Search Ads 360 中的每個物件都有專屬 ID,其中部分 ID 在新版 Search Ads 360 中,在所有帳戶的全球層級皆為唯一,其他則僅在特定範圍內為唯一。舉例來說,您必須同時使用廣告群組和廣告 ID 才能唯一識別廣告,因為廣告 ID 是為個別廣告群組指派,而非跨廣告群組指派。以下列出新版 Search Ads 360 中每個物件 ID 的唯一性。當您為新 Search Ads 360 物件設計本機儲存空間時,這些 ID 規則可能會很實用。
| 物件 ID | 獨特性範圍 | 是否具有全域獨特性? | 
|---|---|---|
| 預算編號 | 全域 | 是 | 
| 廣告活動編號 | 全域 | 是 | 
| AdGroup 編號 | 全域 | 是 | 
| 廣告編號 | 廣告群組 | 否。 (AdGroupId、AdId) 組合在全球範圍內是唯一的。 | 
    
| AdGroupCriterion 編號 | 廣告群組 | 否。 (AdGroupId、CriterionId) 組合在全球範圍內是唯一的。 | 
    
| CampaignCriterion 編號 | 廣告活動 | 否。 (CampaignId、CriterionId) 組合在全球範圍內是唯一的。 | 
    
| 廣告額外資訊 | 廣告活動 | 否。 (CampaignId、AdExtensionId) 組合在全球範圍內是唯一的。 | 
    
| 動態饋給ID | 全域 | 是 | 
| 資訊提供項目編號 | 全域 | 是 | 
| 資訊提供屬性編號 | 資訊提供 | 否 | 
| 資訊提供對應編號 | 全域 | 是 | 
| 標籤編號 | 全域 | 是 | 
| 使用者名單 ID | 全球 | 是 |