首页 文章

如何在自定义受众创建之间处理数据源并将用户添加到自定义受众

提问于
浏览
0

我使用graph / marketing API v2.8并使用https://developers.facebook.com/docs/marketing-api/custom-audience-api/v2.8中的代码创建自定义受众并在自定义受众中添加用户 .

使用此代码,我可以成功创建自定义受众群体,但当我尝试将用户添加到自定义受众群体时,则会出现以下错误 .

Uncaught exception 'FacebookAds\Http\Exception\AuthorizationException' with message '(#2650) Failed to update the custom audience: This audience was created from data source EVENT_BASED.WEB_PIXEL_HITS, which does not support data source FILE_IMPORTED.HASHES_OR_USER_IDS

我也可以提供我正在尝试的示例代码,但我使用上面链接中提到的相同代码 .

任何人都可以告诉我,可能的解决方案是什么?

1 回答

  • 1

    从错误消息中,我猜你应该将 sub_type 设置为 CUSTOM ,而不是 WEB_PIXELS_HITS . 下面的示例使用Java SDK:

    CustomAudience audience = account.createCustomAudience()
        .setName("Created by Java SDK")
        .setDescription("Test Custom Audience")
        .setSubtype(EnumSubtype.VALUE_CUSTOM)
        .execute();
    

相关问题