Disable send all pixels events, can by used for custom gdpr
Param: bool $status
add_filter('pys_disable_by_gdpr',function ($status) {
if(get_current_user_id() == 0 ) {
return true;
}
return $status;
});
{pixel} - facebook, google_ads, ga, tiktok, pinterest, bing
Disable some pixel events, can by used for custom gdpr
Param: bool $status
add_filter('pys_disable_facebook_by_gdpr',function ($status) {
if(get_current_user_id() == 0 ) {
return true;
}
return $status;
});
Load latest gdpr pixel status before load web pixel. Can by used when server use page caching
Param: bool $status
add_filter('pys_gdpr_ajax_enabled',function ($status) {
if(get_current_user_id() == 0 ) {
return true;
}
return $status;
});
Allows developers to programmatically override consent status for GDPR compliance. Receives the current consent value, allowing you to customize logic to determine whether consent should be enabled or disabled. Useful for integrating with third-party consent management solutions or custom privacy workflows.
Param: bool $status
add_filter('pys_check_consent_by_gdpr',function ($status) {
if(get_current_user_id() == 0 ) {
return true;
}
return $status;
});
Param: array $data, string $slug ,any $context
add_filter('pys_event_data',function ($data,$slug,$context) {
if(get_current_user_id() == 0 ) {
$data['params']['total'] = 0;
}
return $data;
},10,3);
Param: array $currencies
add_filter('pys_currencies_list',function ($currencies) {
$currencies['PTH'] = 'Test';
return $currencies;
});
pys_edd_checkout_order_id - Edd plugin
pys_woo_checkout_order_id - WooCommerce plugin
Can by user for custom checkout page
Param: int $order_id
add_filter('pys_woo_checkout_order_id',function ($order_id) {
if(isset($_GET['custom_order_param_with_id'])) {
return $_GET['custom_order_param_with_id'];
}
return $order_id;
});
You can disable some events depend on your logic
Param: bool $isActive, \PixelYourSite\PYSEvent $event, \PixelYourSite\Settings $pixel
add_filter('pys_validate_pixel_event',function ($isActive,$event,$pixel) {
if($pixel->getSlug() == "facebook"
&& $event->getId() == "woo_purchase"
&& get_current_user_id() == 0
) {
return false;
}
return $isActive;
},10,3);
Param: bool $status
add_filter('pys_disable_server_event_filter',function ($status) {
if(get_current_user_id() == 0 ) {
return true;
}
return $status;
});
Param: FacebookAds\Object\ServerSide\Event $event,string $pixel_Id, string $eventId
add_filter('pys_before_send_fb_server_event',function ($event,$pixel_Id,$eventId) {
if(get_current_user_id() == 0 ) {
$event->setActionSource("not_registered");
}
return $event;
},10,3);
Param: bool $isActive,string $pixelSlug
Return: Array
add_filter('pys_pixel_disabled',function ($isActive,$pixelSlug) {
if(get_current_user_id() == 0 && $pixelSlug == 'facebook') {
return ['all']; // Disable all pixels
}
return $isActive;
},11,2);
add_filter('pys_pixel_disabled',function ($isActive,$pixelSlug) {
if(get_current_user_id() == 0 && $pixelSlug == 'facebook') {
return ['1123450378576095', '1300447800692613']; // Disables pixels that are in the array
}
return $isActive;
},11,2);
{pixel} - facebook, google_ads, ga, tiktok, pinterest, bing
Param: array $ids
add_filter('pys_facebook_ids',function ($ids) {
if(get_current_user_id() == 0) {
$ids[]='CUSTOM_PIXEL_ID';
}
return $ids;
});
Param: array $params
add_filter('pys_fb_advanced_matching',function ($params) {
if(get_current_user_id() == 0) {
$params['fn'] = "not_registered";
$params['ln'] = "not_registered";
}
return $params;
});
Param: \PYS_PRO_GLOBAL\FacebookAds\Object\ServerSide\UserData $userData
add_filter('pys_fb_server_user_data',function ($userData) {
if(get_current_user_id() == 0) {
$userData->setFirstName("undefined");
$userData->setLastName("undefined");
$userData->setEmail("undefined");
}
return $userData;
});
disable all PYS cookies
Param: bool $status
add_filter('pys_disable_all_cookie',function ($status) {
$user = wp_get_current_user();
$roles = ( array ) $user->roles;
if(in_array('administrator', $roles) ) {
return true;
}
return $status;
});
there are also filters to disable certain groups of cookies that work on the same principle
pys_disabled_start_session_cookie - disable start_session & session_limit cookie
pys_disable_first_visit_cookie - disable pys_first_visit cookie
pys_disable_landing_page_cookie - disable pys_landing_page & last_pys_landing_page cookies
pys_disable_trafficsource_cookie - disable pysTrafficSource & last_pysTrafficSource cookies
pys_disable_utmTerms_cookie - disable ['utm_source', 'utm_medium', 'utm_campaign', 'utm_content' ,'utm_term'] with prefix pys_ and last_pys_ cookies
pys_disable_utmId_cookie - disable ['fbadid', 'gadid', 'padid', 'bingid'] with prefix pys_ and last_pys_ cookies
pys_disable_advance_data_cookie - disable pys_advanced_data cookies
pys_disable_externalID_by_gdpr - disable pbid(external_id) cookie
{mode name} - analytics_storage, ad_storage, ad_user_data, ad_personalization
Param: bool $mod
add_filter('pys_analytics_storage_mode',function ($mode) {
if(get_current_user_id() == 0) {
return true;
}
return $mode;
});
Fire the pixel with consent mode "analytics_storage": "granted"
Param: bool $mode
add_filter('pys_bing_ad_storage_mode',function ($mode) {
if(get_current_user_id() == 0) {
return true;
}
return $mode;
});
Fire the Bing with consent mode "ad_storage": "granted"
Param: bool $status
add_filter('pys_url_passthrough_mode',function ($status) {
if(get_current_user_id() == 0) {
return true;
}
return $status;
});
Param: bool $status
add_filter('pys_meta_ldu_mode',function ($status) {
if(get_current_user_id() == 0) {
return true;
}
return $status;
});
Param: bool $status
add_filter('pys_send_meta_id',function ($status) {
if(get_current_user_id() == 1) {
return false;
}
return $status;
});
Param: bool $status
add_filter('pys_reddit_ldu_mode',function ($status) {
if(get_current_user_id() == 0) {
return true;
}
return $status;
});