Page MenuHomePhabricator

Implement PageViewService for the Google Analytics API
Closed, DeclinedPublic

Event Timeline

Change 549421 had a related patch set uploaded (by Lens0021; owner: Lens0021):
[mediawiki/extensions/PageViewInfo@master] Support Google Analytics API

https://gerrit.wikimedia.org/r/549421

For testing the patchset, a credentials file and a profile ID are needed.

  1. Create a service account on Google and download the credentials file.
  2. Copy your credentials file to a certain path.
  3. Create a property and profile(view) on Google Analytics.
  4. Add the following code at the bottom of your LocalSettings.php:
wfLoadExtension( 'PageViewInfo' );
$wgPageViewInfoService = 'GoogleAnalytics';
$wgPageViewInfoGoogleAnalyticsCredentialsFile = '/path/to/your/credential_file.json';
$wgPageViewInfoGoogleAnalyticsProfileId = '12345678';

Change 549426 had a related patch set uploaded (by Lens0021; owner: Lens0021):
[mediawiki/extensions/PageViewInfo@master] Support Google Analytics API

https://gerrit.wikimedia.org/r/549426

Change 549421 abandoned by Lens0021:
Support Google Analytics API

https://gerrit.wikimedia.org/r/549421

I have no idea about PHPUnitTest. Please advise, thanks.

I has submitted a patch that is including unit tests.

Lens0021 removed Lens0021 as the assignee of this task.

Something I think now is there are so many analytics services in the world and PageViewInfo can't be responsible for all analytics services.
It is much proper to provide a general interface or a hook for the third-party developers who want to implement the analytics service they want to use.

Change 549426 abandoned by Lens0021:

[mediawiki/extensions/PageViewInfo@master] Support Google Analytics API

Reason:

I wrote the reason for abandon on https://phabricator.wikimedia.org/T237609#7114370

https://gerrit.wikimedia.org/r/549426

FYI: I have created a new ticket T283779 instead of this.