Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore tracking requests for disabled plugins #16570

Merged
merged 12 commits into from Oct 18, 2020
Merged

Ignore tracking requests for disabled plugins #16570

merged 12 commits into from Oct 18, 2020

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Oct 13, 2020

fix #16569

Once merged, I would also implement this in our premium features.

It shouldn't be needed to mention this in our changelog since AFAIK custom actions/request processors aren't a documented/officially supported feature yet.

Already implemented this basically as a test in core for Contents, and Events plugin. So if someone was to disable the events plugin, but the standard JS tracker is still sending requests for events, then these would be ignored. Not doing it eg for actions plugin as this be usually always enabled anyway etc. Tried to implement it for heartbeat plugin but this doesn't work because it kind of relies on using the default page view action and then aborting the request. So if someone was to disable the heartbeat plugin, but still using the feature in JS this would still register page views.

We could then also create issues for other SDKs/trackers and add this there although it might not be as much of an issue there.

Possible problem: Sometimes one request might be sent for different purposes. Need to make sure in these cases we don't break anything. Eg a form view request might be sent along a page view. In this case we should not append the ca=1 tracking parameter.

@tsteur tsteur added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Oct 13, 2020
@tsteur tsteur added this to the 4.0.0-RC milestone Oct 13, 2020
@tsteur tsteur added the Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. label Oct 13, 2020
@tsteur
Copy link
Member Author

tsteur commented Oct 13, 2020

build js

@tsteur
Copy link
Member Author

tsteur commented Oct 13, 2020

There are some failing tests see eg https://travis-ci.org/github/matomo-org/matomo/jobs/735568092#L737-L847

I don't understand how they fail. They work locally and the requests failing makes no sense to me currently as not really any logic was changed. Maybe someone else has an idea what is happening there?

@tsteur tsteur removed Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. Needs Review PRs that need a code review labels Oct 13, 2020
@tsteur tsteur added the Needs Review PRs that need a code review label Oct 14, 2020
@sgiehl
Copy link
Member

sgiehl commented Oct 15, 2020

@tsteur I've looked into the failing tests. The "problem" is, that your new tests are using the Action::factory without loading the Actions plugin. That fills the static available actions array without those actions, causing the other tests to fail. Always loading the Actions plugin should fix that. I'll push a fix...

@tsteur
Copy link
Member Author

tsteur commented Oct 15, 2020

Cheers @sgiehl let me know if this is good to merge

Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code looks fine. As tests are all passing now, guess should be good to merge

@tsteur
Copy link
Member Author

tsteur commented Oct 18, 2020

Updated our premium features and documented the tracking parameter on the developer website. Also created issues with other sdks etc

tsteur added a commit to matomo-org/developer-documentation that referenced this pull request Oct 18, 2020
@tsteur
Copy link
Member Author

tsteur commented Oct 18, 2020

build js

@tsteur tsteur merged commit e2666f6 into 4.x-dev Oct 18, 2020
@tsteur tsteur deleted the m16569 branch October 18, 2020 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Matomo may track a page view even though it was a different request when a plugin was disabled
2 participants