简体   繁体   中英

Why is FB/Meta Conversions API not deduplicating my events even though they have the same name and eventID?

I send the same event to Facebooks Event Manager from FB pixel and Conversions API. I have made sure that the event name and eventID are the exact same, and that the server event is sent after the browser event.

The events are not deduplicated in Event Manager. I have looked through the documentation but can´t find anything missing.

I have tried on several different types of events and waited more than 24 hours.

The Pixel event is sent like this;

    fbq('track', 'PageView', {test: 'test'}, {eventID: 'PageView'+uniqueid});

And i use Facebook Business SDK for PHP to send server events;

Api::init(null, null, $access_token, false);


$user_data = (new UserData())
    ->setClientIpAddress($_SERVER['REMOTE_ADDR'])
    ->setClientUserAgent($_SERVER['HTTP_USER_AGENT']);

$event = (new Event())
    ->setEventName($eventname)
    ->setEventId($eventid)
    ->setEventTime(time())
    ->setEventSourceUrl($_SERVER['HTTP_REFERER'])
    ->setUserData($user_data);

return array($event);
}

$request = (new EventRequest($pixel_id))
->setTestEventCode('TESTXXXX')
->setEvents(create_events($eventid, $eventname));
$response = $request->execute();

Here is an example of an event that is not deduplicated;

两个事件的例子

It seems to be working fine when using a public server instead a local one.

Then i also get the users IP-address in the server event. I guess the IP address differs between the pixel and the PHP variable $_SERVER['REMOTE_ADDR'] locally (127.0.0.1) and that is what prevents the server event to be deduplicated.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM