Extension:PageViewInfoGA

Category:Extensions without an imageCategory:Extensions with invalid or missing typeCategory:AGPL licensed extensions
MediaWiki extensions manual
PageViewInfoGA
Release status: betaCategory:Beta status extensions
Description Implements PageViewService for GoogleAnalytics
Author(s) Femiwiki Team
Latest version 0.1.2
Compatibility policy Snapshots releases along with MediaWiki. Master is not backward compatible.Category:Extensions with release branches compatibility policy
MediaWiki 1.36+Category:Extensions with manual MediaWiki version
Database changes Yes
License GNU Affero General Public License 3.0 or later
Download Category:Extensions in Wikimedia version control
  • $wgPageViewInfoGAProfileId
  • $wgPageViewInfoGAWriteCustomMap
  • $wgPageViewInfoGACredentialsFile
  • $wgPageViewInfoGAReadCustomDimensions
  • $wgPageViewInfoGAWriteCustomDimensions
  • $wgPageViewInfoGATrackingID
Quarterly downloads 0
Translate the PageViewInfoGA extension
Category:All extensions

The PageViewInfoGA extension implements PageViewService for Google Analytics.

Installation

Install the global site tag

You need to set $wgPageViewInfoGATrackingID to the ID of the Google Analytics property to which you want to send data to send event data to Google Analytics. (See the document for details)

Create a service account and enable the Analytics API

You need to create a service account and enable Analytics API to use PageViewInfoGA. See the document for details.

Configure credentials

You need to set $wgPageViewInfoGACredentialsFile to the path to your service account credentials you have downloaded in the previous step.

Configure profile Id

You need to set $wgPageViewInfoGAProfileId to your profile Id(View ID).

(Optional) Create and Use Custom Dimensions

There is not yet a guide for creating custom dimensions on Google Analytics web interface for this extension. See the document on Google instead.

After creating custom dimensions, set $wgPageViewInfoGAWriteCustomDimensions to valid array.

// Default to:
$wgPageViewInfoGAWriteCustomDimensions = [
    "dimension1" => "mw:page_id",
    "dimension2" => "mw:page_title",
];

Finally, you can use the custom dimensions.

$wgPageViewInfoGAReadCustomDimensions = true;

See also


This extension was originally made for Femiwiki.

Category:Extensions by Femiwiki Category:Google extensions Category:Web Analytics extensions Category:Statistics extensions
Category:AGPL licensed extensions Category:All extensions Category:BeforePageDisplay extensions Category:Beta status extensions Category:Extensions by Femiwiki Category:Extensions in Wikimedia version control Category:Extensions requiring Composer with git Category:Extensions with invalid or missing type Category:Extensions with manual MediaWiki version Category:Extensions with release branches compatibility policy Category:Extensions without an image Category:Google extensions Category:MediaWikiServices extensions Category:Statistics extensions Category:Web Analytics extensions