-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change no data page logic according to core changes (#684)
* Adjustments according to core changes * Moved SPA/PWA class to TagManager * apply some review feedback
- Loading branch information
Showing
3 changed files
with
68 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
/** | ||
* Matomo - free/libre analytics platform | ||
* | ||
* @link https://matomo.org | ||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later | ||
* | ||
*/ | ||
|
||
namespace Piwik\Plugins\TagManager\SiteContentDetection; | ||
|
||
use Piwik\Container\StaticContainer; | ||
use Piwik\Piwik; | ||
use Piwik\Plugins\SitesManager\SiteContentDetection\SiteContentDetectionAbstract; | ||
use Piwik\SiteContentDetector; | ||
use Piwik\View; | ||
|
||
class SpaPwa extends SiteContentDetectionAbstract | ||
{ | ||
public static function getName(): string | ||
{ | ||
return 'SPA / PWA'; | ||
} | ||
|
||
public static function getContentType(): string | ||
{ | ||
return self::TYPE_JS_FRAMEWORK; | ||
} | ||
|
||
public static function getPriority(): int | ||
{ | ||
return 70; | ||
} | ||
|
||
public function isDetected(?string $data = null, ?array $headers = null): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function shouldShowInstructionTab(SiteContentDetector $detector = null): bool | ||
{ | ||
return true; | ||
} | ||
|
||
public function renderInstructionsTab(SiteContentDetector $detector): string | ||
{ | ||
$model = StaticContainer::get('Piwik\Plugins\TagManager\Model\Container'); | ||
$view = new View("@TagManager/trackingSPA"); | ||
$view->action = Piwik::getAction(); | ||
$view->showContainerRow = $model->getNumContainersTotal() > 1; | ||
return $view->render(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
<p>{{ 'SitesManager_SiteWithoutDataSPADescription'|translate('<a href="https://matomo.org/guide/tag-manager/" target="_blank" rel="noreferrer noopener">', '</a>', '<a href="https://developer.matomo.org/guides/spa-tracking" target="_blank" rel="noreferrer noopener">', '</a>')|raw }}</p> | ||
<br> | ||
<p>{{ 'SitesManager_SiteWithoutDataCloudflareFollowStepsIntro'|translate }}</p> | ||
<div | ||
vue-entry="TagManager.TrackingSPAPage" | ||
current-action="{{ action|json_encode }}" | ||
show-container-row="{{ showContainerRow|json_encode }}" | ||
> | ||
</div> | ||
</div> | ||
<br> | ||
<p>{{ 'SitesManager_SiteWithoutDataSPAFollowStepCompleted'|translate('<strong>','</strong>')|raw }}</p> |