Hello we need to get Billing(cost/spend) and Engagement(clicks, impressions etc. ) stats at the creative level. Currently we understand how to accomplish this at the campaign level but we require further granularity for our cost reporting purposes.
We referred to this link, Synchronous Analytics | Docs | Twitter Developer Platform
and currently understand that the possible values for an entity are : ACCOUNT, CAMPAIGN, FUNDING_INSTRUMENT, LINE_ITEM, ORGANIC_TWEET, PROMOTED_TWEET
We understand Line_Item to be analogous to AdGroup, so Ad should be analogous to Organic_Tweet or Promoted_Tweet?
We’re using the following end points:
stats/accounts/:account_id/campaigns
stats/accounts/:account_id/campaigns/:id .
But we need to go two levels deeper to Campaign > Adgroup > Ad
We referred to these posts:
- How to get Imp,click,mobie_app_conversion by CAMPAIGN and Creatives - #7 by quicknewsofapps
- https://twittercommunity.com/t/api-to-access-analytics-data-engagements-impressions-clicks-retweets-likes-etc/91074/6
- Ads API - Which Campaign REST endpoint to use to get Clicks, Impressions, Cost, - #2 by andrs
But they do not directly answer our question.
Our desired output is a response containing the following columns:
- Date
- Ad Account Name
- Ad Account ID
- Campaign Name
- Campaign ID
- Ad Group Name
- Ad Group ID
- Creative Name
- Creative ID
- Cost
- Clicks
- Impressions
Let us know if we can give you more details, thanks!
1 Like
Thanks for looking into historical posts before posting a question!
If you’re looking for data about an ad, that will always be entity=PROMOTED_TWEET in the analytics request.
We’re using the following end points:
stats/accounts/:account_id/campaigns
stats/accounts/:account_id/campaigns/:id
These resource paths are not supported.
That’s a lot that you’re trying to do. You’ll need to make multiple requests to get that information. For example, to get the account ID and name you should refer to GET accounts. For the campaign ID and name, use GET accounts/:account_id/campaigns. For line item ID and name use GET accounts/:account_id/line_items (scoping by the specific campaign ID). The “creative” ID—I’ll assume you mean the promoted_tweets ID—should be found by using GET accounts/:account_id/promoted_tweets (scoping by the specific line item ID). Not sure what you mean by creative name. For cost, clicks, and impressions, use one of our analytics endpoints (e.g., GET stats/accounts/:account_id) and specify the line item IDs as the entity_ids values and specify metric_groups=ENGAGEMENT,BILLING.
Hi,
We are trying to access this analytics API,
https://ads-api.twitter.com/4/stats/accounts/<<account_id>>?entity=PROMOTED_TWEET&entity_ids=<>&start_time=2019-01-23T07:00:00Z&end_time=2019-01-23T07:00:00Z&granularity=TOTAL&placement=ALL_ON_TWITTER&metric_groups=ENGAGEMENT,BILLING,MEDIA,VIDEO"
but we are getting the “UNAUTHORIZED” issue.
Note : We are able to access Compaign Management API like
https://ads-api.twitter.com/3/accounts/<<account_id>>/line_items/placements
Please guide us if there is authorization needed from twitter end to access the API or do we need to do anything from our end.
Thanks in advance!!
Hi, We tried the encoding step also, still we are receiving the same “UNAUTHORIZED ERROR”, please guide us the steps to be followed
Please try making the request with twurl, using your authentication credentials. If the call succeeds, you know there is an issue with the current OAuth library or implementation you’re using.