Skip to content

Commit

Permalink
don't show GA Import on others screen when plugin is available
Browse files Browse the repository at this point in the history
  • Loading branch information
sgiehl committed Sep 20, 2023
1 parent 6d36aaf commit c520c3b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
21 changes: 4 additions & 17 deletions plugins/SitesManager/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
use Piwik\DataTable\Renderer\Json;
use Piwik\Piwik;
use Piwik\Plugin\Manager;
use Piwik\Plugins\SitesManager\SiteContentDetection\GoogleAnalytics3;
use Piwik\Plugins\SitesManager\SiteContentDetection\GoogleAnalytics4;
use Piwik\Plugins\SitesManager\SiteContentDetection\Matomo;
use Piwik\Plugins\SitesManager\SiteContentDetection\SiteContentDetectionAbstract;
use Piwik\Plugins\SitesManager\SiteContentDetection\WordPress;
Expand Down Expand Up @@ -292,23 +290,12 @@ private function getGoogleAnalyticsImporterInstruction()
'type' => SiteContentDetectionAbstract::TYPE_OTHER,
'othersInstruction' => Piwik::translate('CoreAdminHome_ImportFromGoogleAnalyticsDescription', ['<a href="https://plugins.matomo.org/GoogleAnalyticsImporter" rel="noopener noreferrer" target="_blank">', '</a>']),
];

/**
* @ignore
*/
Piwik::postEvent('SitesManager.siteWithoutData.customizeImporterMessage', [&$googleAnalyticsImporterInstruction]);
}

if (empty($googleAnalyticsImporterInstruction)
&& !$this->siteContentDetector->wasDetected(GoogleAnalytics3::getId())
&& !$this->siteContentDetector->wasDetected(GoogleAnalytics4::getId())) {
$googleAnalyticsImporterInstruction = [
'id' => 'GoogleAnalyticsImporter',
'name' => Piwik::translate('SitesManager_ImportDataFromGoogleAnalytics'),
'type' => SiteContentDetectionAbstract::TYPE_OTHER,
'othersInstruction' => Piwik::translate('SitesManager_ImportDataFromGoogleAnalyticsDescription', ['<a target="_blank" rel="noreferrer noopener" href="https://matomo.org/guide/installation-maintenance/import-google-analytics/">', '</a>']),
];
}
/**
* @ignore
*/
Piwik::postEvent('SitesManager.siteWithoutData.customizeImporterMessage', [&$googleAnalyticsImporterInstruction]);

return $googleAnalyticsImporterInstruction;
}
Expand Down
4 changes: 1 addition & 3 deletions plugins/SitesManager/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,6 @@
"SiteWithoutDataSPADescription": "It is easy to start tracking your Single Page Application (SPA) or Progressive Web App (PWA) using Matomo Analytics. The easiest way to do this is using the Matomo Tag Manager (%1$slearn more%2$s) using the steps below, alternatively you can use the JavaScript Tracking code (%3$sfollowing this guide%4$s).",
"SiteWithoutDataSPAFollowStepCompleted": "%1$sCongratulations!%2$s You have successfully installed the Matomo Analytics tracking code via the Matomo Tag Manager. To verify that hits are being tracked, visit your SPA / PWA and check that this data is visible in your Matomo instance.",
"OtherWaysTabDescription": "Even if the solutions provided in the other tabs were not right for you, you can easily setup Matomo with one of the methods below. You may need the following information:",
"ImageTrackingDescription": "When a visitor has disabled JavaScript, or when JavaScript cannot be used, you can use an image tracking link to track visitors. For the whole list of options you can use with an image tracking link, see the %1$sTracking API Documentation%2$s.",
"ImportDataFromGoogleAnalytics": "Import Data from Google Analytics",
"ImportDataFromGoogleAnalyticsDescription": "Import your Google Analytics properties and reporting data to create a backup and analyse them using Matomo’s powerful analytics tools. Check out our %1$sguide%2$s."
"ImageTrackingDescription": "When a visitor has disabled JavaScript, or when JavaScript cannot be used, you can use an image tracking link to track visitors. For the whole list of options you can use with an image tracking link, see the %1$sTracking API Documentation%2$s."
}
}

0 comments on commit c520c3b

Please sign in to comment.