douzhuan1432 2016-10-11 19:00
浏览 207

如何在创建广告时将已保存的受众群体用作定位规范

I am trying to create an adset with targeting specs and assign saved_audience id as a targeting specs. I looked at the API docs of targeting spec: https://developers.facebook.com/docs/marketing-api/targeting-specs/v2.8

It talks about custom_audience but not saved_audience. I tried to send it as a parameter saved_audience, saved_audiences etc. thinking that maybe it is not documented. API response is invalid parameter.

Here is the code:

$set->setData(array(
        AdSetFields::NAME => $obj_page->title.' '.time(),
        AdSetFields::CAMPAIGN_ID => $campaign_id,
        AdSetFields::DAILY_BUDGET => $daily_budget,
        AdSetFields::BID_AMOUNT => $daily_budget,
        AdSetFields::START_TIME => (new \DateTime($request->start_time))->format(\DateTime::ISO8601),
        AdSetFields::END_TIME => (new \DateTime($request->end_time))->format(\DateTime::ISO8601),
        AdSetFields::BILLING_EVENT => AdSetBillingEventValues::IMPRESSIONS,
        AdSetFields::TARGETING => (new Targeting())->setData(array(
            'custom_audiences' => array($audience_id), // works
            TargetingFields::PUBLISHER_PLATFORMS => array('facebook'),
            TargetingFields::DEVICE_PLATFORMS => array('desktop'),
        ))
    ));

using 'saved_audience' => array($audience_id) doesn't work.

  • 写回答

2条回答 默认 最新

  • dr6673999 2017-05-19 00:40
    关注

    There is no way to specify saved_audiences in the targeting spec. For more info on all the possible fields refer to the SDK.

    https://github.com/facebook/facebook-java-ads-sdk/blob/master/src/main/java/com/facebook/ads/sdk/Targeting.java

    评论

报告相同问题?

悬赏问题

  • ¥15 关于用pyqt6的项目开发该怎么把前段后端和业务层分离
  • ¥30 线性代数的问题,我真的忘了线代的知识了
  • ¥15 有谁能够把华为matebook e 高通骁龙850刷成安卓系统,或者安装安卓系统
  • ¥188 需要修改一个工具,懂得汇编的人来。
  • ¥15 livecharts wpf piechart 属性
  • ¥20 数学建模,尽量用matlab回答,论文格式
  • ¥15 昨天挂载了一下u盘,然后拔了
  • ¥30 win from 窗口最大最小化,控件放大缩小,闪烁问题
  • ¥20 易康econgnition精度验证
  • ¥15 msix packaging tool打包问题