Facebook Ads API更新“客户列表:基于价值” [英] Facebook Ads API to update "Customer List: Value-based"

查看:198
本文介绍了Facebook Ads API更新“客户列表:基于价值”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个类型为客户列表:基于价值的自定义受众。



然后我用它来创建一个基于价值的观众群 / p>

基于价值的Lookalike的文档观众在这里



但是我想知道的是:



如何使用PHP SDK通过API更新客户列表:基于价值类型的自定义受众?



(然后,更改将流向观众,这是我在广告定位中使用的。)



我找不到文档。



PS Facebook的丁张鼓励我在这里提出问题,因为我到达FB的人都不愿意直接回答我的问题。有什么好的FB开发者在那里?你得到了能够回答这个问题的要点!

解决方案

我终于找到了一些文档在这里

 使用FacebookAds\Object\CustomAudienceMultiKey; 
使用FacebookAds\Object\CustomAudienceNormalizers\HashNormalizer;
使用FacebookAds\Object\Fields\CustomAudienceMultikeySchemaFields;

$ users = array(
array('test1@example.com',44.5),
数组('test2@example.com',140),
array('test3@example.com',0),
array('test4@example.com',0.9),
);

foreach($ users as& $ user){
$ user [0] = hash(HashNormalizer :: HASH_TYPE_SHA256,$ user [0]);
}

$ schema = array(
CustomAudienceMultikeySchemaFields :: EMAIL,
'LOOKALIKE_VALUE',
);

$ audience = new CustomAudienceMultiKey('< CUSTOM_AUDIENCE_ID>');
$ audience-> addUsers($ users,$ schema,true);

我很高兴尝试一下。



PS我仍然找不到'LOOKALIKE_VALUE的 magic string 在SDK中引用或定义



这篇博文是我第一次发现这个文档后, >小时的Google搜索。


I created a Custom Audience of type "Customer List: Value-based".

I then used that to create a "value-based Lookalike Audience".

The documentation for "value-based Lookalike Audience" is here.

But what I want to know is:

How can I use the PHP SDK to update my Custom Audience of type "Customer List: Value-based" via the API?

(Then, the changes will flow through to the lookalike audience, which is what I use in my ads targeting.)

I cannot find documentation.

P.S. Ding Zhang of Facebook encouraged me to ask the question here since none of the people I reached at FB were willing to answer my question directly. Any awesome FB developers out there? You get major points for being able to answer this one!

解决方案

I finally found some documentation here.

use FacebookAds\Object\CustomAudienceMultiKey;
use FacebookAds\Object\CustomAudienceNormalizers\HashNormalizer;
use FacebookAds\Object\Fields\CustomAudienceMultikeySchemaFields;

$users = array(
  array('test1@example.com', 44.5),
  array('test2@example.com', 140),
  array('test3@example.com', 0),
  array('test4@example.com', 0.9),
);

foreach ($users as &$user) {
  $user[0] = hash(HashNormalizer::HASH_TYPE_SHA256, $user[0]);
}

$schema = array(
  CustomAudienceMultikeySchemaFields::EMAIL,
  'LOOKALIKE_VALUE',
);

$audience = new CustomAudienceMultiKey('<CUSTOM_AUDIENCE_ID>');
$audience->addUsers($users, $schema, true);

I'm excited to try this out.

P.S. I still can't find the "magic string" of 'LOOKALIKE_VALUE' referenced or defined anywhere in the SDK.

This blog post was how I first found this documentation after hours of Google searches.

这篇关于Facebook Ads API更新“客户列表:基于价值”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆