Load Search Ads 360 data into BigQuery

You can load data from Search Ads 360 to BigQuery using the BigQuery Data Transfer Service for Search Ads 360 connector. With the BigQuery Data Transfer Service, you can schedule recurring transfer jobs that add your latest data from Search Ads 360 to BigQuery.

Connector overview

The BigQuery Data Transfer Service for the Search Ads 360 connector supports the following options for your data transfer.

Data transfer options Support
Supported reports The Search Ads 360 connector supports the transfer of data from the reports in Search Ads 360 v0 reports .

For information about how Search Ads 360 reports are transformed into BigQuery tables and views, see Search Ads 360 report transformation .

Repeat frequency The Search Ads 360 connector supports daily data transfers.

By default, data transfers are scheduled at the time when the data transfer is created. You can configure the time of data transfer when you set up your data transfer .
Refresh window You can schedule your data transfers to retrieve Search Ads 360 data from up to 30 days at the time the data transfer is run. You can configure the duration of the refresh window when you set up your data transfer .

By default, the Search Ads 360 connector has a refresh window of 7 days.

For more information, see Refresh windows .

Snapshots of Match Tables are taken once a day and stored in the partition for the last run date. Match Table snapshots are not updated for backfills or for days loaded using the refresh window.

Backfill data availability Run a data backfill to retrieve data outside of your scheduled data transfer. You can retrieve data as far back as the data retention policy on your data source allows.

For information about the data retention policy for Search Ads 360, see Reporting data retention policy .
Number of Customer IDs per manager account The BigQuery Data Transfer Service supports a maximum of 8000 Customer IDsfor each Search Ads 360 manager account .

To see the Search Ads 360 transfer guide that uses the old Search Ads 360 reporting API, see Search Ads 360 transfers (Deprecated) .

Data ingestion from Search Ads 360 transfers

When you transfer data from Search Ads 360 into BigQuery, the data is loaded into BigQuery tables that are partitioned by date. The table partition that the data is loaded into corresponds to the date from the data source. If you schedule multiple transfers for the same date, BigQuery Data Transfer Service overwrites the partition for that specific date with the latest data. Multiple transfers in the same day or running backfills don't result in duplicate data, and partitions for other dates are not affected.

Refresh windows

A refresh window is the number of days that a data transfer retrieves data when a data transfer occurs. For example, if the refresh window is three days and a daily transfer occurs, the BigQuery Data Transfer Service retrieves all data from your source table from the past three days. In this example, when a daily transfer occurs, the BigQuery Data Transfer Service creates a new BigQuery destination table partition with a copy of your source table data from the current day, then automatically triggers backfill runs to update the BigQuery destination table partitions with your source table data from the past two days. The automatically triggered backfill runs will either overwrite or incrementally update your BigQuery destination table, depending on whether or not incremental updates are supported in the BigQuery Data Transfer Service connector.

When you run a data transfer for the first time, the data transfer retrieves all source data available within the refresh window. For example, if the refresh window is three days and you run the data transfer for the first time, the BigQuery Data Transfer Service retrieves all source data within three days.

Refresh windows are mapped to the TransferConfig.data_refresh_window_days API field .

To retrieve data outside the refresh window, such as historical data, or to recover data from any transfer outages or gaps, you can initiate or schedule a backfill run .

Limitations

  • The maximum frequency that you can configure a Search Ads 360 data transfer for is once every 24 hours. By default, a transfer starts at the time that you create the transfer. However, you can configure the data transfer start time when you create your transfer .
  • The BigQuery Data Transfer Service does not support incremental data transfers during a Search Ads 360 transfer. When you specify a date for a data transfer, all of the data that is available for that date is transferred.

Before you begin

Before you create a Search Ads 360 data transfer:

Required permissions

Ensure that the user creating the data transfer has the following required permissions:

  • BigQuery Data Transfer Service:

    • bigquery.transfers.update permissions to create the data transfer.
    • Both bigquery.datasets.get and bigquery.datasets.update permissions on the target dataset.

    The bigquery.admin predefined IAM role includes bigquery.transfers.update , bigquery.datasets.update and bigquery.datasets.get permissions. For more information on IAM roles in BigQuery Data Transfer Service, see Access control .

  • Google Cloud:

    • serviceusage.services.use permissions to download data from Search Ads 360 on the project.

    The editor , owner and serviceusage.serviceUsageConsumer predefined IAM roles include serviceusage.services.use permissions. For more information on IAM roles in Service Usage, see Access control reference .

  • Search Ads 360:

Create a Search Ads 360 data transfer

To create a data transfer for Search Ads 360 reporting, you need either your Search Ads 360 Customer ID or manager account . Select one of the following options:

Console

  1. Go to the Data transfers page in the Google Cloud console.

    Go to Data transfers

  2. Click Create transfer.

  3. In the Source typesection, for Source, choose Search Ads 360.

  4. In the Transfer config namesection, for Display name, enter a name for the data transfer such as My Transfer . The transfer name can be any value that lets you identify the transfer if you need to modify it later.

  5. In the Schedule optionssection:

    • For Repeat frequency, choose an option for how often to run the data transfer. If you select Days, provide a valid time in UTC.
    • If applicable, select either Start nowor Start at set time, and provide a start date and run time.
  6. In the Destination settingssection, for Dataset, select the dataset that you created to store your data.

  7. In the Data source detailssection:

    1. For Customer ID, enter your Search Ads 360 customer ID.
    2. Optional: Enter both an Agency IDand Advertiser IDto retrieve ID mapping tables .
    3. Optional: For Custom Floodlight Variables, enter any custom Floodlight variables to include in the data transfer. The custom floodlight variables must be owned by the Search Ads 360 account that is specified by the Customer ID in the transfer config. This parameter takes string inputs in JSON array format and can support multiple custom Floodlight variables. In each item of the JSON array, the following parameters are required:

      • id : the numeric ID of the custom Floodlight variable. This ID is assigned when a custom Floodlight variable is created in Search Ads 360 . If you have specified an id , then a name isn't required.
      • name : the user-defined name of the custom floodlight variables in Search Ads 360. If you have specified a name , then an id isn't required.
      • cfv_field_name : the exact custom Floodlight variable field name based on your use case. The supported values are conversion_custom_metrics , conversion_custom_dimensions , raw_event_conversion_metrics , and raw_event_conversion_dimensions .
      • destination_table_name : a list of BigQuery tables to include the custom floodlight variables in. When the BigQuery Data Transfer Service retrieves data for these tables, the transfer includes the custom Floodlight variables in the query.
      • bigquery_column_name_suffix : the user-defined friendly column name. The BigQuery Data Transfer Service appends the suffix after the standard field name to differentiate different custom Floodlight variables. Depending on the use case, the BigQuery Data Transfer Service generates a BigQuery column name as follows:
      Custom Floodlight variables as metrics and segments Custom Floodlight variables as Raw Event Attributes in the Conversion Resource
      metrics
      metrics_conversion_custom_metrics_ bigquery_column_name_suffix metrics_raw_event_conversion_metrics_ bigquery_column_name_suffix
      dimension
      segments_conversion_custom_dimensions_ bigquery_column_name_suffix segments_raw_event_conversion_dimensions_ bigquery_column_name_suffix

      The following is an example Custom Floodlight Variableentry that specifies two custom Floodlight variables:

       [{ 
       "id" 
      :  
       "1234" 
      , "cfv_field_name" 
      :  
       "raw_event_conversion_metrics" 
      , "destination_table_name" 
      :  
       [ 
       "Conversion" 
       ] 
      , "bigquery_column_name_suffix" 
      :  
       "suffix1" 
       } 
      , { 
       "name" 
      :  
       "example name" 
      , "cfv_field_name" 
      :  
       "conversion_custom_metrics" 
      , "destination_table_name" 
      :  
       [ 
       "AdGroupConversionActionAndDeviceStats" 
      , "CampaignConversionActionAndDeviceStats" 
       ] 
      , "bigquery_column_name_suffix" 
      :  
       "suffix2" 
       }] 
      
    4. Optional: In the Custom Columnsfield, enter any custom columns to include in the data transfer. The custom columns must be owned by the Search Ads 360 account that is specified by the Customer ID in the transfer config. This field takes string inputs in JSON array format and can support multiple columns. In each item of the JSON array, the following parameters are required:

      • id : the numeric ID of the custom column. This ID is assigned when a custom column is created . If you have specified an id , then a name isn't required.
      • name : the user-defined name of the custom column in Search Ads 360. If you have specified a name , then an id isn't required.
      • destination_table_name : a list of BigQuery tables to include the custom column in. When the BigQuery Data Transfer Service retrieves data for these tables, the transfer includes the custom column field in the query.
      • bigquery_column_name : the user-defined friendly column name. This is the field name of the custom column in the destination tables specified in destination_table_name . The column name must follow the format requirements for BigQuery column names and must be unique to other fields in the table's standard schema or other custom columns.

      The following is an example Custom Columnsentry that specifies two custom columns:

       [{ 
        
       "id" 
      :  
       "1234" 
      ,  
       "destination_table_name" 
      :  
       [ 
       "Conversion" 
       ] 
      ,  
       "bigquery_column_name" 
      :  
       "column1" 
       } 
      , { 
        
       "name" 
      :  
       "example name" 
      ,  
       "destination_table_name" 
      :  
       [ 
       "AdGroupStats" 
      , "CampaignStats" 
       ] 
      ,  
       "bigquery_column_name" 
      :  
       "column2" 
       }] 
      
    5. Optional: In the Table Filterfield, enter a comma-separated list of tables to include, for example Campaign, AdGroup . Prefix this list with the - character to exclude certain tables, for example -Campaign, AdGroup . All tables are included by default.

    6. Optional: For Refresh window, enter a value between 1 and 30. If not set, the refresh window defaults to 7 days.

  8. In the Service Accountmenu, select a service account from the service accounts that areassociated with your Google Cloud project. You can associate a service account with your transfer instead of using your user credentials. For more information about using service accounts with data transfers, see Use service accounts .

    If you signed in with a federated identity , then a service account is required to create a transfer. If you signed in with a Google Account , then a service account for the transfer is optional. The service account must have the required permissions .

  9. Optional: In the Notification optionssection:

    • Click the toggle to enable email notifications. When you enable this option, the transfer administrator receives an email notification when a transfer run fails.
    • Click the toggle to enable Pub/Sub notifications. For Select a Cloud Pub/Sub topic, choose your topic name or click Create a topic. This option configures Pub/Sub run notifications for your transfer.
  10. Click Save.

bq

Enter the bq mk command and supply the transfer creation flag — --transfer_config . The following flags are also required:

  • --data_source
  • --target_dataset
  • --display_name
  • --params

The following flags are optional:

  • --project_id : Specifies which project to use. If the flag is not specified, the default project is used.
  • --service_account_name : Specifies a service account to use for Search Ads 360 transfer authentication instead of your user account.
bq  
mk  
 \ 
--transfer_config  
 \ 
--project_id = 
 PROJECT_ID 
  
 \ 
--target_dataset = 
 DATASET 
  
 \ 
--display_name = 
 NAME 
  
 \ 
--data_source = 
 DATA_SOURCE 
  
 \ 
--service_account_name = 
 SERVICE_ACCOUNT_NAME 
  
 \ 
--params = 
 '{ PARAMETERS 
,"custom_columns":"[{\"id\": \" CC_ID 
\",\"destination_table_name\": [\" CC_DESTINATION_TABLE 
\"],\"bigquery_column_name\": \" CC_COLUMN 
\"}]","custom_floodlight_variables":"[{\"id\": \" CFV_ID 
\",\"cfv_field_name\": [\" CFV_FIELD_NAME 
\"],\"destination_table_name\": [\" CFV_DESTINATION_TABLE 
\"],\"bigquery_column_name_suffix\": \" CFV_COLUMN_SUFFIX 
\"}]"}' 

Where:

  • PROJECT_ID (Optional): specifies which project to use. If the flag is not specified, the default project is used.
  • DATASET : the target dataset for the transfer configuration.
  • NAME : the display name for the transfer configuration. The data transfer name can be any value that lets you identify the transfer if you need to modify it later.

  • DATA_SOURCE : the data source — search_ads .

  • SERVICE_ACCOUNT_NAME (Optional): the service account name used to authenticate your data transfer. The service account should be owned by the same project_id used to create the transfer and it should have all of the required permissions .

  • PARAMETERS : the parameters for the created transfer configuration in JSON format. For example: --params='{"param":"param_value"}' . You must supply the customer_id parameter.

    • table_filter : Specifies which tables to include in the data transfer. If the flag is not specified, all tables are included. To include only specific tables, use a comma-separated list of values (for example, Ad, Campaign, AdGroup ). To exclude specific tables, prefix the excluded values with a hyphen ( - ) (for example, using -Ad, Campaign, AdGroup excludes all three values.)
    • custom_columns : specifies custom columns to your reports. This parameter takes string inputs in JSON array format and can support multiple columns. In each item of the JSON array, the following parameters are required:
      • CC_ID : the numeric ID of the custom column. This ID is assigned when a custom column is created .
      • CC_DESTINATION_TABLE : a list of BigQuery tables to include the custom column in. When the BigQuery Data Transfer Service retrieves data for these tables, the data transfer includes the custom column field in the query.
      • CC_COLUMN : the user-defined friendly column name. This is the field name of the custom column in the destination tables specified in destination_table_name . The column name has to follow the format requirements for BigQuery column names and must be unique to other fields in the table's standard schema or other custom columns.
    • custom_floodlight_variables : Specifies custom Floodlight variables in your transfer. This parameter takes string inputs in JSON array format and can support multiple custom Floodlight variables. In each item of the JSON array, the following parameters are required:
      • CFV_ID : the numeric ID of the custom Floodlight variable. This ID is assigned when a custom Floodlight variable is created in Search Ads 360 .
      • CFV_FIELD_NAME : the exact custom Floodlight variable field name based on your use case. The supported values are conversion_custom_metrics , conversion_custom_dimensions , raw_event_conversion_metrics and raw_event_conversion_dimensions . For more information, see Custom Floodlight metrics .
      • CFV_DESTINATION_TABLE : a list of BigQuery tables to include the custom floodlight variables in. When the BigQuery Data Transfer Service retrieves data for these tables, the data transfer includes the custom Floodlight variables in the query.
      • CFV_COLUMN_SUFFIX : the user-defined friendly column name. The BigQuery Data Transfer Service appends the suffix after the standard field name to differentiate different custom Floodlight variables. Depending on the use case, the BigQuery Data Transfer Service generates a BigQuery column name as follows:
    Custom Floodlight variables as metrics and segments Custom Floodlight variables as Raw Event Attributes in the Conversion Resource
    metrics
    metrics_conversion_custom_metrics_ bigquery_column_name_suffix metrics_raw_event_conversion_metrics_ bigquery_column_name_suffix
    dimension
    segments_conversion_custom_dimensions_ bigquery_column_name_suffix segments_raw_event_conversion_dimensions_ bigquery_column_name_suffix

For example, the following command creates a Search Ads 360 data transfer named My Transfer using Customer ID 6828088731 and target dataset mydataset . The transfer also specifies a custom floodlight variable. The data transfer is created in the default project:

bq  
mk  
 \ 
--transfer_config  
 \ 
--target_dataset = 
mydataset  
 \ 
--display_name = 
 'My Transfer' 
  
 \ 
--data_source = 
search_ads  
 \ 
--params = 
 '{"customer_id":"6828088731", "custom_floodlight_variables":"[{\"id\": \"9876\", \"cfv_field_name\": \"raw_event_conversion_metrics\", \"destination_table_name\": [\"Conversion\"],\"bigquery_column_name_suffix\": \"suffix1\" }]"}' 

The first time you run the command, you receive a message like the following:

[URL omitted] Please copy and paste the above URL into your web browser and follow the instructions to retrieve an authentication code.

Follow the instructions in the message and paste the authentication code on the command line.

API

Use the projects.locations.transferConfigs.create method and supply an instance of the TransferConfig resource.

Manually trigger a Search Ads 360 transfer

When you manually trigger a transfer for Search Ads 360, snapshots of match tables are taken once a day and stored in the partition for the last run date. When you trigger a manual transfer, Match Table snapshots for the following tables are not updated:

  • Account
  • Ad
  • AdGroup
  • AdGroupCriterion
  • Any ID mapping table
  • Asset
  • BidStrategy
  • Campaign
  • CampaignCriterion
  • ConversionAction
  • Keyword
  • NegativeAdGroupKeyword
  • NegativeAdGroupCriterion
  • NegativeCampaignKeyword
  • NegativeCampaignCriterion
  • ProductGroup

Performance Max (PMax) campaigns

The Search Ads 360 connector lets you export PMax campaigns data. You must select the Include PMax Campaign Datacheckbox when creating a data transfer , as PMax data is not exported by default.

Including PMax data removes ad_group fields from certain tables and includes new tables. You cannot include ad_group fields because the Search Ads 360 API filters the PMax data.

The following tables exclude ad_group related columns when the Include PMax Campaign Tablescheckbox is selected:

  • CartDataSalesStats
  • ProductAdvertised
  • ProductAdvertisedDeviceStats
  • ProductAdvertisedConversionActionAndDeviceStats

Support for Search Ads 360 manager accounts

Using Search Ads 360 manager accounts provides several benefits over using individual Customer IDs:

  • You don't need to manage multiple data transfers to report on multiple Customer IDs.
  • Cross-customer queries are simpler to write because all Customer IDs are stored in the same table.
  • Using manager accounts alleviates BigQuery Data Transfer Service load quota issues because multiple Customer IDs are loaded in the same job.

For existing customers who have multiple Customer ID-specific Search Ads 360 data transfers, we recommend that you switch to a Search Ads 360 manager account instead. You can do this with the following steps:

  1. Set up a single Search Ads 360 data transfer at the manager or sub-manager account level.
  2. Schedule a backfill.
  3. Disable individual Customer ID-specific Search Ads 360 transfers.

For more information about Search Ads 360 manager accounts, see About manager accounts in the new Search Ads 360 and See how accounts are linked to your manager account .

Example

The following list shows the Customer IDs linked to particular Search Ads 360 manager accounts:

  • 1234567890 — root manager account
    • 1234 — sub-manager account
      • 1111 — Customer ID
      • 2222 — Customer ID
      • 3333 — Customer ID
      • 4444 — Customer ID
      • 567 — sub-manager account
        • 5555 — Customer ID
        • 6666 — Customer ID
        • 7777 — Customer ID
    • 89 — sub-manager account
      • 8888 — Customer ID
      • 9999 — Customer ID
    • 0000 — Customer ID

Each Customer ID is linked to a manager account appears in each report. For more information about the Search Ads 360 reporting structure in BigQuery Data Transfer Service, see Search Ads 360 report transformation .

Transfer configuration for Customer ID 1234567890

A transfer configuration for the root manager account (Customer ID 1234567890) generates data transfer runs that include the following Customer IDs:

  • 1111 (via sub-manager account 1234)
  • 2222 (via sub-manager account 1234)
  • 3333 (via sub-manager account 1234)
  • 4444 (via sub-manager account 1234)
  • 5555 (via sub-manager account 567 and sub-manager account 1234)
  • 6666 (via sub-manager account 567 and sub-manager account 1234)
  • 7777 (via sub-manager account 567 and sub-manager account 1234)
  • 8888 (via sub-manager account 89)
  • 9999 (via sub-manager account 89)
  • 0000 (individual Customer ID)

Transfer configuration for Customer ID 1234

A transfer configuration for sub-manager account 123 (Customer ID 1234) generates data transfer runs that include the following Customer IDs:

  • 1111
  • 2222
  • 3333
  • 4444
  • 5555 (via sub-manager account 567)
  • 6666 (via sub-manager account 567)
  • 7777 (via sub-manager account 567)

Transfer configuration for Customer ID 567

A transfer configuration for sub-manager account 567 (Customer ID 567) generates data transfer runs that include the following Customer IDs:

  • 5555
  • 6666
  • 7777

Transfer configuration for Customer ID 89

A transfer configuration for sub-manager account 89 (Customer ID 89) generates data transfer runs that include the following Customer IDs:

  • 8888
  • 9999

Transfer configuration for Customer ID 0000

A transfer configuration for Customer ID 0000 generates data transfer runs that include only the individual Customer ID:

  • 0000

Query your data

When your data is transferred to BigQuery Data Transfer Service, the data is written to ingestion-time partitioned tables. For more information, see Introduction to partitioned tables .

If you query your tables directly instead of using the auto-generated views, you must use the _PARTITIONTIME pseudocolumn in your query. For more information, see Querying partitioned tables .

Search Ads 360 sample queries

You can use the following Search Ads 360 sample queries to analyze your transferred data. You can also view the queries in a visualization tool such as Looker Studio .

The following queries are examples to get started querying your Search Ads 360 data with BigQuery Data Transfer Service. For additional questions about what you can do with these reports, contact your Search Ads 360 technical representative.

If you query your tables directly instead of using the auto-generated views, you must use the _PARTITIONTIME pseudocolumn in your query. For more information, see Querying partitioned tables .

Campaign performance

The following sample query analyzes Search Ads 360 campaign performance for the past 30 days.

 SELECT 
  
 c 
 . 
 customer_id 
 , 
  
 c 
 . 
 campaign_name 
 , 
  
 c 
 . 
 campaign_status 
 , 
  
 SUM 
 ( 
 cs 
 . 
 metrics_clicks 
 ) 
  
 AS 
  
 Clicks 
 , 
  
 ( 
 SUM 
 ( 
 cs 
 . 
 metrics_cost_micros 
 ) 
  
 / 
  
 1000000 
 ) 
  
 AS 
  
 Cost 
 , 
  
 SUM 
 ( 
 cs 
 . 
 metrics_impressions 
 ) 
  
 AS 
  
 Impressions 
 FROM 
  
 ` DATASET 
.sa_Campaign_ CUSTOMER_ID 
` 
  
 c 
 LEFT 
  
 JOIN 
  
 ` DATASET 
.sa_CampaignStats_ CUSTOMER_ID 
` 
  
 cs 
 ON 
  
 ( 
 c 
 . 
 campaign_id 
  
 = 
  
 cs 
 . 
 campaign_id 
  
 AND 
  
 cs 
 . 
 _DATA_DATE 
  
 BETWEEN 
  
 DATE_ADD 
 ( 
 CURRENT_DATE 
 (), 
  
 INTERVAL 
  
 - 
 31 
  
 DAY 
 ) 
  
 AND 
  
 DATE_ADD 
 ( 
 CURRENT_DATE 
 (), 
  
 INTERVAL 
  
 - 
 1 
  
 DAY 
 )) 
 WHERE 
  
 c 
 . 
 _DATA_DATE 
  
 = 
  
 c 
 . 
 _LATEST_DATE 
 GROUP 
  
 BY 
  
 1 
 , 
  
 2 
 , 
  
 3 
 ORDER 
  
 BY 
  
 Impressions 
  
 DESC 

Replace the following:

  • DATASET : the name of the dataset
  • CUSTOMER_ID : the Search Ads 360 customer ID

Count of keywords

The following sample query analyzes keywords by campaign, ad group, and keyword status.

  
 SELECT 
  
 c 
 . 
 campaign_status 
  
 AS 
  
 CampaignStatus 
 , 
  
 a 
 . 
 ad_group_status 
  
 AS 
  
 AdGroupStatus 
 , 
  
 k 
 . 
 ad_group_criterion_status 
  
 AS 
  
 KeywordStatus 
 , 
  
 k 
 . 
 ad_group_criterion_keyword_match_type 
  
 AS 
  
 KeywordMatchType 
 , 
  
 COUNT 
 ( 
 * 
 ) 
  
 AS 
  
 count 
  
 FROM 
  
 ` DATASET 
.sa_Keyword_ CUSTOMER_ID 
` 
  
 k 
  
 JOIN 
  
 ` DATASET 
.sa_Campaign_ CUSTOMER_ID 
` 
  
 c 
  
 ON 
  
 ( 
 k 
 . 
 campaign_id 
  
 = 
  
 c 
 . 
 campaign_id 
  
 AND 
  
 k 
 . 
 _DATA_DATE 
  
 = 
  
 c 
 . 
 _DATA_DATE 
 ) 
  
 JOIN 
  
 ` DATASET 
.sa_AdGroup_ CUSTOMER_ID 
` 
  
 a 
  
 ON 
  
 ( 
 k 
 . 
 ad_group_id 
  
 = 
  
 a 
 . 
 ad_group_id 
  
 AND 
  
 k 
 . 
 _DATA_DATE 
  
 = 
  
 a 
 . 
 _DATA_DATE 
 ) 
  
 WHERE 
  
 k 
 . 
 _DATA_DATE 
  
 = 
  
 k 
 . 
 _LATEST_DATE 
  
 GROUP 
  
 BY 
  
 1 
 , 
  
 2 
 , 
  
 3 
 , 
  
 4 

Replace the following:

  • DATASET : the name of the dataset
  • CUSTOMER_ID : the Search Ads 360 customer ID

ID mapping tables

Entities in the new Search Ads 360, such as customers, campaigns, and ad groups, have a different ID space than the old Search Ads 360. For existing Search Ads 360 transfer users who want to combine data from the old Search Ads 360 with the new Search Ads 360 API, you can use the BigQuery Data Transfer Service to transfer ID mapping tables if you provide a valid agency ID and advertiser ID in the transfer configuration.

Supported entities contain two columns, legacy_id and new_id , which specifies the ID mapping for entities in old and new versions of Search Ads 360 respectively. For the AD, CAMPAIGN_CRITERION, and CRITERION entities, a new_secondary_id is also provided as these entities don't have globally unique ids in the new Search Ads 360 . The following is a list of ID mapping tables.

  • IdMapping_AD
  • IdMapping_AD_GROUP
  • IdMapping_CAMPAIGN
  • IdMapping_CAMPAIGN_CRITERION
  • IdMapping_CAMPAIGN_GROUP
  • IdMapping_CAMPAIGN_GROUP_PERFORMANCE_TARGET
  • IdMapping_CRITERION
  • IdMapping_CUSTOMER
  • IdMapping_FEED_ITEM
  • IdMapping_FEED_TABLE

Example queries

The following query makes use of ID mapping tables to aggregate per-campaign metrics across tables from previous and new Search Ads 360 data transfers in the new ID space.

 SELECT 
  
 CustomerID 
 , 
  
 CampaignID 
 , 
  
 Sum 
 ( 
 Clicks 
 ), 
  
 Sum 
 ( 
 Cost 
 ) 
  
 FROM 
 ( 
 SELECT 
  
 cs 
 . 
 customer_id 
  
 AS 
  
 CustomerID 
 , 
  
 cs 
 . 
 campaign_id 
  
 AS 
  
 CampaignID 
 , 
  
 cs 
 . 
 metrics_clicks 
  
 AS 
  
 Clicks 
 , 
  
 cs 
 . 
 metrics_cost_micros 
  
 / 
  
 1000000 
  
 AS 
  
 Cost 
 FROM 
  
 ` DATASET 
.sa_CampaignStats_ CUSTOMER_ID 
` 
  
 cs 
 WHERE 
  
 cs 
 . 
 _DATA_DATE 
  
 = 
  
 ' NEW_DATA_DATE 
' 
 UNION 
  
 ALL 
 SELECT 
  
 customer_id_mapping 
 . 
 new_id 
  
 AS 
  
 CustomerID 
 , 
  
 campaign_id_mapping 
 . 
 new_id 
  
 AS 
  
 CampaignID 
 , 
  
 cs 
 . 
 clicks 
  
 AS 
  
 Clicks 
 , 
  
 cs 
 . 
 cost 
  
 AS 
  
 Cost 
 FROM 
  
 ` DATASET 
.CampaignStats_ ADVERTISER_ID 
` 
  
 cs 
 LEFT 
  
 JOIN 
  
 ` DATASET 
.IdMapping_CUSTOMER_ ADVERTISER_ID 
` 
  
 customer_id_mapping 
 ON 
  
 cs 
 . 
 accountId 
  
 = 
  
 customer_id_mapping 
 . 
 legacy_id 
 LEFT 
  
 JOIN 
  
 ` DATASET 
.IdMapping_CAMPAIGN_ ADVERTISER_ID 
` 
  
 campaign_id_mapping 
 ON 
  
 cs 
 . 
 campaignId 
  
 = 
  
 campaign_id_mapping 
 . 
 legacy_id 
 WHERE 
  
 cs 
 . 
 _DATA_DATE 
  
 = 
  
 ' OLD_DATA_DATE 
' 
 ) 
 GROUP 
  
 BY 
 1 
 , 
  
 2 
 ORDER 
  
 BY 
 1 
 , 
  
 2 

Replace the following:

  • DATASET : the name of the dataset
  • CUSTOMER_ID : the Search Ads 360 customer ID
  • ADVERTISER_ID : the Search Ads 360 advertiser ID
  • NEW_DATA_DATE : the data date for the new Search Ads 360 table
  • OLD_DATA_DATE : the data date for the previous Search Ads 360 table

The following query makes use of ID mapping tables to aggregate per-campaign metrics across tables from previous and new Search Ads 360 data transfers in the old ID space.

 SELECT 
  
 CustomerID 
 , 
  
 CampaignID 
 , 
  
 Sum 
 ( 
 Clicks 
 ), 
  
 Sum 
 ( 
 Cost 
 ) 
  
 FROM 
 ( 
 SELECT 
  
 customer_id_mapping 
 . 
 legacy_id 
  
 AS 
  
 CustomerID 
 , 
  
 campaign_id_mapping 
 . 
 legacy_id 
  
 AS 
  
 CampaignID 
 , 
  
 cs 
 . 
 metrics_clicks 
  
 AS 
  
 Clicks 
 , 
  
 cs 
 . 
 metrics_cost_micros 
  
 / 
  
 1000000 
  
 AS 
  
 Cost 
 FROM 
  
 ` DATASET 
.sa_CampaignStats_ CUSTOMER_ID 
` 
  
 cs 
 LEFT 
  
 JOIN 
  
 ` DATASET 
.IdMapping_CUSTOMER_ ADVERTISER_ID 
` 
  
 customer_id_mapping 
 ON 
  
 cs 
 . 
 customer_id 
  
 = 
  
 customer_id_mapping 
 . 
 new_id 
 LEFT 
  
 JOIN 
  
 ` DATASET 
.IdMapping_CAMPAIGN_ ADVERTISER_ID 
` 
  
 campaign_id_mapping 
 ON 
  
 cs 
 . 
 campaign_id 
  
 = 
  
 campaign_id_mapping 
 . 
 new_id 
 WHERE 
  
 cs 
 . 
 _DATA_DATE 
  
 = 
  
 ' NEW_DATA_DATE 
' 
 UNION 
  
 ALL 
 SELECT 
  
 CAST 
 ( 
 accountId 
  
 AS 
  
 INT 
 ) 
  
 AS 
  
 CustomerID 
 , 
  
 CAST 
 ( 
 campaignId 
  
 AS 
  
 INT 
 ) 
  
 AS 
  
 CampaignID 
 , 
  
 cs 
 . 
 clicks 
  
 AS 
  
 Clicks 
 , 
  
 cs 
 . 
 cost 
  
 AS 
  
 Cost 
 FROM 
  
 ` DATASET 
.CampaignStats_ ADVERTISER_ID 
` 
  
 cs 
 WHERE 
  
 cs 
 . 
 _DATA_DATE 
  
 = 
  
 ' OLD_DATA_DATE 
' 
 ) 
 GROUP 
  
 BY 
 1 
 , 
  
 2 
 ORDER 
  
 BY 
 1 
 , 
  
 2 

Replace the following:

  • DATASET : the name of the dataset
  • CUSTOMER_ID : the Search Ads 360 customer ID
  • ADVERTISER_ID : the Search Ads 360 advertiser ID
  • NEW_DATA_DATE : the data date for the new Search Ads 360 table
  • OLD_DATA_DATE : the data date for the previous Search Ads 360 table

Potential quota issues

The Search Ads 360 reporting API assigns a quota for the number of requests that the Google project can send. If you are using one project for the BigQuery Data Transfer Service and other services, all services share the same quota and can potentially reach the quota limit in any service.

To prevent this potential issue without affecting existing workflows, consider these options:

  • Use the table_filter parameter to load only the tables that are needed.
  • Set up a separate project for the BigQuery Data Transfer Service. A cross project table join might look like the following:

      
     #standardSQL 
      
     select 
      
     count 
     ( 
     a 
     . 
     item1 
     ) 
      
     from 
      
     ( 
     select 
      
     item1 
     , 
      
     item2 
      
     from 
      
      project 
     - 
     A 
     . 
     data_set_a 
     . 
     table_name_a 
     
     ) 
      
     a 
      
     inner 
      
     join 
      
     ( 
     select 
      
     item3 
     , 
      
     item4 
      
     from 
      
      project 
     - 
     B 
     . 
     data_set_b 
     . 
     table_name_b 
     
     ) 
      
     b 
      
     on 
      
     a 
     . 
     item1 
      
     = 
      
     b 
     . 
     item3 
    
  • Contact Search Ads 360 support and request additional quota.

Create a Mobile Website
View Site in Mobile | Classic
Share by: