How can I pull cost by campaign that INCLUDES invalid data via the API?

208 views
Skip to first unread message

Evan Chad

unread,
Mar 29, 2017, 2:04:51 PM3/29/17
to AdWords API Forum
Hey everyone -

First time poster, long time listener.

Currently, we are pulling in cost via the Campaign Performance Report and I was under the impression that AdWords was sending us updated spend via the API. It seems that Invalid Data is not updating the campaign cost. I have found there is a Total Adjustment field, but how can I pull cost that INCLUDES invalid data by campaign via the API?

Any help would be greatly appreciated!

Sreelakshmi Sasidharan (AdWords API Team)

unread,
Mar 29, 2017, 4:35:10 PM3/29/17
to AdWords API Forum
Hi, 

Congratulations on your first post!

The cost field in Campaign Performance Report will get modified to accommodate the invalid clicks if it has any. Hence the cost that you get on your report should be the correct value (provided that you are not running the report too soon or looking for the data corresponding to current day or previous day). Please check the
 guide on data freshness for better clarity on correctness of the report stats. If you run the report at each click level and include both valid and invalid clicks, you should be able to validate the stats. The invalid clicks in the Campaign Performance Report should give you the number which weren't charged as they were considered illegitimate. 

For getting the spend via the API, we do not have a service which gives the value directly. However, you will be able to calculate the spend if you are able to save the spendingLimit regularly which can be retrieved using the BudgetOrderService locally and derive the spend by applying the calculation as below:
spent = (oldSpendingLimit - newSpendingLimit) + totalAdjustments

Let me know if you have any additional questions. 

Thanks,
Sreelakshmi, AdWords API Team

Evan Chad

unread,
Mar 31, 2017, 4:07:35 PM3/31/17
to AdWords API Forum
Thanks @Sreelakshmi. I have a follow-up question for you. In regards to the Campaign Performance Report, can you confirm that the clicks, interactions, and cost shown is the total number of clicks that is deducted by invalid activity or is it the total? (See example below)

For example, if I go to my Campaign Performance and the columns and numbers as follows:

Total Cost  = $1,000     
Total Clicks = 300
Total Interactions = 300
Invalid clicks = 100
Invalid interactions = 100

Does the Total Cost, Interactions, and Clicks INCLUDE invalid activity? So the 300 total clicks is inclusive of the 100 invalid clicks? Does the total cost of $1,000 deducting the cost for invalid spend?

Let me know!

Thanks!

Shwetha Vastrad (AdWords API Team)

unread,
Mar 31, 2017, 6:10:16 PM3/31/17
to AdWords API Forum
Hi Evan, 

Sreelakshmi is OOO at the moment. I'll be the one to answer on this thread. The Total Cost, Total Clicks and Total Interactions available in Campaign Performance Report will not include invalid activity. The total Cost will not include invalid spend either. In case of invalid activity, it is recommended that you retrieve your reports after a couple of days to get the updated metrics. Please see the data freshness guide and this help center article for more details. 

Regards,
Shwetha, AdWords API Team.

Evan Chad

unread,
Mar 31, 2017, 7:07:23 PM3/31/17
to AdWords API Forum
Thanks for jumping in @Shwetha! I understand that the help article surrounds the BudgetOrderService. Is that the only way to pull total cost including invalid clicks? If so, how can I break that cost by campaign? Can I pull this cost through any additional report?

Thanks!

Shwetha Vastrad (AdWords API Team)

unread,
Apr 3, 2017, 10:47:15 AM4/3/17
to AdWords API Forum
Hi Evan, 

You'll not be charged for invalid click activity. The cost for your campaigns will not include invalid activity. Please see this guide for more details on how invalid traffic is detected and handled. You'll need to look at the Credit column in the transaction history of the Billing & Payments section. Please see this guide for the various types of adjustments. 

Evan Chad

unread,
Apr 5, 2017, 2:38:39 PM4/5/17
to AdWords API Forum
Hey Shwetha -

Thanks for the follow-up, but I have another question. Let's say I have cost below for two campaigns.



How do I get the total cost and how do I get the valid cost per campaign?
Auto Generated Inline Image 1

Shwetha Vastrad (AdWords API Team)

unread,
Apr 5, 2017, 5:11:47 PM4/5/17
to AdWords API Forum
Hi Evan, 

You need to request the Cost field, which is the sum of the cost-per-click (CPC) spend and cost-per-thousand impressions (CPM) spend during the selected time period. Other costs, such as cost-per-call, aren't included. For a sum of all costs, you need to use the "Total cost" column in the UI as this column is not available in AdWords API reports. 

Evan Chad

unread,
Apr 5, 2017, 7:53:17 PM4/5/17
to AdWords API Forum
Hey Shwetha -

Let's say we are pulling the cost field for a campaign which was $7,050.17 per my last screenshot. Let's say I have $50.17 credited due to invalid activity. Is the $7,050.17 include the invalid cost, or would this new cost be $7,000?

Thanks!

Shwetha Vastrad (AdWords API Team)

unread,
Apr 6, 2017, 10:42:30 AM4/6/17
to AdWords API Forum
Hi Evan,

If the cost for your campaign is $7050.17, this includes the cost for valid activity only. Once invalid activity is detected it is automatically filtered from your reports and payments so that you're not charged for those clicks. I would suggest that you post this query on the AdWords Community forum for more details as this is not specific to AdWords API. 
Reply all
Reply to author
Forward
0 new messages