Query for each day

55 views
Skip to first unread message

Alexandr Borisenko

unread,
Mar 3, 2021, 6:48:24 PM3/3/21
to AdWords API and Google Ads API Forum
Hi
I want to get metrics by company for the last week, and for each separately. To do this, I made the following query: 

SELECT
  campaign.id,
  campaign.name,
  status,
  segments.date
FROM campaign
WHERE segments.date DURING LAST_7_DAYS

 But nothing comes back to me at all. (I do all this on test accounts) Why is this happening and how can I fix it? 
If the metrics do not come due to the fact that they are empty, can I just get these zeros?

Kind regards,
Alexandr.

Google Ads API Forum Advisor Prod

unread,
Mar 4, 2021, 11:22:31 AM3/4/21
to nickna...@gmail.com, adwor...@googlegroups.com
Hi Alexandr,

Test accounts will not contain any impressions and unfortunately, whenever segments are used in a report, rows with zero impressions will not return. 

Regards,
Anthony

Google Logo
Anthony
Google Ads API Team
 


ref:_00D1U1174p._5004Q2DKxkK:ref

Alexandr Borisenko

unread,
Mar 4, 2021, 12:48:39 PM3/4/21
to AdWords API and Google Ads API Forum
Got it, thank you very much.
I also ran into the following situation: I make a request like this 

query = """
SELECT
campaign.name,
campaign.status,
campaign.manual_cpm,
campaign.manual_cpv,
metrics.impressions,
metrics.clicks,
metrics.ctr,
metrics.average_cpc,
metrics.cost_micros
FROM campaign
WHERE segments.date = '2021-03-03'"""

And in response I get this 

{'results': [{'campaign': {'resourceName': 'customers/3653719092/campaigns/12448062856', 'status': 'ENABLED', 'name': 'Display-1'}, 'metrics': {'clicks': '0', 'costMicros': '0', 'impressi
ons': '0'}}, {'campaign': {'resourceName': 'customers/3653719092/campaigns/12463863982', 'status': 'ENABLED', 'name': 'NewCampaign'}, 'metrics': {'clicks': '0', 'costMicros': '0', 'impres
sions': '0'}}], 'fieldMask':'campaign.name,campaign.status,campaign.manualCpm,campaign.manualCpv,metrics.impressions,metrics.clicks,metrics.ctr,metrics.averageCpc,metrics.costMicros'}

Here, as you can see, some metrics come, but some do not, although those that come are filled with zeros. Why then don't the rest of the metrics come through?
And another question, what is the difference between the metrics that I request, starting with the campaign.~ and the metric.~ ?

четверг, 4 марта 2021 г. в 18:22:31 UTC+2, adsapiforumadvisor:

Google Ads API Forum Advisor Prod

unread,
Mar 5, 2021, 11:28:44 AM3/5/21
to nickna...@gmail.com, adwor...@googlegroups.com
Hi Alexandr,

Glad to help. I will need to take a closer look at this to see why only some metrics are being returned. Can you reply with your request-id?

Thanks,
Reply all
Reply to author
Forward
0 new messages