pys_disable_by_gdpr - Disable send all pixels events

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;
});

pys_disable_{pixel}_by_gdpr - Disable send pixel events

{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;
});

pys_gdpr_ajax_enabled - Update gdpr pixel 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;
});

pys_check_consent_by_gdpr - Consent status for GDPR

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;
});

pys_event_data - Edit or add custom data to event

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);

pys_currencies_list - Add new currency in list, for custom events

Param: array $currencies

add_filter('pys_currencies_list',function ($currencies) {
    $currencies['PTH'] = 'Test';
    return $currencies;
});

pys_{edd or woo}_checkout_order_id - Use custom order id for purchase event

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;
});

pys_validate_pixel_event - Disable some events

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);

pys_disable_server_event_filter - Disable Facebook server events

Param: bool $status

add_filter('pys_disable_server_event_filter',function ($status) {
    if(get_current_user_id() == 0 ) {
        return true;
    }
    return $status;
});

pys_before_send_fb_server_event - Add custom data to Facebook server event

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);

pys_pixel_disabled - Disable Pixel

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);

pys_{pixel}_ids - Add custom Pixel id

{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;
});

pys_fb_advanced_matching - Add or edit facebook advanced matching params

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;
    });

pys_fb_server_user_data - Add or edit facebook server user data

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;
    });

pys_disable_all_cookie

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

pys_{mode name}_mode - Fire pixel with Google consent mode

{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"

pys_bing_ad_storage_mode - Fire the Bing with consent mode

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"

pys_url_passthrough_mode - The filter turn ON/OFF the url_passthrough option

Param: bool $status

        add_filter('pys_url_passthrough_mode',function ($status) {
            if(get_current_user_id() == 0) {
                return true;
            }
        return $status;
    });

pys_meta_ldu_mode - The filter turn ON/OFF Meta Limited Data Use option

Param: bool $status

add_filter('pys_meta_ldu_mode',function ($status) {
if(get_current_user_id() == 0) {
    return true;
}
return $status;
});

pys_send_meta_id - The filter allow/disallow sending the fb_login_id parameter from Social connect plugin

Param: bool $status

add_filter('pys_send_meta_id',function ($status) {
    if(get_current_user_id() == 1) {
        return false;
    }
    return $status;
});

pys_reddit_ldu_mode - The filter turn ON/OFF Reddit Limited Data Use option

Param: bool $status

add_filter('pys_reddit_ldu_mode',function ($status) {
    if(get_current_user_id() == 0) {
        return true;
    }
    return $status;
});