问题
I used facebook's java api to create a custom audience and uploaded my data comprising of android mobile_adv_ids.
CustomAudience customAudience = new AdAccount(ACCOUNT_ID, context).createCustomAudience()
.setName("My new CA")
.setSubtype(CustomAudience.EnumSubtype.VALUE_CUSTOM)
.setDescription("People who bought from my website")
.execute();
User user = new CustomAudience(customAudience.getId(), context).createUser()
.setPayload("{\"schema\":\"MOBILE_ADVERTISER_ID\"," + payload.toString().substring(1, payload.toString().length()))
.execute();
I can see the data successfully uploaded on
https://www.facebook.com/ads/manager/audiences/manage/?act=xxxxxxx&pid=p1
and insights on
https://www.facebook.com/ads/audience-insights/people?act=xxxxxxx&age=18- but I can't find the api to read the insights in code.
This is the code on https://developers.facebook.com/docs/marketing-api/reference/custom-audience/ available for reading.
But how can I read audience insights data as % of male/female and other fields?
CustomAudience customAudience2 = new CustomAudience("xxxxxxxxx", context).get().execute();
Thanks.
回答1:
The corresponding API is called Audience Study https://developers.facebook.com/docs/marketing-api/audience-insights-api/audience-studies/v2.9
However, it is not natively supported in Java SDK yet and you have to construct the request by yourself. See example in https://github.com/facebook/facebook-java-ads-sdk/blob/master/examples/AdhocAPIRequestExample.java
来源:https://stackoverflow.com/questions/42083786/fetching-facebook-custom-audience-insights-after-creating-and-adding-users-using