How to get all the spent data budget for promoted account campaigns?


#1

Hi,

We are trying to pull spent budget data using the Ads API.
However we can’t manage to get all the spent budget data for the promoted account campaigns.

On the twitter Ads UI, we can see detailed spent budget data for a given campaign.
On the Tweets tab, we see that the sum of the spent budget for all tweets is less than the total spent budget for the campaign.
I guess the difference is the spent budget on the promoted account itself.

In order to get spent data we do the following use the ads API:

  • get all campaigns
  • get all line items
  • get all promoted tweets
  • get all promoted accounts
  • get stats for all promoted tweets
  • get stats for all promoted accounts

Then everything is put in a relational database.

When querying the spent budget data by campaign, we see that there is missing spent budget for the campaigns that are related to promoted accounts.
We only have the spent budget for the promoted tweets of these campaigns, so we have the same spent budget difference that I mentioned earlier.

In fact, there doesn’t seem to be any metric to get the spent budget on promoted account:

> GET https://ads-api.twitter.com/0/stats/accounts/:accountid/promoted_accounts/:id?metrics=billed_charge_local_micro&start_time=2015-08-18T22%3A00%3A00Z&end_time=2015-08-25T22%3A00%3A00Z&granularity=HOUR

{u'message': u'Expected valid metric promoted_account_follow_rate, promoted_account_follows, promoted_account_impressions, promoted_account_profile_visits, got "billed_charge_local_micro" for metrics', u'code': u'INVALID_PARAMETER', u'parameter': u'metrics'}

How does one get the full spent budget data for promoted account campaigns that will match the one of the UI?

Thanks


Promoted Accounts - No data at the line item level
#2

You’re correct that billed_charge_local_micro is not exposed at the Promoted Account level – this metric is exposed at the line item level instead for promoted accounts. This is because promoted account and line items have a one-to-one mapping, whereas promoted tweets and line items do not.


#3

Hi @vllaskin,

What I did in my app, is:

I save in my own side stats for every promoted ad and if I do my own calcs in order to know campaign, line_items and account metrics.

I know every app is different but this could be useful for you.

Regards!


#4

Thank you both for your answers.
I now get the stats at the line item level in order to have the budget for all campaigns.