John Davidson

php - Facebook CAPI PageView Event Missing Some Deduplication Parameters Parameter


I have two problems with Facebook CAPI. I'm using facebook php business sdk

PageView Event Missing Some Deduplication Parameters Parameter

It's showing in every event in Event Manager (PageView, ViewContent, Lead) and I don't know why I haven't dedupi keys shown with CAPI in View Details, but It appears in Test mode. Example:


if(!isset($_COOKIE['USERID']) || empty($_COOKIE['USERID'])){
$externalId = FacebookCapiSettings::getExternalId();
setcookie('USERID', $externalId, time()+14*24*3600);
$_COOKIE['USERID'] = $externalId;

$access_token = FacebookCapiSettings::getAccessToken();
$pixel_id = FacebookCapiSettings::getPixelId();

$api = Api::init(null, null, $access_token);
$api->setLogger(new CurlLogger());
$user_data = (new UserData())
// It is recommended to send Client IP and User Agent for Conversions API Events.

$eventSourceUrl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";

$event = (new Event())

$events = array();
array_push($events, $event);

$request = (new EventRequest($pixel_id))
$response = $request->execute();

  • Event ID as setEventId(FacebookCapiPageView::getEventId())

  • External ID as setExternalId($_COOKIE['USERID'])

  • FBP as setFbp($_COOKIE['_fbp']);

Server Sending Invalid External ID Parameter.

It's showing only with PageView Event Matching


        <!-- Facebook Pixel -->
s.parentNode.insertBefore(t,s)}(window, document,'script',
fbq( 'init', '<?php echo FacebookCapiSettings::getPixelId(); ?>', {'external_id': '<?php echo $_COOKIE['USERID']; ?>'<?php echo $userDataString; ?>} );
fbq( 'track', 'PageView', {}, {eventID: '<?php echo FacebookCapiPageView::getEventId(); ?>'} );
<noscript><img height="1" width="1" style="display:none"
src="<?php echo FacebookCapiSettings::getPixelId(); ?>&ev=PageView&noscript=1"
<!--/ Facebook Pixel -->

What I did wrong and how I could repair my errors in Facebook Events Manager?

My Answer:
> I recommend checking the implementation of your deduplication keys in your code. Make sure that you are passing the necessary parameters for deduplication in your PageView event.

> Additionally, ensure that your deduplication parameters are correctly set up in your Facebook Business Manager settings. Double-check that the deduplication keys are properly configured for your pixel.

> If the deduplication keys are showing in Test mode but not in live events, it could be a configuration issue. Review your code and settings to ensure that everything is set up correctly for live events to capture the deduplication parameters.

> If you continue to experience issues, consider reaching out to Facebook support for further assistance with troubleshooting the problem.

Rate this post

3 of 5 based on 1868 votes


© 2024 - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us