Fetching facebook custom audience insights after creating and adding users using fb's Java sdk

ぐ巨炮叔叔 提交于 2020-01-05 05:29:26

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!