Facebook Ads API to update “Customer List: Value-based”

前端 未结 2 1173
夕颜
夕颜 2021-01-26 11:57

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 \"valu

相关标签:
2条回答
  • 2021-01-26 12:46

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

    FacebookAds\Object\Fields\CustomAudienceMultikeySchemaFields::LOOKALIKE_VALUE
    

    In "facebook/php-business-sdk": "^6.0.0"

    0 讨论(0)
  • 2021-01-26 12:55

    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.

    0 讨论(0)
提交回复
热议问题