Problem/Motivation

Currently it is not possible to disable tracking without disabling the module entirely.
Our uses cases are:

  • Our clients sometimes need to temporarily disable tracking but don't want to lose the module config and have to reset the domain and site ID when re-enabling tracking
  • We have a shared config across multiple environments and need an easy way to disable tracking on a specific environment by overriding a config key in settings.php

The matomo module has an option that does this: https://git.drupalcode.org/project/matomo/-/blob/5c36f08924771b5c001ad04...

Steps to reproduce

Proposed resolution

We could add a "Disable tracking" boolean setting.
If it is checked, piwik_pro_page_top() could return early.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork piwik_pro-3530762

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

prudloff created an issue. See original summary.

hartsak’s picture

Thanks @prudloff!
I think this is a good idea and I would like to see this feature added to the module too.

hartsak’s picture

Status: Active » Needs review

Thanks a lot @prudloff for the MR!
I added some stuff there too, like a very simple test and some defaults for settings.

How does it look now? I also tested it myself and the new setting seems to work.

joonaskokko’s picture

Looks good to me! 👍

hartsak’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @joonaskokko !
I guess we can go forward with this one soon.

hartsak’s picture

Status: Reviewed & tested by the community » Fixed

Tried to merge this to 1.4.x but for some reason couldn't find the Merge UI anywhere?
So I merged this from https://git.drupalcode.org/project/piwik_pro/-/merge_requests/23. Let's see how this goes.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.