ID Mapping For The New Search Ads 360

The new Search Ads 360 Reporting API is now available. The new API provides enhanced flexibility to build custom reports and integrate the data into your reporting applications and processes. Learn more about migrating to and using the new Search Ads 360 Reporting API.

Entities in the new Search Ads 360 have different ID space than the previous Search Ads 360. To get the ID mapping between the previous and the new Search Ads 360, send a Reports.getIdMappingFile() request. The response includes ID mappings for most entities for a specified advertiser. See Common reasons for missing entities to learn more about why an entity might be omitted from the mapping file.

Here is an example of the returned file (CSV format encoded in UTF-8):

Entity Type,Legacy IDs,New IDs
CUSTOMER,"{""agencyId"":""20700000000000125"",""advertiserId"":""2170000012345"",""engineAccountId"":""700000000042205""}","{""customerId"":""200001235""}"
  

The CSV file has 3 columns:

  • Entity Type: the entity type of this row.

  • Legacy IDs: a JSON string of the full entity path in the previous Search Ads 360

  • New IDs: a JSON string of the full entity path in the new Search Ads 360

The table below shows a list of supported entities and example ID mappings:

Entity Type Description Legacy IDs New IDs
CUSTOMER ID mapping for: Mappings for managers and agencies are not available.
advertiser:
{
  "agencyId": "20700000000000125",
  "advertiserId": "2170000012345"
}

account:
{
  "agencyId": "20700000000000125",
  "advertiserId": "2170000012345",
  "engineAccountId": "700000000042205"
}
          
{
"customerId": "200001235"
}
          
CAMPAIGN ID mapping for campaign.
{
 "agencyId":"20700000000000125",
 "advertiserId":"2170000012345",
 "engineAccountId":"700000000042205",
 "campaignId":"71700000087192405"
}
          
{
  "customerId": "200001235",
  "campaignId": "14660344555"
}
          
AD_GROUP ID mapping for adGroup.
{
  "agencyId": "20700000000000125",
  "advertiserId": "2170000012345",
  "engineAccountId": "700000000042205",
  "campaignId": "71700000084761225",
  "adGroupId": "58700007213529045"
}
          
{
  "customerId": "200001235",
  "campaignId": "13666840065",
  "adGroupId": "127701366165"
}
          
CRITERION ID mapping for ad group level criteria:
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 ID mapping for ad.
{
  "agencyId": "20700000000000125",
  "advertiserId": "2170000012345",
  "engineAccountId": "700000000042205",
  "campaignId": "71700000065395945",
  "adGroupId": "58700005797210525",
  "adId": "44700029299414085"
}
          
{
  "customerId": "200001235",
  "campaignId": "15314179325",
  "adGroupId": "131599768485",
  "adId": "562719339005"
}
          
CAMPAIGN_CRITERION ID mapping for campaign level criteria:
{
  "agencyId": "20700000000000125",
  "advertiserId": "2170000012345",
  "engineAccountId": "700000000042205",
  "campaignId": "71700000084403015",
  "campaignTargetId": "38700011011700285"
}
          
{
  "customerId": "200001235",
  "campaignId": "13467100745",
  "campaignCriterionId": "2125"
}
          
CAMPAIGN_GROUP ID mapping for campaign group.
{
  "agencyId": "20700000000000125",
  "advertiserId": "2170000012345",
  "budgetGroupId": "87700002234256082"
}
          
{
  "customerId": "200001235",
  "campaignGroupId": "1000665659"
}
          
CAMPAIGN_GROUP_PERFORMANCE_TARGET ID mapping for campaign group performance target.
{
  "agencyId": "20700000000000125",
  "advertiserId": "2170000012345",
  "budgetGroupId": "87700002234256082",
  "budgetPlanId": "88700007187391026"
}
          
{
  "customerId": "200001235",
  "campaignGroupId": "1000665659"
  "campaignGroupPerformanceTargetId": "7624175"
}
          
FEED_TABLE ID mapping for Feed Table.
{
  "agencyId": "20700000000000125",
  "advertiserId": "2170000012345",
  "engineAccountId": "700000000042205",
  "feedTableId": "32700008040329135"
}
          
{
  "customerId": "200001235",
  "feedId": "207040045"
}
          
FEED_ITEM ID mapping for feedItem.
{
  "agencyId": "20700000000000125",
  "advertiserId": "2170000012345",
  "engineAccountId": "700000000042205",
  "feedTableId": "32700014854183375",
  "feedItemRowId": "33700014854183415"
}
          
{
  "customerId": "200001235",
  "feedId": "377982485",
  "feedItemId": "235028589065"
}
          

Common reasons for missing entities

While an advertiser's mapping file will contain most of their entities, there are still some cases where entities will be missing. Here are some of the most common reasons:

  • Each mapping file is updated every 3 days. If a mapping file is downloaded immediately after a new entity is created, the entity will probably not be in the mapping file. It will likely be included after waiting up to 3 days.
  • The account the entity belongs to is removed. We don't support ID mapping in this case.

Download the report

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()

Object ID uniqueness

Every object in the new Search Ads 360 is identified by its own ID. Some of these IDs are unique on a global level across all accounts in the new Search Ads 360, while others are unique only within a confined scope. For example, you must use both the ad group and ad IDs to uniquely identify ads, since ad IDs are uniquely assigned per ad group, but not across ad groups. The uniqueness of each object ID within the new Search Ads 360 is listed below. These ID rules can be useful when designing local storage for your new Search Ads 360 objects.

Object ID Scope of uniqueness Globally unique?
Budget ID Global Yes
Campaign ID Global Yes
AdGroup ID Global Yes
Ad ID Ad Group No. (AdGroupId, AdId) pair is globally unique.
AdGroupCriterion ID Ad Group No. (AdGroupId, CriterionId) pair is globally unique.
CampaignCriterion ID Campaign No. (CampaignId, CriterionId) pair is globally unique.
Ad Extensions Campaign No. (CampaignId, AdExtensionId) pair is globally unique.
Feed ID Global Yes
Feed Item ID Global Yes
Feed Attribute ID Feed No
Feed Mapping ID Global Yes
Label ID Global Yes
UserList ID Global Yes