Extension talk:Analytics

Latest comment: 3 months ago by Willyedoo in topic PostgreSql compatibility?

PostgreSql compatibility?

edit

Hello am getting the error on installation with postgre

Creating analytics_pageviews table...Wikimedia\Rdbms\DBQueryError from line 1618 of /var/www/html/includes/libs/rdbms/database/Database.php: Error 42601: ERROR: syntax error at or near "(" LINE 2: ap_page INT(5) UNSIGNED NOT NULL, ^ Function: Wikimedia\Rdbms\Database::sourceFile( /var/www/html/extensions/Analytics/includes/Analytics.sql ) Query: CREATE TABLE IF NOT EXISTS "analytics_pageviews" ( ap_page INT(5) UNSIGNED NOT NULL, ap_timestamp INT(5) UNSIGNED NOT NULL, ap_views INT(8) UNSIGNED NOT NULL, PRIMARY KEY ( ap_page, ap_timestamp ) )

  1. 0 /var/www/html/includes/libs/rdbms/database/Database.php(1602): Wikimedia\Rdbms\Database->getQueryException()
  2. 1 /var/www/html/includes/libs/rdbms/database/Database.php(1576): Wikimedia\Rdbms\Database->getQueryException

Initially the sql wasn't on the folder intended. Creating analytics_pageviews table...RuntimeException from line 3232 of /var/www/html/includes/libs/rdbms/database/Database.php: Could not open "/var/www/html/extensions/Analytics/includes/Analytics.sql"

#0 /var/www/html/includes/libs/rdbms/database/DBConnRef.php(103): Wikimedia\Rdbms\Database->sourceFile()

#1 /var/www/html/includes/libs/rdbms/database/DBConnRef.php(810): Wikimedia\Rdbms\DBConnRef->__call()

#2 /var/www/html/includes/installer/DatabaseUpdater.php(718): Wikimedia\Rdbms\DBConnRef->sourceFile()

#3 /var/www/html/includes/installer/DatabaseUpdater.php(763): DatabaseUpdater->applyPatch()

Regards! Willyedoo (talk) 15:00, 30 July 2024 (UTC)Reply

@Willyedoo Hi! Thanks for the email, I'm glad you're finding this extension useful! I just uploaded a fix for PostgreSQL, let me know if it works and if you notice any other bugs or issues! Sophivorus (talk) 15:20, 31 July 2024 (UTC)Reply
Hi @Sophivorus,
I finally installed it with changes on the query and it worked. I just used your update and it woks fine too! It's more than great to use your code without changing anuthing.
My only issue now is how to get the pageview history as i did'nt had any tracker before(only hit counter).
Am waiting to see the first update of dashboard, any idea of time before it starts showing new data? Willyedoo (talk) 09:23, 1 August 2024 (UTC)Reply
@Willyedoo Hi, I'm glad it worked! The extension counts the pageviews to each page on each day. In other words, for every page-day combination, there is a pageview counter. That means that the first day of usage you should get a single data point, the second day you'll have two data points, and so on. In a week you should start getting something resembling a line chart (using the "daily" frequency). Regarding Extension:HitCounters, unfortunately its data cannot be used to populate the pageview history, because HitCounters only counts the total number of pageviews of each page, without distinguishing them by day. Cheers! Sophivorus (talk) 13:23, 1 August 2024 (UTC)Reply
Hi @Sophivorus,
Am still not getting any update on my dashbord. I tried to launch the update file but i get the error:
$ php extensions/Analytics/includes/AnalyticsUpdate.php
PHP Fatal error:  Uncaught Error: Interface "DeferrableUpdate" not found in /var/www/html/extensions/Analytics/includes/AnalyticsUpdate.php:5
Stack trace:
  1. 0 {main}
  thrown in /var/www/html/extensions/Analytics/includes/AnalyticsUpdate.php on line 5
Any idea how to fix it?
Thanks! Willyedoo (talk) 07:30, 6 August 2024 (UTC)Reply
@Willyedoo What MediaWiki version are you using? Sophivorus (talk) 11:37, 6 August 2024 (UTC)Reply
Produit Version
MediaWiki 1.39.4
PHP 8.0.27 (fpm-fcgi)
PostgreSQL 15.5
ICU 60.3
Lua 5.1.5
Pygments 2.11.2
Otehers files errors when trying on shell
AnalyticsLua.php
$ php extensions/Analytics/includes/AnalyticsLua.php
PHP Fatal error:  Uncaught Error: Class "Scribunto_LuaLibraryBase" not found in /var/www/html/extensions/Analytics/includes/AnalyticsLua.php:8
Stack trace:
  1. 0 {main}
  thrown in /var/www/html/extensions/Analytics/includes/AnalyticsLua.php on line 8
AnalyticsAPI.php
$ php extensions/Analytics/includes/AnalyticsAPI.php
PHP Fatal error:  Uncaught Error: Class "MediaWiki\Rest\SimpleHandler" not found in /var/www/html/extensions/Analytics/includes/AnalyticsAPI.php:11
Stack trace:
  1. 0 {main}
  thrown in /var/www/html/extensions/Analytics/includes/AnalyticsAPI.php on line 11 Willyedoo (talk) 12:40, 6 August 2024 (UTC)Reply
Return to "Analytics" page.