From 0fd36cd8db3c444860aff0afcbfd158354e33e58 Mon Sep 17 00:00:00 2001 From: sgiehl Date: Fri, 1 Sep 2023 14:03:41 +0200 Subject: [PATCH] fix new checks for GA --- plugins/SitesManager/Controller.php | 3 +-- plugins/SitesManager/templates/_siteWithoutDataTabs.twig | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/SitesManager/Controller.php b/plugins/SitesManager/Controller.php index 42baca21eb3..e16e987681f 100644 --- a/plugins/SitesManager/Controller.php +++ b/plugins/SitesManager/Controller.php @@ -24,7 +24,6 @@ use Piwik\Plugins\SitesManager\SiteContentDetection\GoogleAnalytics4; use Piwik\Plugins\SitesManager\SiteContentDetection\SiteContentDetectionAbstract; use Piwik\Plugins\SitesManager\SiteContentDetection\WordPress; -use Piwik\Site; use Piwik\SiteContentDetector; use Piwik\Session; use Piwik\SettingsPiwik; @@ -236,7 +235,7 @@ public function siteWithoutDataTabs() 'consentManagerName' => false, 'defaultSiteDecoded' => [ 'id' => $this->idSite, - 'name' => Common::unsanitizeInputValue(Site::getNameFor($this->idSite)), + 'name' => Common::unsanitizeInputValue($this->site->getName()), ], 'maxCustomVariables' => $maxCustomVariables, 'serverSideDoNotTrackEnabled' => $dntChecker->isActive() diff --git a/plugins/SitesManager/templates/_siteWithoutDataTabs.twig b/plugins/SitesManager/templates/_siteWithoutDataTabs.twig index f9f0a87c4a1..4ccc8faee96 100644 --- a/plugins/SitesManager/templates/_siteWithoutDataTabs.twig +++ b/plugins/SitesManager/templates/_siteWithoutDataTabs.twig @@ -108,7 +108,7 @@ {% if googleAnalyticsImporterMessage is defined and googleAnalyticsImporterMessage is not empty %} {{ googleAnalyticsImporterMessage|raw }} - {% elseif not ga3Used and not ga4Used %} + {% elseif not 'GoogleAnalytics3' in jsFrameworks and not 'GoogleAnalytics4' in jsFrameworks %}

{{ 'SitesManager_ImportDataFromGoogleAnalytics'|translate }}

{{ 'SitesManager_ImportDataFromGoogleAnalyticsDescription'|translate('', '')|raw }}

{% endif %}