public function isExcluded()
    {
        $excluded = false;

        if ($this->isNonHumanBot()) {
            Common::printDebug('Search bot detected, visit excluded');
            $excluded = true;
        }

        /*
         * Requests built with piwik.js will contain a rec=1 parameter. This is used as
         * an indication that the request is made by a JS enabled device. By default, Piwik
         * doesn't track non-JS visitors.
         */
        if (!$excluded) {
            $toRecord = $this->request->getParam($parameterForceRecord = 'rec');
            if (!$toRecord) {
                Common::printDebug(@$_SERVER['REQUEST_METHOD'] . ' parameter ' . $parameterForceRecord . ' not found in URL, request excluded');
                $excluded = true;
                Common::printDebug("'$parameterForceRecord' parameter not found.");
            }
        }

        /**
         * Triggered on every tracking request.
         *
         * This event can be used to tell the Tracker not to record this particular action or visit.
         *
         * @param bool &$excluded Whether the request should be excluded or not. Initialized
         *                        to `false`. Event subscribers should set it to `true` in
         *                        order to exclude the request.
         * @param Request $request The request object which contains all of the request's information
         *
         */
        Piwik::postEvent('Tracker.isExcludedVisit', array(&$excluded, $this->request));

        /*
         * Following exclude operations happen after the hook.
         * These are of higher priority and should not be overwritten by plugins.
         */

        // Checking if the Piwik ignore cookie is set
        if (!$excluded) {
            $excluded = $this->isIgnoreCookieFound();
            if ($excluded) {
                Common::printDebug("Ignore cookie found.");
            }
        }

        // Checking for excluded IPs
        if (!$excluded) {
            $excluded = $this->isVisitorIpExcluded();
            if ($excluded) {
                Common::printDebug("IP excluded.");
            }
        }

        // Check if user agent should be excluded
        if (!$excluded) {
            $excluded = $this->isUserAgentExcluded();
            if ($excluded) {
                Common::printDebug("User agent excluded.");
            }
        }

        // Check if Referrer URL is a known spam
        if (!$excluded) {
            $excluded = $this->isReferrerSpamExcluded();
            if ($excluded) {
                Common::printDebug("Referrer URL is blacklisted as spam.");
            }
        }

        // Check if request URL is excluded
        if (!$excluded) {
            $excluded = $this->isUrlExcluded();
            if ($excluded) {
                Common::printDebug("Unknown URL is not allowed to track.");
            }
        }

        if (!$excluded) {
            if ($this->isPrefetchDetected()) {
                $excluded = true;
                Common::printDebug("Prefetch request detected, not a real visit so we Ignore this visit/pageview");
            }
        }

        if ($excluded) {
            Common::printDebug("Visitor excluded.");
            return true;
        }

        return false;
    }
public function isExcluded()
    {
        $excluded = false;

        if ($this->isNonHumanBot()) {
            Common::printDebug('Search bot detected, visit excluded');
            $excluded = true;
        }

        /*
         * Requests built with piwik.js will contain a rec=1 parameter. This is used as
         * an indication that the request is made by a JS enabled device. By default, Piwik
         * doesn't track non-JS visitors.
         */
        if (!$excluded) {
            $toRecord = $this->request->getParam($parameterForceRecord = 'rec');
            if (!$toRecord) {
                Common::printDebug(@$_SERVER['REQUEST_METHOD'] . ' parameter ' . $parameterForceRecord . ' not found in URL, request excluded');
                $excluded = true;
                Common::printDebug("'$parameterForceRecord' parameter not found.");
            }
        }

        /**
         * Triggered on every tracking request.
         *
         * This event can be used to tell the Tracker not to record this particular action or visit.
         *
         * @param bool &$excluded Whether the request should be excluded or not. Initialized
         *                        to `false`. Event subscribers should set it to `true` in
         *                        order to exclude the request.
         * @param Request $request The request object which contains all of the request's information
         *
         */
        Piwik::postEvent('Tracker.isExcludedVisit', array(&$excluded, $this->request));

        /*
         * Following exclude operations happen after the hook.
         * These are of higher priority and should not be overwritten by plugins.
         */

        // Checking if the Piwik ignore cookie is set
        if (!$excluded) {
            $excluded = $this->isIgnoreCookieFound();
            if ($excluded) {
                Common::printDebug("Ignore cookie found.");
            }
        }

        // Checking for excluded IPs
        if (!$excluded) {
            $excluded = $this->isVisitorIpExcluded();
            if ($excluded) {
                Common::printDebug("IP excluded.");
            }
        }

        // Check if user agent should be excluded
        if (!$excluded) {
            $excluded = $this->isUserAgentExcluded();
            if ($excluded) {
                Common::printDebug("User agent excluded.");
            }
        }

        // Check if Referrer URL is a known spam
        if (!$excluded) {
            $excluded = $this->isReferrerSpamExcluded();
            if ($excluded) {
                Common::printDebug("Referrer URL is blacklisted as spam.");
            }
        }

        // Check if request URL is excluded
        if (!$excluded) {
            $excluded = $this->isUrlExcluded();
            if ($excluded) {
                Common::printDebug("Unknown URL is not allowed to track.");
            }
        }

        if (!$excluded) {
            if ($this->isPrefetchDetected()) {
                $excluded = true;
                Common::printDebug("Prefetch request detected, not a real visit so we Ignore this visit/pageview");
            }
        }

        if ($excluded) {
            Common::printDebug("Visitor excluded.");
            return true;
        }

        return false;
    }
public function isExcluded ( ) { $ excluded = false ; if ( $ this -> isNonHumanBot ( ) ) { Common :: printDebug ( 'Search bot detected, visit excluded' ) ; $ excluded = true ; } /*
         * Requests built with piwik.js will contain a rec=1 parameter. This is used as
         * an indication that the request is made by a JS enabled device. By default, Piwik
         * doesn't track non-JS visitors.
         */ if ( ! $ excluded ) { $ toRecord = $ this -> request -> getParam ( $ parameterForceRecord = 'rec' ) ; if ( ! $ toRecord ) { Common :: printDebug ( @ $ _SERVER [ 'REQUEST_METHOD' ] . ' parameter ' . $ parameterForceRecord . ' not found in URL, request excluded' ) ; $ excluded = true ; Common :: printDebug ( "'$parameterForceRecord' parameter not found." ) ; } } /**
         * Triggered on every tracking request.
         *
         * This event can be used to tell the Tracker not to record this particular action or visit.
         *
         * @param bool &$excluded Whether the request should be excluded or not. Initialized
         *                        to `false`. Event subscribers should set it to `true` in
         *                        order to exclude the request.
         * @param Request $request The request object which contains all of the request's information
         *
         */ Piwik :: postEvent ( 'Tracker.isExcludedVisit' , array ( & $ excluded , $ this -> request ) ) ; /*
         * Following exclude operations happen after the hook.
         * These are of higher priority and should not be overwritten by plugins.
         */ // Checking if the Piwik ignore cookie is set if ( ! $ excluded ) { $ excluded = $ this -> isIgnoreCookieFound ( ) ; if ( $ excluded ) { Common :: printDebug ( "Ignore cookie found." ) ; } } // Checking for excluded IPs if ( ! $ excluded ) { $ excluded = $ this -> isVisitorIpExcluded ( ) ; if ( $ excluded ) { Common :: printDebug ( "IP excluded." ) ; } } // Check if user agent should be excluded if ( ! $ excluded ) { $ excluded = $ this -> isUserAgentExcluded ( ) ; if ( $ excluded ) { Common :: printDebug ( "User agent excluded." ) ; } } // Check if Referrer URL is a known spam if ( ! $ excluded ) { $ excluded = $ this -> isReferrerSpamExcluded ( ) ; if ( $ excluded ) { Common :: printDebug ( "Referrer URL is blacklisted as spam." ) ; } } // Check if request URL is excluded if ( ! $ excluded ) { $ excluded = $ this -> isUrlExcluded ( ) ; if ( $ excluded ) { Common :: printDebug ( "Unknown URL is not allowed to track." ) ; } } if ( ! $ excluded ) { if ( $ this -> isPrefetchDetected ( ) ) { $ excluded = true ; Common :: printDebug ( "Prefetch request detected, not a real visit so we Ignore this visit/pageview" ) ; } } if ( $ excluded ) { Common :: printDebug ( "Visitor excluded." ) ; return true ; } return false ; }
Test if the current visitor is excluded from the statistics.

Plugins can for example exclude visitors based on the
- IP
- If a given cookie is found

@return bool True if the visit must not be saved, false otherwise
Test if the current visitor is excluded from the statistics .