mirror of
https://github.com/Findus23/plugin-ExclusionDemo.git
synced 2024-09-19 15:13:48 +02:00
init
This commit is contained in:
commit
6550081851
9 changed files with 89 additions and 0 deletions
3
CHANGELOG.md
Normal file
3
CHANGELOG.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
## Changelog
|
||||||
|
|
||||||
|
Here goes the changelog text.
|
41
ExclusionDemo.php
Normal file
41
ExclusionDemo.php
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Matomo - free/libre analytics platform
|
||||||
|
*
|
||||||
|
* @link https://matomo.org
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Piwik\Plugins\ExclusionDemo;
|
||||||
|
|
||||||
|
use Piwik\Tracker\Request;
|
||||||
|
|
||||||
|
class ExclusionDemo extends \Piwik\Plugin
|
||||||
|
{
|
||||||
|
public function registerEvents()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
'Tracker.isExcludedVisit' => 'isExcludedVisit'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isTrackerPlugin()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isExcludedVisit(bool &$excluded, Request $request)
|
||||||
|
{
|
||||||
|
// var_dump($request->getIp());
|
||||||
|
if ($request->getVisitorId() === "something") {
|
||||||
|
$excluded = true;
|
||||||
|
}
|
||||||
|
$params = $request->getParams();
|
||||||
|
if ($params["url"] === "something") {
|
||||||
|
$excluded = true;
|
||||||
|
}
|
||||||
|
if ($params["uid"] === "some user id") {
|
||||||
|
$excluded = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
6
README.md
Normal file
6
README.md
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
# Matomo ExclusionDemo Plugin
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
Add your plugin description here.
|
||||||
|
|
2
config/config.php
Normal file
2
config/config.php
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
<?php
|
||||||
|
return array();
|
2
config/tracker.php
Normal file
2
config/tracker.php
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
<?php
|
||||||
|
return array();
|
5
docs/faq.md
Normal file
5
docs/faq.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
## FAQ
|
||||||
|
|
||||||
|
__My question?__
|
||||||
|
|
||||||
|
My answer
|
1
docs/index.md
Normal file
1
docs/index.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
## Documentation
|
29
plugin.json
Normal file
29
plugin.json
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
{
|
||||||
|
"name": "ExclusionDemo",
|
||||||
|
"description": "Example code demonstrating how to exclude visits during tracking",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"theme": false,
|
||||||
|
"require": {
|
||||||
|
"matomo": ">=4.6.0-rc2,<5.0.0-b1"
|
||||||
|
},
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Matomo",
|
||||||
|
"email": "",
|
||||||
|
"homepage": ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"email": "",
|
||||||
|
"issues": "",
|
||||||
|
"forum": "",
|
||||||
|
"irc": "",
|
||||||
|
"wiki": "",
|
||||||
|
"source": "",
|
||||||
|
"docs": "",
|
||||||
|
"rss": ""
|
||||||
|
},
|
||||||
|
"homepage": "",
|
||||||
|
"license": "GPL v3+",
|
||||||
|
"keywords": []
|
||||||
|
}
|
0
screenshots/.gitkeep
Normal file
0
screenshots/.gitkeep
Normal file
Loading…
Reference in a new issue