Skip to content

Commit

Permalink
Merge pull request #41 from matomo-org/matomo
Browse files Browse the repository at this point in the history
Piwik is now Matomo
  • Loading branch information
tsteur authored Jan 9, 2018
2 parents 67e83b1 + fc2cd7a commit fd2b949
Show file tree
Hide file tree
Showing 23 changed files with 89 additions and 88 deletions.
2 changes: 1 addition & 1 deletion AnonymousPiwikUsageMeasurement.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

class AnonymousPiwikUsageMeasurement extends \Piwik\Plugin
{
const TRACKING_DOMAIN = 'http://demo-anonymous.piwik.org';
const TRACKING_DOMAIN = 'http://demo-anonymous.matomo.org';
const EXAMPLE_DOMAIN = 'http://example.com';

private $profilingStack = array();
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Changelog

* 3.0.0 Compatibility with Piwik 3
* 3.0.3 Renaming from Piwik to Matomo
* 3.0.0 Compatibility with Matomo 3
* 0.2.1 Track MySQL server version in a custom variable.
* 0.2.0 Add possibility to enable/disable anonymization and tracking user login as userID
* 0.1.4 Fixed a bug that failed to track under HTTPS under circumstances
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# Piwik AnonymousPiwikUsageMeasurement Plugin
# Matomo AnonymousPiwikUsageMeasurement Plugin

[![Build Status](https://travis-ci.org/piwik/plugin-AnonymousPiwikUsageMeasurement.svg?branch=master)](https://travis-ci.org/piwik/plugin-AnonymousPiwikUsageMeasurement)
[![Build Status](https://travis-ci.org/matomo-org/plugin-AnonymousPiwikUsageMeasurement.svg?branch=master)](https://travis-ci.org/matomo-org/plugin-AnonymousPiwikUsageMeasurement)

## Description

Help us to improve Piwik by sending anonymous usage data of your Piwik service to the creators of Piwik and/or get usage data yourself.
Help us to improve Matomo by sending anonymous usage data of your Matomo service to the creators of Matomo and/or get usage data yourself.

Track usage of your Piwik service into up to three Piwiks:
Track usage of your Matomo service into up to three Matomos:

* [demo-anonymous.piwik.org](https://demo-anonymous.piwik.org) (enabled by default but can be disabled). The tracked data will be used to make Piwik better. Thank you for your help!
* your own Piwik (can be configured optionally)
* a custom Piwik (can be configured optionally)
* [demo-anonymous.matomo.org](https://demo-anonymous.matomo.org) (enabled by default but can be disabled). The tracked data will be used to make Matomo better. Thank you for your help!
* your own Matomo (can be configured optionally)
* a custom Matomo (can be configured optionally)

### What is Piwik doing to make sure the data is anonymized?
### What is Matomo doing to make sure the data is anonymized?

We are very careful in what we track and we make sure to anonymize data that could contain user data.

* We overwrite the page title as the title could contain the name of the viewed website
* We remove any referrer information
* We replace URL paramaters with a predefined value apart from a few whitelisted ones to make sure no actual token_auth, CSRF token or user defined value will be tracked
* On demo-anonymous.piwik.org 3 bytes of the IP are anonymised (eg when IP is 192.168.1.1 we track only 192.0.0.0). The original IP is not used to identify your location and provider information is not collected.
* On demo-anonymous.matomo.org 3 bytes of the IP are anonymised (eg when IP is 192.168.1.1 we track only 192.0.0.0). The original IP is not used to identify your location and provider information is not collected.
* We do not just track any outlinks or downloads

### When should I not install this plugin?

If you have developed a custom Piwik plugin that contains for example the name of your business in any of the following names we recommend to not install this plugin as it might be tracked:
If you have developed a custom Matomo plugin that contains for example the name of your business in any of the following names we recommend to not install this plugin as it might be tracked:

* name of a plugin
* name of a controller action
Expand All @@ -34,7 +34,7 @@ If you have developed a custom Piwik plugin that contains for example the name o

Plugins that are installed via the Marketplace should not pose a problem as their names don't contain any user specific information such as the name of your business.

We track any information as efficient as possible to not slow down your Piwik. If you have already performance problems with your Piwik we recommend to not install this plugin though.
We track any information as efficient as possible to not slow down your Matomo. If you have already performance problems with your Matomo we recommend to not install this plugin though.

### Which data is tracked?

Expand All @@ -44,7 +44,7 @@ When the plugin is activated, the following data will be tracked:
* The visitors' software and devices data like the used browser and the resolution
* Some clicks or interactions with certain selectors or buttons. For example we track an event when a segment is selected but we do not track the actual segment.
* In a daily task we track the following data:
* Piwik version
* Matomo version
* PHP version
* Number of websites
* Number of users
Expand Down
18 changes: 9 additions & 9 deletions SystemSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ private function createLetUsersOptOutSetting()
private function createTrackToPiwikSetting()
{
return $this->makeSetting('trackToPiwik', $default = true, FieldConfig::TYPE_BOOL, function (FieldConfig $field) {
$field->title = 'Send usage data to Piwik.org';
$field->title = 'Send usage data to Matomo.org';
$field->uiControl = FieldConfig::UI_CONTROL_CHECKBOX;
$field->introduction = 'Send anonmyized usage data to the creators of Piwik';
$field->description = 'If enabled, anonymized usage data will be sent to demo-anonymous.piwik.org and the tracked data can be viewed there (the data is public). The collected data is used to improve Piwik. Thank you for making Piwik better!';
$field->introduction = 'Send anonmyized usage data to the creators of Matomo';
$field->description = 'If enabled, anonymized usage data will be sent to demo-anonymous.matomo.org and the tracked data can be viewed there (the data is public). The collected data is used to improve Matomo. Thank you for making Matomo better!';
});
}

Expand All @@ -81,8 +81,8 @@ private function createTrackToOwnPiwikSetting()
// ideally we would use a SELECT control and let user choose an existing site but this would make performance slow
// since we'd always have to get all site ids in each request
$field->uiControl = FieldConfig::UI_CONTROL_TEXT;
$field->introduction = 'Send anonymize usage data to this Piwik';
$field->description = 'If specified, anonymized usage data will be sent to the specified site in this Piwik.';
$field->introduction = 'Send anonymize usage data to this Matomo';
$field->description = 'If specified, anonymized usage data will be sent to the specified site in this Matomo.';
$field->validate = function ($idSite) {
if (empty($idSite)) {
return;
Expand All @@ -109,10 +109,10 @@ private function createTrackToOwnPiwikSetting()
private function createTrackToCustomSiteUrlSetting()
{
return $this->makeSetting('customSiteUrl', $default = '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
$field->title = 'Piwik Url';
$field->title = 'Matomo Url';
$field->uiControl = FieldConfig::UI_CONTROL_TEXT;
$field->uiControlAttributes = array('placeHolder' => 'eg. http://example.com/piwik');
$field->introduction = 'Send anonymize usage data to a custom Piwik';
$field->uiControlAttributes = array('placeHolder' => 'eg. http://example.com/matomo');
$field->introduction = 'Send anonymize usage data to a custom Matomo';
$field->description = '';
$field->validate = function ($value, $setting) {
if (empty($value)) {
Expand Down Expand Up @@ -148,7 +148,7 @@ private function createTrackToCustomSiteIdSetting()
$field->title = 'Site Id';
$field->uiControl = FieldConfig::UI_CONTROL_TEXT;
$field->uiControlAttributes = array('placeHolder' => 'eg. "2"');
$field->description = 'If a URL and Site Id is specified, usage data will be sent to the custom Piwik instance.';
$field->description = 'If a URL and Site Id is specified, usage data will be sent to the custom Matomo instance.';
$field->validate = function ($idSite) {
if (empty($idSite)) {
return;
Expand Down
2 changes: 1 addition & 1 deletion Tasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct(Trackers $trackers, CustomVariables $customVars, Pro
public function schedule()
{
$scheduledTime = $this->daily('sendSystemReport');
$scheduledTime->setHour(rand(1, 23)); // make sure not all Piwik instances send data to piwik.org at same time
$scheduledTime->setHour(rand(1, 23)); // make sure not all Piwik instances send data to matomo.org at same time
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Tracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Tracker extends \PiwikTracker

/**
* The method name is not ideal but want to make sure PiwikTracker won't define such method at some point.
* @param string $baseApiUrl eg 'http://demo-anonymous.piwik.org/piwik.php'
* @param string $baseApiUrl eg 'http://demo-anonymous.matomo.org/piwik.php'
*/
public function setBaseApiUrl($baseApiUrl)
{
Expand Down
2 changes: 1 addition & 1 deletion Tracker/CustomVariables.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function getServerVisitCustomVariables()
$customVars = array(
array(
'id' => 1,
'name' => 'Piwik Version',
'name' => 'Matomo Version',
'value' => StaticContainer::get('AnonymousPiwikUsageMeasurement.piwikVersion'),
),
array(
Expand Down
2 changes: 1 addition & 1 deletion Tracker/Targets.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function getTargets()

if ($this->settings->trackToPiwik->getValue()) {
$targets[] = array(
'url' => 'http://demo-anonymous.piwik.org/piwik.php',
'url' => 'http://demo-anonymous.matomo.org/piwik.php',
'idSite' => 1,
'useAnonymization' => true
);
Expand Down
2 changes: 1 addition & 1 deletion UserSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected function init()
private function createUsersOptOutSetting()
{
return $this->makeSetting('userTrackingEnabled', $default = true, FieldConfig::TYPE_BOOL, function (FieldConfig $field) {
$field->title = 'Piwik usage tracking enabled';
$field->title = 'Matomo usage tracking enabled';
$field->uiControl = FieldConfig::UI_CONTROL_CHECKBOX;
$field->description = 'If enabled, anonymous usage data will be tracked. For example which pages are viewed and which reports are used most often. For more information contact your system administrator.';
});
Expand Down
14 changes: 7 additions & 7 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

__Are there any prerequisites?__

* If sending usage data to Piwik is enabled, the Piwik installation must be connected to the internet
* If tracking to a custom Piwik installation is enabled, your Piwik installation and your Piwik users must be able to connect to this instance
* If tracking to a custom Piwik installation is enabled and your Piwik is served via HTTPS, the custom Piwik installation must be available via HTTPS as well
* If sending usage data to Matomo is enabled, the Matomo installation must be connected to the internet
* If tracking to a custom Matomo installation is enabled, your Matomo installation and your Matomo users must be able to connect to this instance
* If tracking to a custom Matomo installation is enabled and your Matomo is served via HTTPS, the custom Matomo installation must be available via HTTPS as well

__Why was this plugin created?__

This plugin was created to provide a simple way to measure how Piwik product itself is being used. The opt-in and anonymised usage tracking information will be used by the Piwik creators to build a better product and a great user experience.
This plugin was created to provide a simple way to measure how Matomo product itself is being used. The opt-in and anonymised usage tracking information will be used by the Piwik creators to build a better product and a great user experience.

__Who has access to the tracked data at demo-anonymous.piwik.org?__
__Who has access to the tracked data at demo-anonymous.matomo.org?__

The data is public and therefore can be seen by anyone on [https://demo-anonymous.piwik.org](https://demo-anonymous.piwik.org).
The data is public and therefore can be seen by anyone on [https://demo-anonymous.matomo.org](https://demo-anonymous.matomo.org).

This is to assure the tracked data is anonymous (transparency) and to showcase how Piwik can be used to track an application.
This is to assure the tracked data is anonymous (transparency) and to showcase how Matomo can be used to track an application.
4 changes: 2 additions & 2 deletions javascripts/tracking.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ piwikUsageTracking.createTrackersIfNeeded = function ()
var module = urlAnonymizer.getTopLevelId()
var action = urlAnonymizer.getSubLevelId();

var title = 'Piwik Web Analytics';
var title = 'Matomo Web Analytics';

if (module) {
title = ucfirst(module);
Expand All @@ -89,7 +89,7 @@ piwikUsageTracking.createTrackersIfNeeded = function ()
title += ' ' + ucfirst(action);
}
} else if ($('#login_form').length) {
// this is the case when eg opening http://example.piwik.org/ and one is not logged in (we show login page)
// this is the case when eg opening http://example.matomo.org/ and one is not logged in (we show login page)
title = 'Login';
}

Expand Down
4 changes: 2 additions & 2 deletions javascripts/tracking.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
var tracker = piwikUsageTracking.trackers[i];

var request = tracker.getRequest('');
expect(request).to.contain('&url=http%3A%2F%2Fdemo.piwik.org%2F%3F');
expect(request).to.contain('&url=http%3A%2F%2Fdemo.matomo.org%2F%3F');
expect(request).to.contain('&_cvar=%7B%221%22%3A%5B%22Access%22%2C%22user%22%5D%7D');
expect(request).to.not.contain('urlref=');
expect(request).to.not.contain('uid=testuserid');
Expand All @@ -98,7 +98,7 @@
var tracker = piwikUsageTracking.trackers[i];

var request = tracker.getRequest('');
expect(request).to.not.contain('&url=http%3A%2F%2Fdemo.piwik.org%2F%3F');
expect(request).to.not.contain('&url=http%3A%2F%2Fdemo.matomo.org%2F%3F');
expect(request).to.contain('urlref=');
expect(request).to.contain('uid=testuserid');

Expand Down
4 changes: 2 additions & 2 deletions javascripts/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ var UrlAnonymizer = function (absoluteUrl) {
{
var popoverName = getPopoverNameFromUrl();
if (popoverName) {
// anonymize visitor ids etc. Otherwise one could check if your own visitor id is present in demo-anonymous.piwik.org
// anonymize visitor ids etc. Otherwise one could check if your own visitor id is present in demo-anonymous.matomo.org
// and identify specific piwik instances and see which Piwik and PHP version they use, whether they use
// this plugin and what they do with their piwik. Also a transition or row evolution could include a URL
// etc
Expand Down Expand Up @@ -230,7 +230,7 @@ var UrlAnonymizer = function (absoluteUrl) {

blacklistedParams.push('token_auth');

// make sure to anonymize nonce, otherwise one could look for nonce token on demo-anonymous.piwik.org and test it
// make sure to anonymize nonce, otherwise one could look for nonce token on demo-anonymous.matomo.org and test it
// on several instances
blacklistedParams.push('nonce');

Expand Down
12 changes: 6 additions & 6 deletions javascripts/url.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,19 +393,19 @@

describe('#getTopLevelId', function() {

it('should detect id from Piwik 2 URL', function() {
it('should detect id from Matomo 2 URL', function() {
var urlAnonymizer = new UrlAnonymizer(fakeUrl);
var id = urlAnonymizer.getTopLevelId();
expect(id).to.eql('Dashboard');
});

it('should detect id from Piwik 2 URL and use module from search when hash does not contain module', function() {
it('should detect id from Matomo 2 URL and use module from search when hash does not contain module', function() {
var urlAnonymizer = new UrlAnonymizer(buildUrl(fakeSearch, ''));
var id = urlAnonymizer.getTopLevelId();
expect(id).to.eql('CoreHome');
});

it('should detect id from Piwik 3 URL', function() {
it('should detect id from Matomo 3 URL', function() {
var urlAnonymizer = new UrlAnonymizer(piwik3Url);
var id = urlAnonymizer.getTopLevelId();
expect(id).to.eql('Actions');
Expand All @@ -426,19 +426,19 @@

describe('#getSubLevelId', function() {

it('should detect id from Piwik 2 URL', function() {
it('should detect id from Matomo 2 URL', function() {
var urlAnonymizer = new UrlAnonymizer(fakeUrl);
var id = urlAnonymizer.getSubLevelId();
expect(id).to.eql('embeddedIndex');
});

it('should detect id from Piwik 2 URL and use module from search when hash does not contain module', function() {
it('should detect id from Matomo 2 URL and use module from search when hash does not contain module', function() {
var urlAnonymizer = new UrlAnonymizer(buildUrl(fakeSearch, ''));
var id = urlAnonymizer.getSubLevelId();
expect(id).to.eql('index');
});

it('should detect id from Piwik 3 URL', function() {
it('should detect id from Matomo 3 URL', function() {
var urlAnonymizer = new UrlAnonymizer(piwik3Url);
var id = urlAnonymizer.getSubLevelId();
expect(id).to.eql('Events');
Expand Down
18 changes: 9 additions & 9 deletions plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "AnonymousPiwikUsageMeasurement",
"version": "3.0.2",
"description": "Help improve your Piwik experience by sending anonymized usage data to the creators of Piwik, to your own Piwik instance or to any other Piwik",
"version": "3.0.3",
"description": "Help improve your Matomo experience by sending anonymized usage data to the creators of Matomo, to your own Matomo instance or to any other Matomo",
"theme": false,
"keywords": [
"usage",
Expand All @@ -10,20 +10,20 @@
"piwik"
],
"license": "GPL v3+",
"homepage": "http:\/\/piwik.org",
"homepage": "https:\/\/matomo.org",
"require": {
"piwik": ">=3.0.0-dev,<4.0.0-dev"
},
"support": {
"issues": "https://github.com/piwik/plugin-AnonymousPiwikUsageMeasurement/issues",
"forum": "https://forum.piwik.org",
"source": "https://github.com/piwik/plugin-AnonymousPiwikUsageMeasurement"
"issues": "https://github.com/matomo-org/plugin-AnonymousPiwikUsageMeasurement/issues",
"forum": "https://forum.matomo.org",
"source": "https://github.com/matomo-org/plugin-AnonymousPiwikUsageMeasurement"
},
"authors": [
{
"name": "Piwik",
"email": "hello@piwik.org",
"homepage": "http:\/\/piwik.org"
"name": "Matomo",
"email": "hello@matomo.org",
"homepage": "https:\/\/matomo.org"
}
]
}
Loading

0 comments on commit fd2b949

Please sign in to comment.