Thanks, @_documentor. Having the account_id, the params used in the request, and the expected values was really helpful.
The view in the Ads UI shows data for placements on both Twitter (e.g., timelines, searches, etc.) and the Twitter Audience Platform.
The Twitter Audience Platform (TAP) is a network where advertisers can expand the reach of their campaigns beyond Twitter through devices served by MoPub.
(Source)
Please note that in v1 of the stats endpoint:
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.
Using twurl, the requests would be:
$ twurl -H ads-api.twitter.com "/1/stats/accounts/18ce54a2y23?entity=CAMPAIGN&entity_ids=5sidu&metric_groups=BILLING&start_time=2016-08-31T00:00:00+08:00&end_time=2016-09-01T00:00:00+08:00&granularity=HOUR&placement=ALL_ON_TWITTER"
{
"data_type": "stats",
"time_series_length": 24,
"data": [
{
"id": "5sidu",
"id_data": [
{
"segment": null,
"metrics": {
"billed_charge_local_micro": [
610000,
0,
0,
0,
310000,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
...
}
}
]
}
],
"request": {
"params": {
"start_time": "2016-08-30T16:00:00Z",
"segmentation_type": null,
"entity_ids": [
"5sidu"
],
"end_time": "2016-08-31T16:00:00Z",
"country": null,
"placement": "ALL_ON_TWITTER",
"granularity": "HOUR",
"entity": "CAMPAIGN",
"platform": null,
"metric_groups": [
"BILLING"
]
}
}
}
$ twurl -H ads-api.twitter.com "/1/stats/accounts/18ce54a2y23?entity=CAMPAIGN&entity_ids=5sidu&metric_groups=BILLING&start_time=2016-08-31T00:00:00+08:00&end_time=2016-09-01T00:00:00+08:00&granularity=HOUR&placement=PUBLISHER_NETWORK"
{
"data_type": "stats",
"time_series_length": 24,
"data": [
{
"id": "5sidu",
"id_data": [
{
"segment": null,
"metrics": {
"billed_charge_local_micro": [
0,
0,
0,
0,
0,
0,
10000,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
...
}
}
]
}
],
"request": {
"params": {
"start_time": "2016-08-30T16:00:00Z",
"segmentation_type": null,
"entity_ids": [
"5sidu"
],
"end_time": "2016-08-31T16:00:00Z",
"country": null,
"placement": "PUBLISHER_NETWORK",
"granularity": "HOUR",
"entity": "CAMPAIGN",
"platform": null,
"metric_groups": [
"BILLING"
]
}
}
}
Adding the billed_charge_local_micro arrays:
[610000, 0, 0, 0, 310000, 0, 10000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
We hope this helps!