Campaign Stats


#1

Hi,

https://dev.twitter.com/ads/reference/get/stats/accounts/%3Aaccount_id/campaigns
This link allows you to fetch stats for multiple campaigns by specifying the campaign_ids however the result set has just one data object, how can one identify which campaign the stats are for? Or is the example in the docs, wrong?


#2

Hi @tal_asad. The docs don’t provide examples for every scenario, but just for the main one, the most common one (with one campaign id, for this endpoint). It is up to you to test your specific use case and see exactly how the data is returned for that.


#3

I can’t actually test it cause the server doesn’t reply on stat endpoints while we are in Dev level.


#4

Are you sure? Have you tried it? Because now I notice that on the page Twitter Ads API Overview it says:

Partners are strictly prohibited from creating, managing and/or reporting advertiser campaigns via the Twitter Ads API at Developer level.

But on the page Ads API Rate Limiting it says that for the Developer access level, the rate limit per 1-minute window for Analytics Cost is 1,000, which means that you must be allowed to make such requests.

At this point, I don’t know which information is correct and which is misleading.


#5

I have been getting 400 Bad Request and i was pretty sure nothing was wrong with the request so i searched these forums and read somewhere you can’t hit stats endpoints while in dev. Everything seems so speculative with Twitter Ads API.


#6

I see. I think that the error in case of lack of access would be something like “The client application doesn’t have access to this endpoint.” or something like that. So, would you mind posting the request you’re making, please, to make sure we can rule out any problems with the request?


#7

twurl -t -H ads-api-sandbox.twitter.com -X GET -d "campaign_ids=g3m7&start_time=2016-02-01T07:00:00Z&granularity=DAY" /0/stats/accounts/gq106g/campaigns | prettyjson opening connection to ads-api-sandbox.twitter.com:443... opened starting SSL for ads-api-sandbox.twitter.com:443... SSL established <- "GET /0/stats/accounts/gq106g/campaigns HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: OAuth gem v0.4.7\r\nContent-Type: application/x-www-form-urlencoded\r\nAuthorization: OAuth oauth_consumer_key=\"MKjyCpfGqem0kOnrFmnUxafUm\", oauth_nonce=\"67vt6wfEV0ki1WPHzFjqvrrCn1WtTHTLVwwvrjTZp4\", oauth_signature=\"4BcpX1%2FYZtiaAa3sBO1XMl3%2BTK0%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1456839124\", oauth_token=\"2893364686-GppDhhJPjThB6t0m6ruYEiaiLzQYAKyErmEl4u4\", oauth_version=\"1.0\"\r\nConnection: close\r\nHost: ads-api-sandbox.twitter.com\r\nContent-Length: 69\r\n\r\n" <- "campaign_ids=g3m7&start_time=2016-02-01T07%3A00%3A00Z&granularity=DAY" -> "HTTP/1.1 400 Bad Request\r\n" -> "connection: close\r\n" -> "content-length: 0\r\n" -> "date: Tue, 01 Mar 2016 13:32:06 GMT\r\n" -> "server: tsa_f\r\n" -> "x-connection-hash: 3aa3e9c2493e639112a3ec451274c31f\r\n" -> "\r\n" reading 0 bytes... -> "" read 0 bytes Conn close


#8

Thank you. So I gather your (sandbox) account’s timezone is UTC-7, is this right?

Have you tried using the endpoint GET stats/accounts/:account_id/campaigns/:id ?

Have you tried making this request on production environment instead of sandbox? With the real account id, of course. If not, please try and tell us what the result is.


#9

They strictly prohibit us to use the real api end-point as far as i know. I will see if i can find a campaign that i can pull some stats for. Why aren’t the examples updated when an endpoint is updated or when changes are introduced in Twitter. Seems like a trivial task …

It would also make sense for this endpoint to return an array with just one object if just one campaign was being retrieved.


#10

I can confirm that Sandbox does not currently support stats endpoint - you should be able to hit the production endpoint even at Developer level.

We recently made an announcement about Ads API V1 which will also include Sandbox improvements that allow hitting the analytics endpoints: https://twitter.com/AdsAPI/status/704807132294729728 (I recommend to follow that handle to keep up with our latest updates).


Issue Accessing ADS API Campaign metrics info
#11

Seems you guys are in a rush of moving to v1 which seems like a good way to get rid of old practices. I really look forward to making a migration towards v1, when do you think docs will be available for v1? Are they going to roll out on 15th March as well? If yes i would really like to see some sample data objects to adjust and migrate ASAP.


#12

Can you let me know when you plan on rolling out Stats for v1?


#13

Hi @tal_asad,

We’re working on a lot of this at the moment. An early migration guide can be found here:

https://dev.twitter.com/ads/analytics/migration-guide-v0-v1

The async design documented for one endpoint is here:

https://dev.twitter.com/ads/reference/1/post/stats/jobs/accounts/%3Aaccount_id


#14

I see a “Access Denied” on https://dev.twitter.com/ads/analytics/migration-guide-v0-v1


#15

Me neither