Pixel Filters

The plugin has a few filters that will help developers to call each pixel programatically:

Facebook – pys_facebook_ids
Google Ads – pys_google_ads_ids
Google Analytics – pys_ga_ids

Example: if you need to separate statistics for registered users and non-registered users, you can use this Snippet:

add_filter( ‘pys_facebook_ids’, ‘pys_pixel’ );
function pys_pixel($ids){
if(is_user_logged_in()) {
return array([“custom facebook token”]);
}
return $ids;
}

Callback pys_pixel receives an array of Pixel IDs and returns a custom ID for registered users.

Table of Contents
Learn about iOS 14 and Facebook Aggregated Event Measurement