Google Ads transfers

The BigQuery Data Transfer Service for Google Ads (formerly known as Google AdWords) allows you to automatically schedule and manage recurring load jobs for Google Ads reporting data.

Supported Reports

The BigQuery Data Transfer Service for Google Ads currently supports the following reporting options:

For information on how Google Ads reports are transformed into BigQuery Data Transfer Service tables and views, see Google Ads report transformations.

To map Google Ads reports to what you see in the Google Ads UI, see Mapping reports to the Google Ads UI.

Reporting option Support
Supported API version

v201809

For information on Google Ads API (AdWords API) migration, see Migration Guide (v201809).

Schedule

Daily, at the time the Transfer is first created (default)

You can configure the time of day.

Refresh window

Last 7 days (default)

Configurable up to 30 days

Snapshots of Match Tables are taken once a day and stored in the partition for the latest run date. Match Table snapshots are NOT updated for backfills or for days loaded via the refresh window. For information on which Match Tables are not updated by the refresh window, see Set up a backfill.

Maximum backfill duration

No limit

While Google Ads has no known data retention limits, the BigQuery Data Transfer Service has limits on how many days can be requested in a single backfill. For information on backfills, see Set up a backfill.

Number of Customer IDs per manager account

1,000

The BigQuery Data Transfer Service supports a maximum of 1000 Customer IDs per Google Ads manager account (MCC).

Before you begin

Before you create a Google Ads transfer:

  • Verify that you have completed all actions required to enable the BigQuery Data Transfer Service.
  • Create a BigQuery Data Transfer Service dataset to store the Google Ads data.
  • If you intend to create transfers using the classic BigQuery web UI, allow pop-ups from bigquery.cloud.google.com so you can view the permissions window. You must allow the BigQuery Data Transfer Service permission to manage your Google Ads campaigns for the transfer to succeed.
  • If you intend to setup transfer run notifications for Cloud Pub/Sub, you must have pubsub.topics.setIamPolicy permissions. Cloud Pub/Sub permissions are not required if you just set up email notifications. For more information, see BigQuery Data Transfer Service run notifications.

Required permissions

Ensure that the person creating the transfer has the following required permissions:

  • BigQuery Data Transfer Service:

    • bigquery.transfers.update permissions to create the transfer
    • bigquery.datasets.update permissions on the target dataset

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

  • Google Ads: Read access to the Google Ads Customer ID or manager account (MCC) that is used in the transfer configuration.

Setting up a Google Ads data transfer

Setting up a data transfer for Google Ads reporting requires a:

  • Customer ID: Your Google Ads Customer ID or manager account (MCC) as issued by Google Ads. For information on retrieving your Google Ads Customer ID, see Find your Customer ID.

To create a data transfer for Google Ads reporting:

Console

  1. Go to the GCP Console.

    Go to the GCP Console

  2. Click Transfers.

  3. Click Create Transfer.

  4. On the Create Transfer page:

    • In the Source type section, for Source, choose Google Ads.

      Transfer source

    • In the Transfer config name section, for Display name, enter a name for the transfer such as My Transfer. The transfer name can be any value that allows you to easily identify the transfer if you need to modify it later.

      Transfer name

    • In the Schedule options section, for Schedule, leave the default value (Start now) or click Start at a set time.

      • For Repeats, choose an option for how often to run the transfer.

        • Daily (default)
        • Weekly
        • Monthly
        • Custom
        • On-demand
      • For Start date and run time, enter the date and time to start the transfer. If you choose Start now, this option is disabled.

        Transfer schedule

    • In the Destination settings section, for Destination dataset, choose the dataset you created to store your data.

      Transfer dataset

    • In the Data source details section:

      • For Customer ID, enter your Customer ID or manager account.
      • Check Exclude removed/disabled Items to prevent removed or disabled entities and metrics from being transferred.

        Google Ads source details

    • (Optional) In the Notification options section:

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

Classic UI

  1. Go to the classic BigQuery web UI.

    Go to the classic BigQuery web UI

  2. Click Transfers.

  3. Click Add Transfer.

  4. On the New Transfer page:

    • For Source, choose Google Ads (formerly AdWords).
    • For Display name, enter a name for the transfer such as My Transfer. The transfer name can be any value that allows you to easily identify the transfer if you need to modify it later.
    • For Refresh window, enter the number of days to include in the data transfer. If you enter 1, there is no daily backfill. Entering 0 configures the default refresh window of 7 days. The maximum value is
      1. For more information, see Determining your data's freshness.
    • For Schedule, leave the default value (every 24 hours at transfer creation time) or click Edit and change the time.

      Google Ads schedule

    • For Destination dataset, choose the dataset you created to store your Google Ads data.

    • For Customer ID, enter your Customer ID or manager account.

    • Check Exclude removed/disabled Items to prevent removed or disabled entities and metrics from being transferred.

      Google Ads transfer

    • (Optional) Expand the Advanced section and configure run notifications for your transfer.

      • For Cloud Pub/Sub topic, enter your topic name, for example, projects/myproject/topics/mytopic.
      • Check Send email notifications to allow email notifications of transfer run failures.
      • Don't check Disabled when setting up a transfer. See Working with transfers to disable existing transfers.

        Cloud Pub/Sub topic

  5. Click Add.

  6. When prompted, click Allow to give the BigQuery Data Transfer Service permission to manage your Google Ads reporting data and to access and manage the data in BigQuery Data Transfer Service. You must allow pop-ups from bigquery.cloud.google.com to view the permissions window.

    Allow transfer

CLI

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

You can also supply the --project_id flag to specify a particular project. If --project_id isn't specified, the default project is used.

bq mk \
--transfer_config \
--project_id=project_id \
--target_dataset=dataset \
--display_name=name \
--params='parameters' \
--data_source=data_source

Where:

  • project_id is your project ID.
  • dataset is the target dataset for the transfer configuration.
  • name is the display name for the transfer configuration. The transfer name can be any value that allows you to easily identify the transfer if you need to modify it later.
  • parameters contains the parameters for the created transfer configuration in JSON format. For example: --params='{"param":"param_value"}'. For Google Ads, you must supply the customer_id parameter. You may optionally set the exclude_removed_items parameter to true to prevent removed or disabled entities and metrics from being transferred.
  • data_source is the data source — adwords.

For example, the following command creates a Google Ads transfer named My Transfer using Customer ID 123-123-1234 and target dataset mydataset. The transfer is created in the default project:

bq mk \
--transfer_config \
--target_dataset=mydataset \
--display_name='My Transfer' \
--params='{"customer_id":"123-123-1234","exclude_removed_items":"true"}' \
--data_source=adwords

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.

Support for Google Ads manager accounts

Existing customers who have multiple Customer ID-specific Google Ads Transfers are encouraged to set up a single Google Ads Transfer at the Manager Account (MCC) level, schedule a backfill, and disable individual Customer ID-specific Google Ads Transfers.

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

  • You no longer need to manage multiple transfers to report on multiple Customer IDs.
  • Cross-customer queries are much simpler to write because all the Customer IDs are stored in the same table.
  • Using MCCs alleviates BigQuery Data Transfer Service load quota issues because multiple Customer IDs are loaded in the same job.

For more information on Google Ads manager accounts (MCCs), see Working with managed accounts and About linking accounts to your manager account.

Example

The following list shows the Customer IDs linked to particular Google Ads 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 linked to a manager account appears in each report. For more information on the Google Ads reporting structure in BigQuery Data Transfer Service, see Google Ads report transformation.

Transfer configuration for Customer ID 1234567890

A transfer configuration for the root manager account (Customer ID 1234567890) would generate 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) would generate 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) would generate 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) would generate transfer runs that include the following Customer IDs:

  • 8888
  • 9999

Transfer configuration for Customer ID 0000

A transfer configuration for Customer ID 0000 would generate transfer runs that include only the individual Customer ID:

  • 0000

Migrating Google Ads data to MCCs

To migrate your existing Google Ads data in BigQuery Data Transfer Service to the MCC structure, you can set up a backfill to add your existing data to the tables created by the transfer configuration linked to the manager account. Note that when you schedule a backfill, match tables are not updated.

Troubleshooting Google Ads transfer setup

If you are having issues setting up your transfer, see Google Ads transfer issues in Troubleshooting BigQuery Data Transfer Service transfer setup.

Querying 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 pseudo-column in your query. For more information, see Querying partitioned tables.

You can use the following Google Ads sample queries to analyze your transferred data. You can also use the queries in a visualization tool such as Google Data Studio. These queries are provided to help you get started on querying your Google Ads data with BigQuery Data Transfer Service. For additional questions on what you can do with these reports, contact your Google Ads technical representative.

In each of the following queries, replace dataset with your dataset name. Replace customer_id with your Google Ads Customer ID.

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

Campaign performance

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

Console

SELECT
  c.ExternalCustomerId,
  c.CampaignName,
  c.CampaignStatus,
  SUM(cs.Impressions) AS Impressions,
  SUM(cs.Interactions) AS Interactions,
  (SUM(cs.Cost) / 1000000) AS Cost
FROM
  `dataset.Campaign_customer_id` c
LEFT JOIN
  `dataset.CampaignBasicStats_customer_id` cs
ON
  (c.CampaignId = cs.CampaignId
   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

CLI

bq query --use_legacy_sql=false '
SELECT
  c.ExternalCustomerId,
  c.CampaignName,
  c.CampaignStatus,
  SUM(cs.Impressions) AS Impressions,
  SUM(cs.Interactions) AS Interactions,
  (SUM(cs.Cost) / 1000000) AS Cost
FROM
  `dataset.Campaign_customer_id` c
LEFT JOIN
  `dataset.CampaignBasicStats_customer_id` cs
ON
  (c.CampaignId = cs.CampaignId
   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'

Count of keywords

The following sample query analyzes keywords by campaign, ad group, and keyword status. This query uses the KeywordMatchType function. Keyword match types help control which searches can trigger your ad. For more information on keyword matching options, see About keyword matching options.

Console

SELECT
  c.CampaignStatus AS CampaignStatus,
  a.AdGroupStatus AS AdGroupStatus,
  k.Status AS KeywordStatus,
  k.KeywordMatchType AS KeywordMatchType,
  COUNT(*) AS count
FROM
  `dataset.Keyword_customer_id` k
  JOIN
  `dataset.Campaign_customer_id` c
ON
  (k.CampaignId = c.CampaignId AND k._DATA_DATE = c._DATA_DATE)
JOIN
  `dataset.AdGroupcustomer_id` a
ON
  (k.AdGroupId = a.AdGroupId AND k._DATA_DATE = a._DATA_DATE)
WHERE
  k._DATA_DATE = k._LATEST_DATE
GROUP BY
  1, 2, 3, 4

CLI

bq query --use_legacy_sql=false '
SELECT
  c.CampaignStatus AS CampaignStatus,
  a.AdGroupStatus AS AdGroupStatus,
  k.Status AS KeywordStatus,
  k.KeywordMatchType AS KeywordMatchType,
  COUNT(*) AS count
FROM
  `dataset.Keyword_customer_id` k
JOIN
  `dataset.Campaign_customer_id` c
ON
  (k.CampaignId = c.CampaignId AND k._DATA_DATE = c._DATA_DATE)
JOIN
  `dataset.AdGroup_customer_id` a
ON
  (k.AdGroupId = a.AdGroupId AND k._DATA_DATE = a._DATA_DATE)
WHERE
  k._DATA_DATE = k._LATEST_DATE
GROUP BY
  1, 2, 3, 4'
หน้านี้มีประโยชน์ไหม โปรดแสดงความคิดเห็น