How to get Imp,click,mobie_app_conversion by CAMPAIGN and Creatives

ads
api
campaign-management

#1

Hi,
I am working on developing up Dashboard to manage Twitter Ads , MAP.
But I m not sure how to get the data with Ads API.
I want to retrieve Impression , click , install(mobie_app_conversion) by CAMPAIGN and Creatives.

I have already granted DEVELOPER ACCESS.

If anyone know how to retrieve that data , please show me how to do that.

Thanks


#2

Hi @quicknewsofapps,

Here you’ll get all the information you need:

https://dev.twitter.com/ads/analytics


#3

Thanks !

I checked but i just got JSON file with no data.

my code is here ,Python.

`uri=‘https://ads-api.twitter.com/1/stats/jobs/accounts/{0}?entity_ids={1}&entity=CAMPAIGN&end_time={2}&start_time={3}&granularity=DAY&metric_groups={4},BILLING&segmentation_type={5}&placement=ALL_ON_TWITTER
.format(
#account id
’*****’,
#cpn id
’11111’,
#end time T17%3A00%3A00Z’
‘2016-05-06’,
#start time
’2016-05-01’,
#metric
’mobile_conversion_installs’,
#segmentation type
’INTERESTS’
)

apps=auth.get(uri)
apps=apps.json()
print(apps)`

Do you know why this happens?


#4

Maybe you have no data in that time interval?..


#5

Thanks.

I have data.
I can see data from TW dashboard.

The JSON file contains this response.

{“data_type”:“stats”,“time_series_length”:61,“data”:[],“request”:{“params”:{“start_time”:“2016-03-31T15:00:00Z”,“segmentation_type”:null,“entity_ids”:["***"],“end_time”:“2016-05-31T15:00:00Z”,“country”:null,“placement”:“ALL_ON_TWITTER”,“granularity”:“DAY”,“entity”:“CAMPAIGN”,“platform”:null,“metric_groups”:[“MOBILE_CONVERSION”,“BILLING”]}}}


#6

If I remember correctly, the synchronous analytics endpoint in v1 is limited to a 7 day range. What version of the API are you using? v0 or v1?


#7

I think version 1
And i think im using Asynchronous analytics.

https://ads-api.twitter.com/1/stats/jobs/accounts/account id?


#8

So, to confirm, you first make a POST request to create an asynchronous job and then get the job data once it’s done?


#9

I did know that.

I just did use GET only.

So first , POST and get Job ID and then , GET data?


#10

If you only did a GET, then you used the synchronous endpoint. For asynchronous is POST to create a job and then GET the job’s data once it’s done.

POST to create the async job: https://dev.twitter.com/ads/reference/1/post/stats/jobs/accounts/%3Aaccount_id

But it’s ok if you used the synchronous endpoint, as long as you don’t need segmentation as this can only be done with the asynchronous method.

I recommend you post a twurl example, including your account id and entity ids as these are not sensitive information, so, hopefully, a Twitter Staff can check.


#11

Thanks!

I will try post and then get.
And im confusing what entity id is.
Does entity id equal CAMPAIGN id ?


#12

entity id = campaign id or line item id or promoted tweet id, depending on what type of entity you are trying to pull data for.


#13

Thanks!

About campaign id , i can find 2 types of id.
First one is like, 4md5T, second one is like, 89809993.

Do you know what is difference between fist one and second one?


#14

Ids like 89809993 are from the Ads UI, ids like 4md5T are used in the API.


#15

Thanks so much!
I will work on the my problems.


#16

You’re welcome, @quicknewsofapps. :slight_smile: