Opened 6 years ago

Closed 4 years ago

Last modified 4 years ago

#42 closed New feature (fixed)

Plugin to exclude the webmaster based on a cookie

Reported by: matt Owned by: matt
Priority: critical Milestone: Piwik 0.6.1
Component: Core Keywords:
Cc: Sensitive: no

Description (last modified by matt)

Feature available in phpMyVisites.
The plugin makes it easy to create a cookie so that visits by the piwik user are not registered in the piwik.php process and not counted in the statistics.

The plugin would hook during the installation process and make the cookie by default (opt out)

Attachments (2)

BlockingCookie.php (4.0 KB) - added by black silence 5 years ago.
much cleaner version, less hardcoded, delete cookie if no site is excluded from tracking, user is sent back to dashboard (renamed widget, delete and add new!)
BlockingCookie-0.3.tar.gz (2.8 KB) - added by black silence 5 years ago.

Download all attachments as: .zip

Change History (28)

comment:1 Changed 6 years ago by matt (mattab)

  • Description modified (diff)

comment:2 Changed 6 years ago by matt (mattab)

  • Milestone set to Future features

comment:3 Changed 6 years ago by konus

I would like that feature too.

comment:4 Changed 6 years ago by matt (mattab)

  • Milestone changed from Future features to DigitalVibes

comment:5 Changed 6 years ago by matt (mattab)

  • Description modified (diff)

comment:6 Changed 5 years ago by vipsoft (robocoder)

Patch for review (submitted to [Piwik-hackers] by Christoph Moseler).

http://lists.piwik.org/pipermail/piwik-hackers/2008-December/000548.html

comment:7 Changed 5 years ago by vipsoft (robocoder)

  • Milestone changed from DigitalVibes to Surviving The Wild

comment:8 Changed 5 years ago by matt (mattab)

  • Milestone changed from Surviving The Wild to DigitalVibes
  • Priority changed from major to critical

comment:9 Changed 5 years ago by black silence

I created a plugin that could allow anybody to opt out of being tracked. It works, but I need help for creating a nice widget and/or API that allows users to do so.

Current state:
Adds a widget (Special > Blocking Cookie) with a short message and a link to toggle tracking, clicking that link enables/disables tracking but doesn't take you back to the dashboard.

I thought of a link (button) to click which then replaces the widget content with the updated status message and a new link, but my jQuery code didn't work was I wanted.

Changed 5 years ago by black silence

much cleaner version, less hardcoded, delete cookie if no site is excluded from tracking, user is sent back to dashboard (renamed widget, delete and add new!)

comment:10 Changed 5 years ago by matt (mattab)

  • Component changed from Plugins to Core

comment:11 Changed 5 years ago by matt (mattab)

  • Description modified (diff)

I had a quick look at plugin;

Feedback:

  • html could be extracted in templates
  • code to create the cookie should be in an API.
  • instead of building your URLs manually, you can reuse Piwik_Url::getCurrentQueryStringWithParametersModified( $params )
  • security: creating the cookie should only be available for users with a "view" access and that are logged in.

Also ideally we would like to add this feature in the admin section of the website, with a link to create a special cookie to be excluded from all websites in this Piwik.

comment:12 follow-up: Changed 5 years ago by black silence

it has grown a little bit :) -> v0.3

  • API to exclude from one or all sites (includes sites that are not yet created)
  • API to check if excluded from one or all sites
  • uses a little template for the widget
  • API checks if user has view access for the site he wants to set the cookie for
    • Please check that, it seems to work but I'm unexperienced which checks Piwik does anyways. My second test user was not able to use a modified link but I didn't see any error message because of my redirect.

Changed 5 years ago by black silence

comment:13 Changed 5 years ago by goodware

comment:14 in reply to: ↑ 12 Changed 5 years ago by albass

comment:15 Changed 5 years ago by domtop

comment:16 Changed 5 years ago by vipsoft (robocoder)

  • Owner set to vipsoft
  • Sensitive unset

comment:17 Changed 5 years ago by vipsoft (robocoder)

  • Owner vipsoft deleted

comment:18 Changed 4 years ago by vipsoft (robocoder)

  • Milestone changed from 2 - Piwik 0.6 - DigitalVibes to 1 - Piwik 0.5.5

comment:19 Changed 4 years ago by matt (mattab)

  • Milestone changed from 1 - Piwik 0.5.5 to 1 - Piwik 0.5.6

comment:20 Changed 4 years ago by vipsoft (robocoder)

Unless there are reasonable use cases where someone might want to deactivate the SitesManager, I've moved #554 to the same milestone as it would be a logical extension to integrate the per-site exclusion UI into the SitesManager UI.

comment:21 Changed 4 years ago by matt (mattab)

Note: cookie exclusion will not be possible "per website"; there will be a global cookie that would disallow tracking for all websites in the Piwik installs. we already have problems with the number of cookies (see #409). We could have a cookie that contain all website IDs to exclude, but this would not work and cause errors when the Piwik contains dozens/hundreds of websites (which is a more and more common use case that we def want to handle gracefully)

For finer grain control over which users are excluded from which websites, the IP exclusion would be the proper solution to use.

comment:22 Changed 4 years ago by vipsoft (robocoder)

black silence: please advise if you're able to make Matt's proposed changes for the upcoming release. Your help is appreciated.

comment:23 Changed 4 years ago by matt (mattab)

  • Owner set to matt

I'll do it at the same time as #43

comment:24 Changed 4 years ago by matt (mattab)

  • Resolution set to fixed
  • Status changed from new to closed

(In [2142]) Fixes #42 Adding cookie exclude feature in the user settings page; will exclude visits from all websites tracked in the Piwik instance.

comment:25 Changed 4 years ago by matt (mattab)

(In [2143]) Refs #42 anonymous user can't set the cookie (csrf protection)

comment:26 Changed 4 years ago by demondmitriy

Note: See TracTickets for help on using tickets.