Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MatomoAnalyticsWiki: support for getting most visited pages #125

Closed
wants to merge 15 commits into from
Prev Previous commit
Next Next commit
Fix
Universal-Omega authored Apr 5, 2024
commit 3f8164c81e8f178fe447bcb11187640db2ca85fe
6 changes: 3 additions & 3 deletions includes/MatomoAnalyticsWiki.php
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ private function getData(
string $period = 'range',
string $jsonLabel = 'label',
string $jsonData = 'nb_visits',
int $flat = 0
bool $flat = false
) {
$config = MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( 'matomoanalytics' );

@@ -31,7 +31,7 @@ private function getData(
'period' => $period,
'idSite' => $this->siteId,
'token_auth' => $config->get( 'MatomoAnalyticsTokenAuth' )
] + ( $flat ? [ 'flat' => $flat ] : [] )
] + ( $flat ? [ 'flat' => 1 ] : [] )
)
);

@@ -135,6 +135,6 @@ public function getVisitDaysPassed() {

// Most visited pages
public function getMostVisistedPages() {
return $this->getData( 'Actions.getPageUrls', 'today', 'month', 'label', 'nb_visits', 1 );
return $this->getData( 'Actions.getPageUrls', 'today', 'month', 'label', 'nb_visits', true );
}
}