Unable to Replicate Table in UI Reporting Tool With API Query

66 views
Skip to first unread message

Tanner johnson

unread,
Mar 25, 2021, 2:54:57 PM3/25/21
to AdWords API and Google Ads API Forum
I'm running the following query in an attempt to replicate a report I created in the UI with these same columns:

"""
SELECT
    campaign.name,
    segments.device,
    ad_group_criterion.criterion_id,
    ad_group_criterion.keyword.text,
    ad_group_criterion.position_estimates.first_page_cpc_micros,
    ad_group_criterion.position_estimates.top_of_page_cpc_micros,
    ad_group_criterion.position_estimates.first_position_cpc_micros,
    metrics.average_cpc,
    metrics.clicks,
    metrics.conversions
FROM
    keyword_view
WHERE
    segments.date DURING LAST_30_DAYS
    AND ad_group_criterion.status = 'ENABLED'
    AND ad_group_criterion.negative = 'False'
"""

Again, the target report in the UI has these same columns and includes filters for "Search keyword status is Eligible" and the past 30 days. Since the API queries only return device types for Mobile, Tablet, and Desktop, I also filtered the UI report's device column accordingly. Both are pulling data from the same Account ID. 

I can get the row counts for both tables to match exactly if I:

1. Remove the segments.device column from each report.
2. Remove the "Search Keyword Status" filter ("Enabled") from the UI report. For some reason the "WHERE ad_group_criterion.status = 'Enabled' clause in my query doesn't seem to do anything. Are Search Keyword Status and ad_group_criterion.status referring to different things?

The row counts cease to match when I add the device column back (along with the status filter). Also, for some reason the API query returns a different number of rows when I change the segments.date filter, but the UI returns the same number of rows no matter what I put in the date range filter. This only happens when the segments.device column is present.

How can I make these reports match? And what is happening on the backend that produces the differences between these reports?

Regards,
Tanner

Google Ads API Forum Advisor Prod

unread,
Mar 26, 2021, 5:57:11 AM3/26/21
to t.jo...@extraspace.com, adwor...@googlegroups.com
Hi Tanner,

Thank you for posting your concern.

Allow me to provide the my insights to the scenarios that you've mentioned:

"1. Remove the segments.device column from each report."
- Let me discussed first this document that zero impressions are always excluded when segmenting a report. With this, removing the segment fields in the API report will returned all the values just like in the UI so data be the same.


2. Remove the "Search Keyword Status" filter ("Enabled") from the UI report. For some reason the "WHERE ad_group_criterion.status = 'Enabled' clause in my query doesn't seem to do anything. Are Search Keyword Status and ad_group_criterion.status referring to different things?
-To take a closer look, could you provide the following details via Reply privately to author option?
  • Customer ID
  • Complete request and response logs with request ID generated on your end
  • Screenshot of the whole UI
  • Sample comparison of the 2

"The row counts cease to match when I add the device column back (along with the status filter). Also, for some reason the API query returns a different number of rows when I change the segments.date filter, but the UI returns the same number of rows no matter what I put in the date range filter. This only happens when the segments.device column is present."
-Please refer to #1 which explains why lesser rows are returned when including segment fields.

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5004Q2EnGSz:ref
Reply all
Reply to author
Forward
0 new messages