Can you gate and target a page post through the facebook graph api?

后端 未结 4 839
终归单人心
终归单人心 2021-01-13 10:07

Enabling post privacy gating in the Page\'s privacy settings allows creating of posts with separate Gating and Targeting. Enable:

4条回答
  •  误落风尘
    2021-01-13 10:48

    Can somebody post a bit of example code for locales and countries? There is really nothing in the api and the net overall although this feature is so powerful!

    Code example that worked for me:

        curl -F 'access_token=[page_access_token]' 
             -F 'message=Testing post to certain language' 
             -F 'link=http://stackoverflow.com/questions/15280604/can-you-gate-and-target-a-page-post-through-the-facebook-graph-api' 
             -F 'feed_targeting={'locales':[1001]}' 
        https://graph.facebook.com/[pageID]/feed
    

    To get language numbers:

        curl -G -d "access_token=xx" -d"q=en"  
                -d "type=adlocale" 
        https://graph.facebook.com/search
    

    A bit of help is the Targeting from the ads api doc but only some fields are possible for post targeting.

    To get locales,city,... codes graph search via curl

    Hope this helps someone!

提交回复
热议问题