why line-items which got from Ads api didn’t match campaigns_dashboard list?some line-items was untitled?did any problem accrue?

@_documentor: could you please provide the request and response, preferably using twurl, so that we can see what’s happening? Thanks!

asynchronous stats endpoint can pull campaign spending?which metric_groups?

For spend, you can use the BILLING metric group enum.

why did i request billing of entity which is ACCOUNT, but data fields of job result was empty?
for example:
{“data_type”:“stats”,“time_series_length”:24,“data”:,“request”:{“params”:{“start_time”:“2016-08-28T08:00:00Z”,“segmentation_type”:null,“entity_ids”:null,“end_time”:“2016-08-29T08:00:00Z”,“country”:null,“placement”:“ALL_ON_TWITTER”,“granularity”:“HOUR”,“entity”:“ACCOUNT”,“platform”:null,“metric_groups”:[“BILLING”]}}}

Hi, @_documentor. Not all metrics are available for every entity type. At the account-level, only engagement metrics are available. Please see the Metrics and Segmentation in Analytics documentation for more information. Thanks!

but how can i query account spend which group by platform?

Hi _documentor, perhaps this page would help as well:

You cannot retrieve billing at account level because you might have different funding instruments with different currencies (one with USD, another with JPY, etc).

Those listed in link above are the recommended metric groups - you can attempt to retrieve any metric_group for any objective because it depends upon which entity and creative is being promoted (for example, videos will have media metrics).

Hope this makes sense!

1 Like

why data didn’t match?data which pull from api less then ads campaigns_dashboard?
api which i used is “stats/jobs/accounts/:account_id” and segmenting data by HOUR granularity~~

@_documentor: Please type out the request and the response you received as well as the values you were expecting for each of the hours. We need to this information to determine whether there is a discrepancy or not. Thanks a lot!

request params(PHP): [metric_groups] => BILLING [start_time] => 2016-08-31T00:00:00+08:00 [end_time] => 2016-09-01T00:00:00+08:00 [granularity] => HOUR [entity] => CAMPAIGN [entity_ids] => 5siai,5sibq,5sid8,5sidu,5sies,5sifa,5sigs,5sihc,5siht,5sikf,5sj0e,5sj0q,5sj3y,5sj5c,5sj60,5sj6i,5sj6y,5sj7l,5sj85 [placement] => ALL_ON_TWITTER [segmentation_type] => PLATFORMS

response:
{“data_type”:“stats”,“time_series_length”:24,“data”:[{“id”:“5siai”,“id_data”:},{“id”:“5siht”,“id_data”:[{“segment”:{“segment_name”:“iOS devices”,“segment_value”:“0”},“metrics”:{“billed_charge_local_micro”:[0,0,0,0,0,190000,0,0,0,70000,0,0,0,0,0,0,0,0,0,0,0,0,0,0],“billed_engagements”:[0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}}]},{“id”:“5sihc”,“id_data”:},{“id”:“5sidu”,“id_data”:[{“segment”:{“segment_name”:“iOS devices”,“segment_value”:“0”},“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],“billed_engagements”:[1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}}]},{“id”:“5sj6y”,“id_data”:},{“id”:“5sj0q”,“id_data”:},{“id”:“5sj5c”,“id_data”:},{“id”:“5sikf”,“id_data”:},{“id”:“5sid8”,“id_data”:},{“id”:“5sj0e”,“id_data”:},{“id”:“5sj60”,“id_data”:},{“id”:“5sj7l”,“id_data”:},{“id”:“5sj6i”,“id_data”:},{“id”:“5sigs”,“id_data”:},{“id”:“5sj3y”,“id_data”:},{“id”:“5sibq”,“id_data”:},{“id”:“5sifa”,“id_data”:},{“id”:“5sj85”,“id_data”:},{“id”:“5sies”,“id_data”:}],“request”:{“params”:{“start_time”:“2016-08-30T16:00:00Z”,“segmentation_type”:“PLATFORMS”,“entity_ids”:[“5siai”,“5sibq”,“5sid8”,“5sidu”,“5sies”,“5sifa”,“5sigs”,“5sihc”,“5siht”,“5sikf”,“5sj0e”,“5sj0q”,“5sj3y”,“5sj5c”,“5sj60”,“5sj6i”,“5sj6y”,“5sj7l”,“5sj85”],“end_time”:“2016-08-31T16:00:00Z”,“country”:null,“placement”:“ALL_ON_TWITTER”,“granularity”:“HOUR”,“entity”:“CAMPAIGN”,“platform”:null,“metric_groups”:[“BILLING”]}}}

@_documentor: It will be much be easier to look at a single campaign. Could you pick one and let us know what values you were expecting for each of the hours?

campaign name is “1MTXZ-ROS-UK-PokemonGO-IOS-OAB-08/23”,day :2016-08-31

@_documentor: Are the values at the top (e.g., [0] => int(610000)) what you are expecting to see from the Ads UI or is that what you’re getting as the response? Please let me know and I’ll take a look.

campaigns_dashboard had three columns($0.61, $0.31, $0.01),but data which pull from api did have two(610000, 310000).lose one!!!

Not a single case

@_documentor:

Our understanding is that your latest concern is that you’re seeing a difference between the results in the Ads UI and the results from the API.

We’re asking for the values you expect because even though we see the plot, it’s difficult to tell what those values are. For example we cannot tell whether the value for the bar at the 4:00AM hour is $0.31 or $0.32. We need this information to compare to the results from the API.

Up until you mentioned $0.61, $0.31, and $0.01, we did not have enough information to debug your issue. Had we tried calling the API with the request you provided, we would have seen the same response you provided earlier, but would not have known what the values should have been.

Hopefully this clears up why we needed this additional information.

We’ll look into this shortly.

this is all of the ads ui displayed~

@_documentor: What is the account_id? We can’t send the request without that information.