I am trying to add user to 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 I am getting error in both codes
(#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
Following code I am using to 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 I can solve this?