API v1 stats for promoted_accounts?

v1
analytics
api

#1

How do I request stats for a PROMOTED_ACCOUNT in the API v1?

The Enumerations page for v1 stats allows for the following entities:
ACCOUNT
FUNDING_INSTRUMENT
CAMPAIGN
LINE_ITEM
PROMOTED_TWEET
ORGANIC_TWEET

I tried using ACCOUNT, but that appears to be the full Ads Account, not a Promoted_Account. When I call using
"/1/stats/accounts/ads_account_id?entity=ACCOUNT&entity_ids=promoted_account_id&metric_groups=BILLING,ENGAGEMENT,LIFE_TIME_VALUE_MOBILE_CONVERSION,VIDEO,MEDIA,MOBILE_CONVERSION,WEB_CONVERSION&start_time=2016-03-22T00%3A00%3A00Z&end_time=2016-03-27T00%3A00%3A00Z&granularity=TOTAL&placement=ALL_ON_TWITTER"

the response comes back with entity_ids = nil in the response[“request”][“params”]

{“data_type”=>“stats”,
“time_series_length”=>1,
“data”=>
[{“id”=> ads_account_id,
“id_data”=>
[{“segment”=>nil,
“metrics”=>
{“impressions”=>[8028],
“follows”=>[8],
“retweets”=>nil,
“likes”=>[1],
“engagements”=>[11],
“replies”=>nil}}]}],
“request”=>
{“params”=>
{“start_time”=>“2016-03-22T00:00:00Z”,
“segmentation_type”=>nil,
“entity_ids”=>nil,
“end_time”=>“2016-03-27T00:00:00Z”,
“country”=>nil,
“placement”=>“ALL_ON_TWITTER”,
“granularity”=>“TOTAL”,
“entity”=>“ACCOUNT”,
“platform”=>nil,
“metric_groups”=>
[“BILLING”,
“ENGAGEMENT”,
“LIFE_TIME_VALUE_MOBILE_CONVERSION”,
“VIDEO”,
“MEDIA”,
“MOBILE_CONVERSION”,
“WEB_CONVERSION”]}}}


#2

bump

I’m also running into this problem. Any explanation or light that you can shed on this, guys?


#3

Promoted account stats were always associated with line items, but some timeline impressions were created after the “Promoted account on timeline” feature was released and this is described upon the line items doc here: https://dev.twitter.com/ads/reference/post/accounts/%3Aaccount_id/line_items

Basically line item should be the entity you use, and engagement and billing would be the appropriate metric group (media if the tweet associated with line item includes media). This is described in our new v1 metrics documentation for example here: https://dev.twitter.com/ads/analytics/migration-guide-v0-v1


#4

@JBabichJapan, do you think stats for PROMOTED_ACCOUNT ads will ever be available at ad level, as opposed to the line item level? Because there may be more ads in that line item, and we need statistics about each ad’s performance specifically.


#5

As far as I know you can only have 1 promoted account for the line item as explained in Promoted Account and Line Item Relationship so this is the reason why you can look at line item as a “creative level” for promo accounts. If you use tweets in addition to the promo account, you can look at the promoted tweet entities individually but those should be included in the line item performance as well. I understand that this is confusing and not really easy to break apart as its own ad unit.


#6

Thank you. Yes, there is only one promoted account per line item, but a FOLLOWERS campaign (which uses the PROMOTED_ACCOUNT type) can contain multiple ads. As far as I know, metrics like promoted_account_impressions, promoted_account_follows cannot be retrieved at ad level, which is what I need, only at line item level. So, will we ever be able to get the metrics prefixed with promoted_account_ at ad level?


#7

If you associate multiple promoted tweets with a followers campaign line item, you should be able to query the promoted tweet IDs as entity_ids to get stats related with those tweets each individually.

For line item level - with the ENGAGEMENTS group there is a “Follows” metric being returned, this is actually the same as promoted_account_follows. I just went ahead and compared a v0 stats call for promoted_account_follows and v1 and got the same number for “Follows”. Our assumption is that for line item you are getting as many metrics as needed with the appropriate metric groups - please let us know if you still think otherwise.

You can try to test this with your own account ID:

v0:

twurl -H ads-api.twitter.com “/0/stats/accounts/{account_id}/line_items/{line_item_id}?start_time={start_time}&end_time={end_time}&granularity=TOTAL&metrics=promoted_account_follows” | jq .

v1 (have to use Async because > 1 week data):

twurl -t -H ads-api.twitter.com ‘/1/stats/jobs/accounts/{account_id}’ -X POST -d “metric_groups=ENGAGEMENT&placement=ALL_ON_TWITTER&granularity=TOTAL&start_time={start_time}&end_time={end_time}&entity=LINE_ITEM&entity_ids={line_item_id}” | jq .

  • To complete async and compare easily you must gunzip URL from job -> output it w jq / jsonpretty / etc.

Thanks,

John


#8

Hi,

How do you get the spend of the promoted account when the line item also has promoted tweets?

Thanks