Campaigns metrics not matching between API call vs Ads report



We pulled data across 2 months for over 436 campaigns and everything looks accurate except 4 campaigns.

We are matching our values with reports. Following are the calls we are making to Twitter Ads API to get this.



Hi, @SriKavikondala. Thanks for posting to the forum.

A few questions for you. What’s different about these four campaigns? Is it objective, placement, product type, or something else? Are they more recent or, perhaps, older campaigns?

Could you also provide a few campaign IDs where the data you’re seeing is correct?


Some of the Campaign IDs that worked for the same account ID (5ms8v,5msa1,5msfc,5mshi). All of these Campaign Start date is 04-Aug. This is similar to 2 campaigns IDs in question ( 5msrb,5mssr ). The other 2 campaign IDs that are having an issue are (5d09i,5d0eg) having 01-July as start date. Also we have some sucessful campaign pulls which started on that date. So I cant find a pattern which stands them out


@SriKavikondala: This appears to be a placement issue.

ALL_ON_TWITTER requests data for all placement types on Twitter, such as timelines and profiles. When campaigns also serve to the Twitter Audience Platform, however, a second request to the GET /1/stats/accounts/:account_id endpoint must be made using placement=PUBLISHER_NETWORK. Adding the two should match what you’re seeing in the Twitter Ads UI.

Note that in v1:

placement takes in a single value, so separate queries are required to fetch analytics data for placement on Twitter and placement on the Twitter Audience Platform.

See Migration Guide: v0 => v1.

Hope this helps!


@SriKavikondala: Did this resolve your issue?


Nope. Variances slightly decreased but it is is still there. I don’t think this could be the reason as we are talking about 1 % of the campaigns we pulled. If this happened , this should have happened for more cases than this.

Any alternatives?


@SriKavikondala: Here are our findings for two of the four examples you provided.

  • For campaign ID 5d0eg, we are seeing spend of 952854169 on Twitter and 1147145831 on the Twitter Audience Platform (publisher network)—these values are in local micros. In USD, this is $2,1000. What value were you expecting for this campaign?
  • For campaign ID 5msrb, we are seeing spend of 5754800620 on Twitter and 181274902 on the Twitter Audience Platform (publisher network)—these values are in local micros. In USD, this is $5,936.075522. What value were you expecting for this campaign?


@SriKavikondala just posting an update that the info @juanshishido needed is updated in the internal ticket tied to this issue.


Thanks, @carmenjyuen.

@SriKavikondala: Please provide the actual twurl requests you’re making (not just the URL posted above). If there are discrepancies in the API-based results we’re seeing, we need to sort that out first.


@SriKavikondala: We’d like to continue to try to help resolve this discrepancy, but we need more information first.


Juan - They are the same calls which I provided you already.


@SriKavikondala: We’re making the exact same request for 5msrb as you listed in your original post. The only difference is that we’re requesting both ALL_ON_TWITTER and PUBLISHER_NETWORK.

These are the values we’re seeing:

>>> all_on_twitter = [0,0,0,1579038410,1116392554,1482302697,1577066959]
>>> publisher_network = [0,0,0,42521623,38203606,75598662,24951011]


>>> foo = sum(all_on_twitter)
>>> bar = sum(publisher_network)
>>> (foo + bar) / 1000000

This is the same total value for this campaign that we saw (and listed) previously. We just made these requests again and the values have not changed.

What we’re trying to understand is whether—and if so, why—the “API Pulls” values you provided to @carmenjyuen are so different. Could you please make the following requests and confirm the total value you’re seeing?

$ twurl -H "/1/stats/accounts/eedpr1?placement=ALL_ON_TWITTER&metric_groups=BILLING&start_time=2016-08-01&entity=CAMPAIGN&end_time=2016-08-08&granularity=DAY&entity_ids=5msrb"
$ twurl -H "/1/stats/accounts/eedpr1?placement=PUBLISHER_NETWORK&metric_groups=BILLING&start_time=2016-08-01&entity=CAMPAIGN&end_time=2016-08-08&granularity=DAY&entity_ids=5msrb"