Look at the URL or Page Title and sees if it matches any existing Goal definition

@param int $idSite
@param Action $action
@throws Exception
@return array[] Goals matched
343549
public function detectGoalsMatchingUrl($idSite, $action)
    {
        if (!Common::isGoalPluginEnabled()) {
            return array();
        }

        $goals = $this->getGoalDefinitions($idSite);

        $convertedGoals = array();
        foreach ($goals as $goal) {
            $convertedUrl = $this->detectGoalMatch($goal, $action);
            if (!is_null($convertedUrl)) {
                $convertedGoals[] = array('url' => $convertedUrl) + $goal;
            }
        }
        return $convertedGoals;
    }
329169
public function any($path, $action = null)
    {
        return $this->match($path, HttpMethodRule::HTTP_METHOD_ANY, $action);
    }
1076745
public function getRoleForSite($idSite)
    {
        if ($this->hasSuperUserAccess
            || in_array($idSite, $this->getSitesIdWithAdminAccess())
        ) {
            return 'admin';
        }

        if (in_array($idSite, $this->getSitesIdWithWriteAccess())) {
            return 'write';
        }

        if (in_array($idSite, $this->getSitesIdWithViewAccess())) {
            return 'view';
        }

        return 'noaccess';
    }
549375
public function addAction($action, $actionParams)
    {
        // check if valid rule usage for object_type_id
        $this->validateRule("Actions", $action);
        // get required parameters for specific rule
        $requiredParams = Actions::GetRequiredParams($action);
        // checking for missing and invalid parameters
        $exception = false;
        if ($action == Actions::PING_URL)
        {
            $exception = true;
        }
        $check_params = $this->_checkParams($requiredParams, $actionParams, $exception);
        // if no missing or invalid rule parameters
        if ($check_params)
        {
            $rule = $action;
            // special formatting for ping_url
            if ($action == Actions::PING_URL)
            {
                $formatted = $this->_formatParams($actionParams, "::");
                $this->_actions[] = $action . "(" . $formatted . ")";

                return $this->_actions;
            }
            // general formatting for actions
            $value = $this->_formatParams($actionParams);
            $formatted = "(" . $value . ")";
            $this->_actions[] = $rule . $formatted;

            return $this->_actions;
        }
        return false;
    }
301792
public function getSiteUrlsFromId($idSite)
    {
        $urls = $this->getAliasSiteUrlsFromId($idSite);
        $site = $this->getSiteFromId($idSite);

        if (empty($site)) {
            return $urls;
        }

        return array_merge(array($site['main_url']), $urls);
    }
187436
private function getSitesFromIds($idSites, $limit = false)
    {
        $sites = $this->getModel()->getSitesFromIds($idSites, $limit);

        foreach ($sites as &$site) {
            $this->enrichSite($site);
        }

        $sites = Site::setSitesFromArray($sites);

        return $sites;
    }
471903
private function validateControllerAction($controllerAction)
    {
        $result = $this->controllerNameConverter->parse($controllerAction);

        list($class, $method) = explode('::', $result);

        if (!method_exists($class, $method)) {
            $reflector = new \ReflectionClass($class);

            throw new \Exception(sprintf(
                'Controller Action "%s" not exist in "%s" (looked into: %s).',
                $method,
                $class,
                $reflector->getFileName()
            ));
        }
    }
1135940
public function match($methods, $uri, $action)
    {
        return $this->router->match($methods, $uri, $action);
    }
1180315
public function getSiteFromId($idSite)
    {
        $db = $this->getDb();
        $site = $db->fetchRow("SELECT * FROM " . $this->table . "
                               WHERE idsite = ?", $idSite);

        return $site;
    }
71909
public function any( $uri, $action = null )
	{
		$verbs = ['GET', 'HEAD', 'POST', 'PUT', 'PATCH', 'DELETE'];

		return $this->addRoute( $verbs, $uri, $action );
	}
69440
public function isValidReportForSite($idSite, $apiMethodUniqueId)
    {
        $report = $this->getReportMetadataByUniqueId($idSite, $apiMethodUniqueId);

        return !empty($report);
    }
331786
private function getActionFromMatch($match = array())
    {
        $target = explode("#", $match["target"]);

        if (count($target) > 1) {
            return $target[1];
        }

        if (array_key_exists("action", $match["params"])) {
            return $this->getActionFromParam($match["params"]["action"]);
        }

        $this->controller->request = new Request();
        if (is_admin() && $this->controller->request->hasGet('page')) {
            return $this->controller->request->get('page');
            // When no method is sent, guesstimate from the action post value (ex: basic ajax)
        } elseif ($this->controller->request->hasPost('action')) {
            return $this->controller->request->post('action');
        }
    }
916181
public function any($uri, $action)
    {
        $uri = $this->buildUri($uri);

        return Route::any($uri, $action);
    }
139555
public function getPageUrls($idSite, $period, $date, $segment = false, $expanded = false, $idSubtable = false,
                                $depth = false, $flat = false)
    {
        Piwik::checkUserHasViewAccess($idSite);

        $dataTable = Archive::createDataTableFromArchive('Actions_actions_url', $idSite, $period, $date, $segment, $expanded, $flat, $idSubtable, $depth);

        $this->filterActionsDataTable($dataTable, Action::TYPE_PAGE_URL);

        if ($flat) {
            $dataTable->filter(function(DataTable $dataTable) {
                foreach ($dataTable->getRows() as $row) {
                    $label = $row->getColumn('label');
                    if (substr($label, 0, 1) !== '/' && $label != Piwik::translate('General_NotDefined', Piwik::translate('Actions_ColumnPageURL'))) {
                        $row->setColumn('label', '/'.$label);
                    }
                }
            });
        }

        return $dataTable;
    }
1250681
public function match($path, $method, $action = null)
    {
        $rule = new HttpMethodRule();
        $rule->setPath($path);
        $rule->setMethod($method);
        $rule->setAction($action);
        $rule->setGroup($this);
        $this->children[] = $rule;
        return $rule;
    }
768062
public function getAll($idSite = false)
    {
        if (!empty($idSite)) {
            Piwik::checkUserHasViewAccess($idSite);
        } else {
            Piwik::checkUserHasSomeViewAccess();
        }

        $userLogin = Piwik::getCurrentUserLogin();

        $model = $this->getModel();
        if(Piwik::hasUserSuperUserAccess()) {
            $segments = $model->getAllSegmentsForAllUsers($idSite);
        } else {
            if (empty($idSite)) {
                $segments = $model->getAllSegments($userLogin);
            } else {
                $segments = $model->getAllSegmentsForSite($idSite, $userLogin);
            }
        }

        $segments = $this->sortSegmentsCreatedByUserFirst($segments);

        return $segments;
    }
1157546
public function getEntryPageTitles($idSite, $period, $date, $segment = false, $expanded = false,
                                       $idSubtable = false, $flat = false)
    {
        Piwik::checkUserHasViewAccess($idSite);

        $dataTable = $this->getPageTitles($idSite, $period, $date, $segment, $expanded, $idSubtable, $flat);
        $this->filterNonEntryActions($dataTable);
        return $dataTable;
    }