Answers the analytics tracking ID from site or YAML configuration.

@return string
970790
public function getAnalyticsTrackingID()
    {
        $id = SiteConfig::current_site_config()->GoogleAnalyticsTrackingID;
        
        if (!$id) {
            $id = self::config()->analytics_tracking_id;
        }
        
        return $id;
    }
1367015
public function getSitesId()
    {
        $result = Db::fetchAll("SELECT idsite FROM " . Common::prefixTable('site'));

        $idSites = array();
        foreach ($result as $idSite) {
            $idSites[] = $idSite['idsite'];
        }

        return $idSites;
    }
536080
public function getId()
    {
        if (is_null($this->_id)) {
            $this->_id = md5(serialize($this->instructions));
        }

        return $this->_id;
    }
944326
private function getAnalyticsProviders()
    {
        $providers = Yii::app()->cache->get('analyticsjs_providers');

        if ($providers === false)
        {
            $analytics = new AnalyticsSettings;
            $rules = $analytics->rules();
            unset($analytics);

            // Init the array
            $providers = array();

            // Retrieve all the providors that are enabled
            $response = Yii::app()->db->createCommand('SELECT REPLACE(`key`, "analyticsjs_", "") AS `key`, value FROM `configuration` WHERE `key` LIKE "analyticsjs_%_enabled" AND value = 1')->queryAll();
            foreach ($response as $element)
            {
                $k = $element['key'];
                $provider = explode('_', str_replace("__", " " ,str_replace("___", ".", $k)));
                $provider = reset($provider);

                $sqlProvider = str_replace(" ", "__" ,str_replace(".", "___", $provider));
                $data = Yii::app()->db->createCommand('SELECT REPLACE(`key`, "analyticsjs_", "") AS `key`, value FROM `configuration` WHERE `key` LIKE "analyticsjs_' . $sqlProvider .'%" AND `key` != "analyticsjs_' . $sqlProvider .'_enabled"')->queryAll();

                foreach ($data as $el)
                {
                    $k = $el['key'];

                    $v = $el['value'];
                    $p = explode('_', str_replace("__", " " ,str_replace("___", ".", $k)));
                    if ($v !== "")
                    {
                        $thisRule = 'string';
                        foreach ($rules as $rule)
                        {
                            if (strpos($rule[0], 'analyticsjs_' . $k) !== false)
                                $thisRule = $rule[1];
                        }

                        if ($thisRule == 'boolean')
                        {
                            if ($v == "0")
                                $providers[$provider][$p[1]] = (bool)false;
                            else if ($v == "1")
                                $providers[$provider][$p[1]] = (bool)true;
                            else
                                $providers[$provider][$p[1]] = 'null';
                        }
                        else
                        {
                            if ($v == "" || $v == null || $v == "null")
                                $providers[$provider][$p[1]] = null;
                            else
                                $providers[$provider][$p[1]] = $v;
                        }

                    }
                }
            }
            
	    Yii::app()->cache->set('analyticsjs_providers', $providers);
        }
        
        return $providers;
    }
1012934
public function get_gitlab_id() {
		$id       = null;
		$response = isset( $this->response['project_id'] ) ? $this->response['project_id'] : false;

		if ( ! $response ) {
			self::$method = 'projects';
			$id           = implode( '/', [ $this->type->owner, $this->type->slug ] );
			$id           = rawurlencode( $id );
			$response     = $this->api( '/projects/' . $id );

			if ( $this->validate_response( $response ) ) {
				return $id;
			}

			if ( $response && $this->type->slug === $response->path ) {
				$id = $response->id;
				$this->set_repo_cache( 'project_id', $id );
				$this->set_repo_cache( 'project', $response );
			}

			return $id;
		}

		return $response;
	}
439532
public function get_target() {
        if ($this->target !== null) {
            return $this->target;
        }
        $instance = \core_analytics\manager::get_target($this->model->target);
        $this->target = $instance;

        return $this->target;
    }
185362
public function getTrackEngine()
    {
        static $engine;

        if ($engine instanceof \Gems_Tracker_Engine_TrackEngineInterface) {
            return $engine;
        }

        try {
            $respTrack = $this->getRespondentTrack();
            if ($respTrack instanceof \Gems_Tracker_RespondentTrack) {
                $engine = $respTrack->getTrackEngine();
            }

        } catch (\Exception $ex) {
        }

        if (! $engine instanceof \Gems_Tracker_Engine_TrackEngineInterface) {
            $trackId = $this->_getParam(\Gems_model::TRACK_ID);

            if (! $trackId) {
                if ($this->isMultiTracks()) {
                    throw new \Gems_Exception($this->_('No track engine specified!'));
                }

                $trackId = $this->escort->getTrackId();

                if (! $trackId) {
                    return null;
                }
            }

            $engine = $this->loader->getTracker()->getTrackEngine($trackId);
        }
        $engine->applyToMenuSource($this->menu->getParameterSource());

        return $engine;
    }
532183
public function _getTemplateId()
    {
        return isset($this->templateId) ? $this->templateId : $this->templateId =
            $this->smarty->_getTemplateId($this->template_resource, $this->cache_id, $this->compile_id);
    }
296591
public function getSitesIdWithAtLeastViewAccess()
    {
        $this->loadSitesIfNeeded();

        return array_unique(array_merge(
                $this->idsitesByAccess['view'],
                $this->idsitesByAccess['write'],
                $this->idsitesByAccess['admin'],
                $this->idsitesByAccess['superuser'])
        );
    }
449419
public function detectId()
    {
        // If there is an id, it will be the last number
        if (preg_match('#\d+$#', $this->path, $matches)) {
            return $matches[0];
        }

        // .. or the route will be an action preceeded by an id
        $pattern = '#(\d+)/('.implode('|', $this->actions).')$#i';
        if (preg_match($pattern, $this->path, $matches)) {
            return $matches[1];
        }

        // There's no id
        return false;
    }
1179990
public function getDiffAdditions()
    {
        $data = $this->getValueDiffData('getDiffAdditions');
        foreach ($this->tracker->getAdditions() as $name) {
            $data[$name] = $this->get($name)->getValues();
        }
        return $data;
    }
962062
public function getActCatId()
    {
        $sId = false;
        $aData = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("aSeoData");
        if ($aData && isset($aData["oxparams"])) {
            $oStr = getStr();
            $iStartPos = $oStr->strpos($aData["oxparams"], "#");
            $iEndPos = $oStr->strpos($aData["oxparams"], "#", $iStartPos + 1);
            $iLen = $oStr->strlen($aData["oxparams"]);

            $sId = $oStr->substr($aData["oxparams"], $iStartPos + 1, $iEndPos - $iLen);
        } elseif ($aList = $this->getSelectionList()) {
            $oItem = reset($aList[$this->getActCatType()][$this->getActCatLang()]);

            $sId = $oItem->getId();
        }

        return $sId;
    }
32924
public function getTrackingConfigurations()
   	{
   		/*if (!$this->User->isAdmin && !is_array($this->User->forms))
   		{
   			return array();
   		}*/

   		$arrTrackingConfigurations = array();
   		$objTrackingConfigurations = $this->Database->execute("SELECT id, name FROM tl_c4g_tracking ORDER BY name");

   		while ($objTrackingConfigurations->next())
   		{
   			//if ($this->User->isAdmin || $this->User->hasAccess($objForms->id, 'forms'))
   			//{
            $arrTrackingConfigurations[$objTrackingConfigurations->id] = $objTrackingConfigurations->name . ' (ID ' . $objTrackingConfigurations->id . ')';
   			//}
   		}

   		return $arrTrackingConfigurations;
   	}
913064
public function getGoogleTracking()
    {
        /** @var \Ekyna\Bundle\GoogleBundle\Model\TrackingCode $trackingCode */
        $trackingCode = $this->settingManager->getParameter('google.tracking_code');
        if (!$this->debug && 0 < strlen($trackingCode->getPropertyId())) {
            $domain = $trackingCode->getDomain();
            if (0 === strlen($domain)) {
                $domain = 'auto';
            }
            if (in_array($trackingCode->getDomain(), ['none', 'auto'])) {
                $domain = sprintf("'%s'", $domain);
            } else {
                $domain = sprintf("{'cookieDomain': '%s'}", $domain);
            }
            return sprintf(self::GA_TRACKING_CODE, $trackingCode->getPropertyId(), $domain);
        }
        return '';
    }
720994
public function getVisitorId()
    {
        $found = false;
        
        // If User ID is set it takes precedence
        $userId = $this->getForcedUserId();
        if ($userId) {
            $userIdHashed = $this->getUserIdHashed($userId);
            $idVisitor = $this->truncateIdAsVisitorId($userIdHashed);
            Common::printDebug("Request will be recorded for this user_id = " . $userId . " (idvisitor = $idVisitor)");
            $found = true;
        }

        // Was a Visitor ID "forced" (@see Tracking API setVisitorId()) for this request?
        if (!$found) {
            $idVisitor = $this->getForcedVisitorId();
            if (!empty($idVisitor)) {
                if (strlen($idVisitor) != Tracker::LENGTH_HEX_ID_STRING) {
                    throw new InvalidRequestParameterException("Visitor ID (cid) $idVisitor must be " . Tracker::LENGTH_HEX_ID_STRING . " characters long");
                }
                Common::printDebug("Request will be recorded for this idvisitor = " . $idVisitor);
                $found = true;
            }
        }

        // - If set to use 3rd party cookies for Visit ID, read the cookie
        if (!$found) {
            $useThirdPartyCookie = $this->shouldUseThirdPartyCookie();
            if ($useThirdPartyCookie) {
                $idVisitor = $this->getThirdPartyCookieVisitorId();
                if(!empty($idVisitor)) {
                    $found = true;
                }
            }
        }

        // If a third party cookie was not found, we default to the first party cookie
        if (!$found) {
            $idVisitor = Common::getRequestVar('_id', '', 'string', $this->params);
            $found = strlen($idVisitor) >= Tracker::LENGTH_HEX_ID_STRING;
        }

        if ($found) {
            return $this->getVisitorIdAsBinary($idVisitor);
        }

        return false;
    }
378027
public function dashboardBacklink() {
		if ( $this->hasCookies() ) {
			$text = $this->msg( 'bl-mysettings', 'tsintuition' );
		} else {
			$text = $this->msg( 'bl-mysettings-new', 'tsintuition' );
		}
		return IntuitionUtil::tag(
			$text,
			'a',
			[
				'class' => 'int-dashboardbacklink',
				'href' => $this->getDashboardReturnToUrl(),
				'title' => $this->msg( 'bl-changelanguage', 'tsintuition' ),
			]
		);
	}
197693
public function getTrackJsUrl()
    {
        $storeId = $this->getMagentoStoreId();
        //Get cdn url
        $cdnUrl = $this->configHelper->getCdnUrl($storeId);

        return $cdnUrl.'/track.js';
    }