为什么将用户添加到自定义受众中php api sdk调用被视为FILE_IMPORTED HASHES_OR_USER_IDS

时间:2016-11-09 05:43:21

标签: facebook facebook-graph-api facebook-php-sdk facebook-marketing-api

我正在使用以下代码创建自定义受众群体。

$audience = new CustomAudience(null, $accountId);
$audience->setData(array(
          CustomAudienceFields::NAME            => $associative_arr['name'],
          CustomAudienceFields::PIXEL_ID        => $associative_arr['pixelId'],
          CustomAudienceFields::DESCRIPTION     => $associative_arr['description'],
          CustomAudienceFields::RETENTION_DAYS  => $associative_arr['retensionDays'],  
          CustomAudienceFields::SUBTYPE         => CustomAudienceSubtypes::WEBSITE,
          CustomAudienceFields::RULE            => array('url' => array('i_contains' => $associative_arr['websiteUrl'])),
          CustomAudienceFields::PREFILL         => $associative_arr['prefill'],
          CustomAudienceFields::DATA_SOURCE     => array('EVENT_BASED' => 'WEB_PIXEL_HITS')
        ));         
$audience->create();

之后,我使用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 个答案:

答案 0 :(得分:0)

您可以通过网站流量(像素),应用互动,客户文件或Fb上的互动来创建自定义受众群体。如果您从网站流量(Pixel)创建受众群体,则无法像在客户文件中创建受众群体时那样将用户添加到受众群体。