I'm trying to sync a custom audience with the php fb sdk. My script looks like this:
foreach ($users->pluck('email') as $email) {
$hashed[] = [hash('sha256', $email)];
}
try {
(new CustomAudience('custom-audience-id'))
->createUsersReplace([], [
'payload' => [
'schema' => [
'EMAIL',
],
'data' => $hashed,
],
'session' => [
'session_id' => rand(1, 10000000),
'batch_seq' => 1,
'last_batch_flag' => true,
'estimated_num_total' => count($hashed),
],
]);
} catch (Exception $ex) {
$this->info($ex->getMessage());
}
The script runs successfully, when I look into the history tab FB is telling me the x records have been replaced successfully:
However, the size is not updated (after processing for a couple of hours):
When I upload the records manually through an excel sheet the size is updated correctly. Obviously, something is wrong with my PHP script but can't figure out what's wrong.