Write your first query

This guide shows how to test and run a query that measures your total Campaign Manager Data Transfer impressions.

Write your query

  1. Open Ads Data Hub.
  2. Click the My Queries tab.
  3. Click + Create New Query to open the query editor.
  4. In the query editor:

    1. Give your query a name. (Note: this can't be changed after saving your query).
    2. Paste in the following query:
    SELECT
      COUNT(*) AS impressions
    FROM adh.cm_dt_impressions
    ;
    
  5. Save your query.

Test your query using the sandbox

  1. Navigate to the My Jobs tab.
  2. Select Analysis from the Query type dropdown.
  3. Select the query you wrote earlier in the Query name dropdown.
  4. Select ADH Sandbox Customer from the Ads data from dropdown.
  5. Select the table where your query results should be saved.
  6. Enter start and end dates to determine the date range of your query.
  7. Click Start.

After the query finishes running, open the results in BigQuery. You should see a table that looks something like this:

Row impressions
1 388204742

Once you're satisfied with the results of your test query, you're ready to run it on real data.

Run your query in Ads Data Hub

After testing your query using the sandbox role, you're ready to run it on real data.

  1. Navigate to the My Jobs tab.
  2. Select the query type.
  3. Select the query to run.
  4. Select Default from the Ads data from dropdown.
  5. Select the table where your query results should be saved.
  6. Enter start and end dates to determine the date range of your query.
  7. Click Start.