php - How to add user to facebook custom audience -


i trying add user custom audience using following code

$audience = new customaudience($custom_audience_id); $audience->addusers(array(trim($mailaddress)), customaudiencetypes::email); 

and

$users = array(  array('fname', 'lname', 'someone@example.com'),  array('fnamenew', 'lnamenew', 'someone_new@example.com'), );  $schema = array(   customaudiencemultikeyschemafields::first_name,   customaudiencemultikeyschemafields::last_name,   customaudiencemultikeyschemafields::email, );  $audience = new customaudiencemultikey(<custom_audience_id>);  $audience->addusers($users, $schema); 

but getting error in both codes

(#2650) failed update custom audience: audience created data source event_based.web_pixel_hits, not support data source file_imported.hashes_or_user_ids 

following code using create custom audience.

$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(); 

any suggestion how can solve this?

you can add user custom audience created through emails, while code shown in creating audience based on user activities on website. can follow doc create custom audience through email: https://developers.facebook.com/docs/marketing-api/audiences-api#build

and in ads, can combine 2 audience (from emails and/


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -