Collecting data from Google Ads

This guide explains how to collect data from Google Ads. To learn how to collect data from a different data source, go back to the Available data sources in Adverity overview.

Introduction

For a list of the fields that you can collect from Google Ads, see Google Ads.

The Google Ads connector is an improved solution to the Google Ads (Deprecated) connector. If you use the Google Ads (Deprecated) connector instead of Google Ads, consider upgrading to the new connector described in this guide. For more information, see the Google documentation.

Prerequisites

Before you start collecting data from Google Ads, perform all of the following actions:

  • Ensure that the account you use to connect to Google Ads has Read only or higher permissions. For more information, see the Google Ads documentation.

  • To collect invoice data, activate monthly invoicing in your Google Ads account. For more information, see the Google documentation.

Creating a datastream to collect data from Google Ads

The basics of creating a datastream to collect data from any data source are explained in our guide to Creating a datastream. This guide contains information about the specific steps to create a datastream to fetch data from Google Ads.

Authorization: Allow Adverity to access Google Ads

  1. If you choose Access using your credentials or Access using someone else's credentials, in Set up or edit Customers, you or the person granting access must choose one of the following options:

    • Choose Grant access to all items, including those created in the future to give Adverity Customers to access all existing items and all items created in the future.

    • Choose Select specific items to which you want to grant access to only give Adverity Customers to access the selected items. Adverity will not automatically have access to items created in the future. You will need to grant Adverity access to any items created in the future.

    If you use your credentials to grant Adverity access to Google Ads, all the items available to you using your credentials will be visible in the Authorizations page to all Adverity users with permission to edit this authorization.

    If someone else uses their credentials to grant Adverity access to Google Ads, the same applies to the items available using their credentials.

    This is important to consider if you do not want all Adverity users with permission to edit the authorization to be able to see the details of the authorization items. For more information about user permissions, see Managing user permissions.

Configuration: Choose the data you want to collect from Google Ads

To choose what data to collect and customize the Google Ads datastream configuration, follow these steps:

  1. (Optional) Rename your datastream.

  1. In MCCs, Customers, and Campaigns, select the My Client Centers accounts (MCCs), customers, and campaigns for which to collect data. If you do not select any items in a drop-down list, Adverity collects data for all items in the drop-down list.

  1. In Report type, select the type of data to collect from Google Ads. The selected report type determines the additional fields to populate.

  1. In Billing Setups, select the billing setups for which to collect data. If you do not select any billing setups in a drop-down list, Adverity collects data for all items in the drop-down list.

    This field is visible if you select Invoice in Report type. The items selected in the MCCs and Customers fields determine which billing setups you can select.

  2. In Segments, select the categories that Adverity uses to divide and group your data. You can only select one of the following date segments: Day, Week, Month, Quarter. The selected date segment determines the date range you can choose later when you fetch data. For more information, see Selecting the date range for a fetch.

  1. In Metrics and Attributes, change the list of fields that you want to see in your data extract.

    Google Ads considers some metrics to be attributes. If you cannot see a specific metric in the Metrics drop-down list, look in the Attributes drop-down list.

  1. In Resource level, select a level in the hierarchy of Google Ads resources. Adverity generates a report for this level. For more information, see the Google documentation.

What's next?

Troubleshooting Google Ads

I see an error message when fetching data from Google Ads

The Customer with ID [ID] has a policy to enforce 2-Step Verification, but the user is not enrolled error message appears when the user who has authorized the connection to Google Ads requires two-factor authentication.

To resolve this issue, the user who authorized the connection must log in to Google Ads and activate two-factor authentication for their account and any sub-accounts.

Accounts are missing from the data I have fetched from Google Ads

Adverity synchronizes accounts daily around midnight UTC. This sycnhronization has lower priority than manual and scheduled fetches. As a result, if you perform or schedule a high number of fetches, accounts will not be synchronized until after these fetches are complete. Additionally, if you add an account after the daily synchronization and then fetch data, the newly added account will not appear in the data. It will only be included after the next synchronization.

To resolve this issue, manually synchronize the metadata for the authorization you are using to fetch data. For more information, see Synchronizing metadata.

Customer statuses are missing in the authorization Customers

In the authorization Customers for Google Ads, customers have the status Active or Inactive. If a customer's status is missing, this is due to Google Ads's configuration and cannot be changed.

Advanced Google Ads tips

Selecting the date range for a fetch

The selected date segment determines the date range you can choose for a data fetch. Because of the requirements of the Google Ads API, the date range needs to start and end on the first day of the selected date segment. Adverity automatically changes the date range of the fetch to be compatible with this requirement. For example, if you select a custom date range of 15 March - 15 April with a monthly date segment, Adverity modifies the time range to 1 March - 1 April, and collects data for the months of March and April. To collect data for the month of March only, select a date range of 1 March - 1 March.

Calculating impression share and related metrics

The Google Ads connector returns some metrics as percentages (including impression share). Percentages cannot be aggregated or combined. However, data returned as percentages can be further processed to make them ready for aggregation. For more information, see the Google documentation.

This section enables you to calculate potential impressions from the impression share metric. You can then send potential impressions to Explore & Present or load them into destinations and use this metric to calculate impression share percentages for any combination of dimensions.

Prerequisites

  • Make sure that your data extract contains the following fields:

    • Impressions

    • Search impression share

    • Search lost impression share (budget)

    • Search lost impression share (rank)

Procedure

To calculate potential impressions from the impression share metric, follow these steps:

  1. Go to the Datastreams page.

  2. Open the Google Ads datastream by clicking on its name.

  1. In the Enrichments section, click + Assign enrichment.

  2. Click Create new enrichment.

  1. Click Custom Script.

  2. Click Source.

  3. In the Edit Source Code window, replace the original code with the following:

    [
        [
            "extendmissing",
            {
                "subtable": null,
                "fieldnames": [
                    "Search lost impression share (rank)",
                    "Search lost impression share (budget)"
                ],
                "missing": "0.0",
                "_comment": null
            }
        ],
        [
            "convertnumbers",
            {
                "fields": [
                    "Impressions",
                    "Search impression share",
                    "Search lost impression share (rank)",
                    "Search lost impression share (budget)"
                ],
                "default": 0,
                "strict": false,
                "subtable": null,
                "locale": "en",
                "_comment": null
            }
        ],
        [
            "addfieldx",
            {
                "index": null,
                "subtable": null,
                "field": "Potential impressions",
                "expression": "round({Impressions} / {Search impression share}) if {Search impression share} > 0 else '0'",
                "_comment": null
            }
            ],
            [
                "addfieldx",
                {
                    "index": null,
                    "subtable": null,
                    "field": "Lost impressions (budget)",
                    "expression": "round({Potential impressions}*{Search lost impression share (budget)}) if {Search lost impression share (budget)} > 0 else '0'",
                    "_comment": null
                }
            ],
            [
                "addfieldx",
                {
                    "index": null,
                    "subtable": null,
                    "field": "Lost impressions (rank)",
                    "expression": "round({Potential impressions}*{Search lost impression share (rank)}) if {Search lost impression share (rank)} > 0 else '0'",
                    "_comment": null
                }
        ]
    ]
  4. Click Next and then click Create +.

  5. Fetch data for the datastream.

  6. In the top navigation panel, click Data Mapping.

  7. In the Source Fields column, find Potential impressions.

  8. Click the cell in the Target Fields column within the source row, type in potential_impressions and click + Create new.

  9. In the Type field, select Float.

  10. In Measure, select Sum.

  11. Click Create.

  12. Repeat the same procedure described in steps 11 to 15 for the following metrics:

    • Lost impressions (rank)

    • Lost impressions (budget)

    The Data Mapping changes are saved automatically.

  13. Fetch data for the datastream.

You can now load the Potential impressions, Lost impressions (rank) and Lost impressions (budget) metrics into any destination.

To visualize Potential impressions in Adverity's Explore & Present, follow the procedure described in Visualizing potential impressions.