Jump to content

ایکسٹینشن: اینالیٹکس

From mediawiki.org
This page is a translated version of the page Extension:Analytics and the translation is 91% complete.
MediaWiki extensions manual
Analytics
Release status: stable
Implementation Special page
Description پورے وکی کے لیے ٹریفک اور ترمیم کے تجزیات، نیز مخصوص زمروں اور صفحات کے لیے۔
Author(s) Sophivorusتبادلۂ خیال
Latest version 1.2
MediaWiki 1.39+
PHP 8+
Database changes Yes
License GNU General Public License 3.0 or later
Download
Example Appropedia
  • $wgAnalyticsCountPageViews
Quarterly downloads 25 (Ranked 90th)
Translate the Analytics extension if it is available at translatewiki.net

The Analytics extension gives access to traffic and edit analytics for the entire wiki, as well as for specific categories and pages, in three ways:

  • A special page called Special:Analytics where you can explore freely through a simple UI (example)
  • A Lua library called mw.ext.analytics that exposes the data to Lua modules and templates (example)
  • A REST API endpoint called /analytics that exposes the data to other software and scripts (example)

تنصیب

  • Download and move the extracted Analytics folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Analytics
  • Only when installing from Git, run Composer to install PHP dependencies, by issuing composer install --no-dev in the extension directory. (See T173141 for potential complications.)
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'Analytics' );
    
  • Run the update script which will automatically create the necessary database tables that this extension needs.
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

صفحہ ملاحظات کی نگرانی

When installed, this extension will create a database table called analytics_pageviews and will start tracking the daily pageviews to each page. تاہم، اگر آپ نے اپنی وکی شروع ہونے کے کچھ وقت بعد اس ایکسٹینشن کو نصب کیا ہے، تو pageviews table میں تاریخی ڈیٹا موجود نہیں ہوگا۔ اگر آپ گوگل تجزیات استعمال کر رہے ہیں (GA4) آپ کو اس توسیع کے ساتھ بنڈل کی دیکھ بھال سکرپٹ تاریخی ڈیٹا کے ساتھ پیج ویوز ٹیبل آباد کرنے کے لئے استعمال کر سکتے ہیں, اس طرح:

php /path/to/w/maintenance/run.php /path/to/w/extensions/Analytics/maintenance/populatePageViewsFromGA4.php --credentials /path/to/google-cloud-credentials.json --property 123456789

مزید برآں، اگر آپ کا ویکی پراکسی استعمال کر رہا ہے (جیسے کلاؤڈ فلایر) تو آپ کے بہت سے یا یہاں تک کہ زیادہ تر پیج ویوز آپ کے سرور تک نہیں پہنچیں گے، جس کا مطلب ہے کہ یہ توسیع ان کا سراغ نہیں لگا سکے گی۔ To work around this, if you're using GA4, run the maintenance script with --days 1 using a daily cronjob to keep your pageviews table up to date. If you do, you may also want to set $wgAnalyticsCountPageViews = false; in your LocalSettings.php to disable the default tracking of pageviews.

مزید دیکھیں

  • Extension:HitCounter - ہر صفحے کی کل صفحہ ملاحظات کو ٹریک کرتا ہے۔
  • Extension:UserPageViewTracker - یہ ریکارڈ کرتا ہے کہ کس نے کون سا صفحہ دیکھا، کتنی بار دیکھا اور آخری بار کب آیا تھا۔