Developer Docs
Table of Contents
Here’s an overview of all available actions and filters in CAOS which allow WordPress developers to manipulate and/or add to CAOS’ functioning using custom plugins.
caos_exclude_from_tracking
Use this filter to exclude certain pages and/or users from tracking. For example, to filter your IP address when you’re logged in, use the following example:
add_filter('caos_exclude_from_tracking', 'daan_exclude_ip_address');
function daan_exclude_ip_address($exclude) {
if (is_user_logged_in()) {
return $exclude;
}
return isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] === 'YOUR.IP.ADDRESS';
}
Code language: PHP (php)
caos_gtag_additional_config
Use this filter to add additional configurational tags to the tracking code.
Tracking additional Measurement IDs
add_filter('caos_gtag_additional_config', 'daan_add_additional_ids');
function daan_add_additional_ids() {
echo "gtag('config', 'G-123ABC456');"; // Replace with your Measurement ID.
}
Code language: PHP (php)