Cannot retrieve Billing data in API

billing
api

#1

Good day,

We are trying to set the API but the most important metric is missing and will not return in pull, the biolling.
API does not receive any data of conversions and spend.
This is despite the request for this data was sent.
The request sent is below.
‘metric_groups’ : ‘ENGAGEMENT,WEB_CONVERSION,MOBILE_CONVERSION,MEDIA,VIDEO,LIFE_TIME_VALUE_MOBILE_CONVERSION,BILLING’

Please assist us in setting the API right.
Best Anastasia


#2

@XTrade: Please provide the full request, preferably using twurl, as well as the response you saw.


#3

Hi,

the requested params:

{  
  account_id:'OUR-ACCOUNT-ID',
  entity:'OUR-ACCOUNT-ID',
  entity_ids:'OUR-ACCOUNT-ID',
  start_time:'2017-01-05T00:00:00Z',
  end_time:'2017-01-12T00:00:00Z',
  granularity:'TOTAL',
  metric_groups:'ENGAGEMENT,WEB_CONVERSION,MOBILE_CONVERSION,MEDIA,VIDEO,LIFE_TIME_VALUE_MOBILE_CONVERSION,BILLING',
  engagement:'billed_charge_local_micro,billed_engagements',
  placement:'ALL_ON_TWITTER'
}

the response that we get:

{  
  data_type:'stats',
  time_series_length:1,
  data:[  
    {  
      id:'OUR-ACCOUNT-ID',
      id_data:[  
        {  
          segment:null,
          metrics:{  
            impressions:[  
              VALUE
            ],
            follows:[  
              VALUE
            ],
            retweets:[  
              VALUE
            ],
            likes:[  
              VALUE
            ],
            engagements:[  
              VALUE
            ],
            replies:[  
              VALUE
            ]
          }
        }
      ]
    }
  ],
  request:{  
    params:{  
      start_time:'2017-01-05T00:00:00Z',
      segmentation_type:null,
      entity_ids:null,
      end_time:'2017-01-12T00:00:00Z',
      country:null,
      placement:'ALL_ON_TWITTER',
      granularity:'TOTAL',
      entity:'ACCOUNT',
      platform:null,
      metric_groups:[  
        'ENGAGEMENT',
        'WEB_CONVERSION',
        'MOBILE_CONVERSION',
        'MEDIA',
        'VIDEO',
        'LIFE_TIME_VALUE_MOBILE_CONVERSION',
        'BILLING'
      ]
    }
  }
}

As can be seen the BILLING data is not received
OUR-ACCOUNT-ID - our real account id. hidden because it is confidential.
VALUE - is a some values that we receive. hidden because it is confidential.

Kind Regards,
Anastasia


#4

Thanks for these details, @XTrade. We’re investigating this now.


#5

@XTrade: Billing data is not available at the account-level. Please refer to the table at the top of our Metrics and Segmentation page. Thank you.


#6

Thank you for the help! We are trying to test it from another level.
Have a nice day!


#7

Hello Juan,
We have been successful in fetching all the needed data from 2 out of 3 our accounts.
The third account is not sending us spend metrics back. Do you know what might be a problem?
Is it possible it is blocked for this purpose?
Also, do you know what time Twitter finalizes results for yesterdays that we will know when we can pull them.
Many thanks


#8

Thanks for confirming, @XTrade. What’s the account ID you’re having trouble with? It’s okay to share Ads API entity IDs, such as account IDs. (See our Guidelines for Reporting Issues page.)

All billing stats are generally final within 3 days of the event (~99%), however we do process some spam filtering for up to 14 days from the date of the event. Source.


#9

Hello Juan,
The account’s ID we have troubling fetching data from is 18ce543zuof .

thanks


#10

btw, for this accopuint we do not recieve any data, problem is not only with billing.


#11

@XTrade: We’re able to retrieve data for this account—for a specific campaign and for the account:

Campaign

$ twurl -H ads-api.twitter.com "/1/stats/accounts/18ce543zuof?start_time=2017-01-21&end_time=2017-01-28&entity=CAMPAIGN&entity_ids=7an4t&metric_groups=ENGAGEMENT&granularity=TOTAL&placement=ALL_ON_TWITTER" | jq
{
  "data_type": "stats",
  "time_series_length": 1,
  "data": [
    {
      "id": "7an4t",
      "id_data": [
        {
          "segment": null,
          "metrics": {
            "impressions": [
              171313
            ],
            "tweets_send": null,
            "qualified_impressions": null,
            "follows": [
              13
            ],
            "app_clicks": [
              1525
            ],
            "retweets": [
              5
            ],
            "likes": [
              52
            ],
            "engagements": [
              2390
            ],
            "clicks": [
              839
            ],
            "card_engagements": [
              1525
            ],
            "replies": [
              8
            ],
            "url_clicks": null,
            "carousel_swipes": null
          }
        }
      ]
    }
  ],
  "request": {
    "params": {
      "start_time": "2017-01-20T22:00:00Z",
      "segmentation_type": null,
      "entity_ids": [
        "7an4t"
      ],
      "end_time": "2017-01-27T22:00:00Z",
      "country": null,
      "placement": "ALL_ON_TWITTER",
      "granularity": "TOTAL",
      "entity": "CAMPAIGN",
      "platform": null,
      "metric_groups": [
        "ENGAGEMENT"
      ]
    }
  }
}

Account

$ twurl -H ads-api.twitter.com "/1/stats/accounts/18ce543zuof?start_time=2017-01-21&end_time=2017-01-28&entity=ACCOUNT&entity_ids=18ce543zuof&metric_groups=ENGAGEMENT&granularity=TOTAL&placement=ALL_ON_TWITTER" | jq
{
  "data_type": "stats",
  "time_series_length": 1,
  "data": [
    {
      "id": "18ce543zuof",
      "id_data": [
        {
          "segment": null,
          "metrics": {
            "impressions": [
              2732965
            ],
            "follows": [
              294
            ],
            "retweets": [
              113
            ],
            "likes": [
              980
            ],
            "engagements": [
              42968
            ],
            "replies": [
              93
            ]
          }
        }
      ]
    }
  ],
  "request": {
    "params": {
      "start_time": "2017-01-20T22:00:00Z",
      "segmentation_type": null,
      "entity_ids": null,
      "end_time": "2017-01-27T22:00:00Z",
      "country": null,
      "placement": "ALL_ON_TWITTER",
      "granularity": "TOTAL",
      "entity": "ACCOUNT",
      "platform": null,
      "metric_groups": [
        "ENGAGEMENT"
      ]
    }
  }
}

#12

Thanks for repty!
I’ve understood what was the problem. We have more than 200 campaigns for this account but there is a default value of 200 for campaigns number when fetching the campaigns, so some of the campaigns were not received. I’ve set campaigns count value so and now all the data is received well. Also took care of next_cursor thing for a future so that when the number of campaigns will be high the data will be fetched well.
Thanks for your help!