How can I get cost(spend) per campaign through AdWords Java API?

3,464 views
Skip to first unread message

Pillow Ahn

unread,
Jul 11, 2017, 5:48:07 AM7/11/17
to AdWords API Forum

I have to get cost(spend) per campaign through AdWords Java API.

I used CampaignServiceInterface, BudgetServiceInterface, BudgetOrderService with Selector.

But there is no cost(spend).

How can I do?

Shwetha Vastrad (AdWords API Team)

unread,
Jul 11, 2017, 11:10:38 AM7/11/17
to AdWords API Forum
Hi, 

You need to use AdWords API reports to get the performance statistics associated with your AdWords account. You need to download a Campaign Performance Report to get statistics aggregated at the campaign level. You need to include "Cost" in the report query to get the cost associated with your campaigns in the response. The DownloadCriteriaReportWithAwql Java example shows how to download a Criteria Performance Report. You can use this example as a reference to download different report types. Example code in other languages is provided here. The reporting guide provides more details on using AdWords API to download reports.

Regards,
Shwetha, AdWords API Team.

n...@albert.ai

unread,
Apr 29, 2019, 5:20:41 PM4/29/19
to AdWords API and Google Ads API Forum
Hey,
I know this is an old question, but I have the same problem now.
"Cost" gives me a number that I can't understand and is not related to real cost I see in the api.
For example: in the api it says the Cost on 21.4.19 is 94.59$ but in the report I downloaded using java it says "60320000".
Is it just an error of formatting?

they say "Cost" is "The sum of your cost-per-click (CPC) and cost-per-thousand impressions (CPM) costs during this period."
which sounds a bit different than just "amount spent on that period"

Thank you!

The information contained in this communication and its attachments is intended solely for the use of the individual or entity to whom it is addressed and others authorized to receive it. It is the property of Albert and may contain confidential or legally privileged information. If you are not the intended recipient you are hereby notified that any disclosure, copying, retention, printing or distribution of this communication or any part thereof, or taking any action in reliance on the contents of this information is strictly prohibited and may be unlawful. If you have received this communication in error, please notify us immediately by responding to this email and then delete all copies of it from your system. Albert is not liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt.

googleadsapi...@google.com

unread,
Apr 29, 2019, 9:58:40 PM4/29/19
to AdWords API and Google Ads API Forum
Hi there,

The value of money fields may differ from the API and the UI. The API returns money values in micros as explained in this guide. However, the values you mentioned were significantly different. Can you provide the complete report definition and your clientCustomerId used when you downloaded the report so I could further investigate this? Kindly use the reply privately to author option. Do take note that the Criteria Performance Report does not have an equivalent report in the Google Ads UI.

The Cost field only determines the spend of the entity specified in the row. It does not determine the spend of the whole account. You may refer to this guide for more details.

Also, we would highly appreciate opening your concern on a new thread next time instead of responding in an old thread. This is for other users to be able to see new issues easily and for better tracking. Thank you.

Regards,
Dannison
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/6e773a08-599f-49d9-b77e-30a0dbe0c676%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

Reply all
Reply to author
Forward
0 new messages