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

Move action_name query parameter off first position so requests do not get ad-blocked #14207

Closed
kdekooter opened this issue Mar 15, 2019 · 20 comments
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.

Comments

@kdekooter
Copy link

Despite being on the exact same domain as the website uBlock still blocks calls to matomo. It seems to block based on the phrase .php?action_name=

image

@Findus23
Copy link
Member

Correct, the EasyPrivacy list used by ublock and others is blocking the .php?action_name string.

So there is no bug in Matomo and everything is working as intended :slightly_smiling:

@kdekooter
Copy link
Author

kdekooter commented Mar 15, 2019

Agreed that is not a bug. But is being blocked by an adblocker intended? Can we somehow work around this? I set up matomo with the specific purpose of not being blocked by privacy addins.

@kdekooter kdekooter changed the title uBlock is blocking matomo Make action_name query parameter configurable so it does not get ad-blocked Mar 15, 2019
@kdekooter kdekooter changed the title Make action_name query parameter configurable so it does not get ad-blocked Make action_name query parameter configurable / rename it so it does not get ad-blocked Mar 15, 2019
@kdekooter
Copy link
Author

Maybe moving it to the second position in the query string would suffice.

@kdekooter kdekooter changed the title Make action_name query parameter configurable / rename it so it does not get ad-blocked Move action_name query parameter to second position so requests to not get ad-blocked Mar 15, 2019
@kdekooter kdekooter changed the title Move action_name query parameter to second position so requests to not get ad-blocked Move action_name query parameter to second position so requests do not get ad-blocked Mar 15, 2019
@kdekooter kdekooter changed the title Move action_name query parameter to second position so requests do not get ad-blocked Move action_name query parameter off first position so requests do not get ad-blocked Mar 15, 2019
@tsteur
Copy link
Member

tsteur commented Mar 16, 2019

I think there's not too much point cause ad blockers will eventually just find a different way to detect it. It would maybe work for a few weeks and then fail again.

@tsteur tsteur added this to the Backlog (Help wanted) milestone Mar 16, 2019
@tsteur tsteur added the Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. label Mar 16, 2019
@fdellwing
Copy link
Contributor

It would maybe work for a few weeks and then fail again.

EasyPrivacy list still does not block matomo(js|php), so there is hope.

@kdekooter
Copy link
Author

kdekooter commented Mar 16, 2019

Yes but it is quite sensitive to .php extensions.

I ended up working around this by letting the client send tracking calls to /mtm instead of /matomo.php and rewriting this back on the server side with nginx:

location /mtm { 
   rewrite ^/mtm(.*)$ /matomo.php$1 break; 
}

@mattab
Copy link
Member

mattab commented Mar 18, 2019

Let's leave the ticket opened as it is a valid request (at least for some of our users, not all would agree) 👌

@mattab mattab reopened this Mar 18, 2019
@tsteur
Copy link
Member

tsteur commented Mar 19, 2019

btw you can also just POST instead of using GET requests and the action_name will be gone. Something like _paq.push(['setRequestMethod', 'POST']);.

You won't be able to use log analytics to replay tracking requests with that, but most people don't do this anyway. I would say this issue is pretty much resolved and any further solutions would probably need to be developed in some plugin as we likely won't change it anyway.

@kdekooter
Copy link
Author

Thanks @tsteur I tried that but it turns out POST requests to this URL are blocked (by Brave) as well.

@Shirkit
Copy link

Shirkit commented Mar 21, 2019

If there's one thing I've learned is that blockers will block you. Their goal is to block analytics and tracking on client-side, so if you try to trick them, they'll just find a workaround.

The people who put out the lists do no want to be tracked online. It all started with annoying ads, then when remarketing showed up, now all analytics suffer as well.

@tsteur
Copy link
Member

tsteur commented Mar 21, 2019

If there's one thing I've learned is that blockers will block you. Their goal is to block analytics and tracking on client-side, so if you try to trick them, they'll just find a workaround.

The people who put out the lists do no want to be tracked online. It all started with annoying ads, then when remarketing showed up, now all analytics suffer as well.

my thinking too 👍

@negreanucalin
Copy link

negreanucalin commented Oct 3, 2019

I think a more general approach should be made. For example the POC made for this covers all parameters, ad-blocking softwares are changing and more rules are being made.
For example uBlock Origin (v 1.22.4) matches idSite, send_image etc see here
I think this should be closed in favor of the POC.

@kdekooter
Copy link
Author

Unfortunately the POC issue was closed because "we don't really want to work around ad blockers / privacy lists in such a way at this stage".

Leaving us with blocked requests, severely limiting the reliability of analytics data.

@Shirkit
Copy link

Shirkit commented Jan 30, 2020

I'll repeat my comment: the more sneaky ways analytics try to track users, the more ad blockers will push back. You don't seem to understand this. Grab server side tracking data and combine it into your analytics. For now, since they'll start to scramble that data as well.

@kdekooter
Copy link
Author

kdekooter commented Jan 30, 2020

@Shirkit Totally agree with the sneaky argument.

I tried to be not-sneaky by self-hosting an open-source analytics solution on my own domain. I did not expect to be defeated by an ad-blocker while tracking my own authenticated users.

@mattab mattab added the wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it. label Feb 10, 2020
@ghost
Copy link

ghost commented Aug 21, 2020

I think there's not too much point cause ad blockers will eventually just find a different way to detect it. It would maybe work for a few weeks and then fail again.

that's completely false. you just need to obfuscate based on some seed that is unique to each mamoto user.

ad blockers can only block file names and urls, things that are easily regexable. anything else is too much overhead for an adblocker.

it's extremely trivial to get around ad blockers for analytics purposes and mamoto should make it easy to do so, because that's one of the main reason to use it.

@sgiehl
Copy link
Member

sgiehl commented Aug 21, 2020

@dave-dm you can simply force the tracking to use POST requests. So no ad blocker will be able to block the requests based on GET parameters

@ghost
Copy link

ghost commented Aug 21, 2020

@dave-dm you can simply force the tracking to use POST requests. So no ad blocker will be able to block the requests based on GET parameters

thanks that works, I couldn't find anything about how to solve it on google.

@kdekooter
Copy link
Author

kdekooter commented Aug 22, 2020

Blockers like PrivacyBadger block POST requests as well...

@ghost
Copy link

ghost commented Aug 23, 2020

Blockers like PrivacyBadger block POST requests as well...

fortunately it's not that popular yet, POST seems to bypass the most popular ones. I think mamoto should add optional random obfuscation of the 'request' variable with a custom seed initialized at installation. as well as custom obfuscation of mamoto.js. that would make it forever ad blocker proof, and really wouldn't be that hard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Projects
None yet
Development

No branches or pull requests

8 participants