Added more functionalities: custom piwik.js, piwik.php and _paq JS#2
Added more functionalities: custom piwik.js, piwik.php and _paq JS#2brusch wants to merge 4 commits intojbrule:masterfrom brusch:master
Conversation
|
Thank you for the code contrib. I'll give it a run through and see how it works. I assume the main desire of these options is to avoid detection by ad blockers? |
|
Yep, correctly :-) Thanks! |
TrackingCodeCustomizer.php
Outdated
| $trackingCode = str_replace("piwik.php", $settings["piwikPhp"], $trackingCode); | ||
| } | ||
|
|
||
| file_put_contents($trackingCodeFile, $trackingCode); |
There was a problem hiding this comment.
This assumes webserver has write permissions to file. Need to check permissions or handle failure and provide instruction to user. User would need to either SSH in to do the process manually or set write perm for web server process.
|
Bernhard, I'm been testing this out and it looks like omitting /piwik/, piwik.js, and piwik.php from the URL does the trick of avoiding getting blocked by the EasyPrivacy list using Ublock Origin and Adblock+. I'm not sure, at least at this point, if rewriting the piwik.js file is necessary. I think a cleaner approach would be to have the plugin create symlinks to piwik.js and piwik.php with the new filenames. Do you know of blocklists/programs that analyze the piwik.js file was may block if it isn't rewritten? There are some other issues to address
Thank you, |
|
Hi Josh, Thanks for your feedback! So you can still just copy & paste the code as it is and you won't face any issues caused by overwriting the _paq JS variable. I'll provide a fix for the remaining 2 issues as soon as possible. |
|
I see 2.16.2 added some functionality to the Javascript API to allows easier setup of multiple trackers. Does that help your use case any? |
|
Yep, I've seen this too, but my primary intention was to allow careless copy & paste as well as bypassing known tracking blockers. :) |

Added the possibility to customize the name of piwik.js, piwik.php, the _paq JS variable.
See also: