QA795
#1
Hello,
I’m trying to the fetch platforms stats from a campaign.
I can see on my Ads Dashboard the Platforms option and the data:
I’ve read all the docs but couldn’t figure out how to get this information through the API.
What I’ve discovered was: I can get all the platforms from the account like:
{'name': 'iOS', 'targeting_type': 'PLATFORM', 'targeting_value': '0'}
{'name': 'Android', 'targeting_type': 'PLATFORM', 'targeting_value': '1'}
{'name': 'BlackBerry phones and tablets', 'targeting_type': 'PLATFORM', 'targeting_value': '2'}
{'name': 'Mobile web on other devices', 'targeting_type': 'PLATFORM', 'targeting_value': '3'}
{'name': 'Desktop and laptop computers', 'targeting_type': 'PLATFORM', 'targeting_value': '4'}
Then I could request at stats/jobs/accounts/:account_id sending segment_type='DEVICE' and platform=targeting_value
But this request has to be done 5 times (for each platform above) and this would return an object for each smartphone type of Android for example (as Galaxy 1, Galaxy 2, etc). What I want is to get the stats summed up for Android (and Ios, Web).
How can I get (or is it possible to get the) campaign stats by each platform type?
jrsyo
#2
@QA795 I believe you can just specify segment_type=PLATFORMS
QA795
#3
That’s exactly what I wanted!
Also, I opened a pull request related to that on the SDK GitHub repository.
Thank you!