Retrieving monthly spend by campaign using the Invoice Service

190 views
Skip to first unread message

Romar Roldan

unread,
Dec 22, 2019, 7:06:32 PM12/22/19
to AdWords API and Google Ads API Forum
Hi,

The Invoice Service API (https://developers.google.com/google-ads/api/docs/billing/invoice-service#retrieving_invoices) suggests that monthly spend can be retrieved by account budget. We would like to be able to retrieve monthly spends by campaign in order to track campaign spends but the Invoice Service API documentation does not seem to provide this level of detail. 

Is it possible to get the monthly spend per campaign in the API since the monthly PDF invoice sent by Google has the spend breakdown by campaign?

Cheers,
Romar

Google Ads API Forum Advisor Prod

unread,
Dec 23, 2019, 3:14:36 PM12/23/19
to romar....@adslot.com, adwor...@googlegroups.com

Hi Romar,

Thank you for reaching out. The InvoiceService.ListInvoices() does not support the monthly spend retrieval on the campaign level. The alternative way to do it is to query the metrics.cost_micros field from the campaign resource and set the date range to be a monthly range. Please let me know if you have any further questions.

Thanks and regards,
Xiaoming, Google Ads API Team

 


 

ref:_00D1U1174p._5001UOF5Us:ref

Avinash Bhatt

unread,
Sep 22, 2023, 4:52:56 AM9/22/23
to Google Ads API and AdWords API Forum
hi,
This is Avinash, we are also trying to do the same, can you please elaborate on how we can get metrics.cost_micros connected to the campaign as I tried to get data from the following 
SELECT campaign.name,segments.geo_target_state,metrics.cost_micros FROM geographic_view WHERE campaign.name = 'xxxx' AND segments.date BETWEEN 20230601 AND 20230630"
i get the data but it does not match the bill



Google Ads API Forum Advisor

unread,
Sep 27, 2023, 5:02:10 AM9/27/23
to avina....@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for getting back to us.

By reviewing your query, I understand that you want to retrieve metrics.cost_micros connected to a campaign. Please refer to this campaign report for more information. Kindly refer to the sample query below to get the metrics.cost_micros using the campaign :

  SELECT
  campaign.name,
  campaign.status,
  segments.device,
  metrics.impressions,
  metrics.clicks,
  metrics.ctr,
  metrics.average_cpc,
  metrics.cost_micros
  FROM campaign
  WHERE  campaign.name='xxxx' AND 
  segments.date BETWEEN '20230601' AND '20230630'
  ORDER BY metrics.cost_micros DESC

Also, you can use Query Builder to create your query and Query Validator to validate your query. 

Let us know how this goes on your end.

 
This message is in relation to case "ref:_00D1U1174p._5001UOF5Us:ref"

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages