jbrule / piwikplugin-TrackingCodeCustomizer

Tracking Code Customizer plugin for the Piwik Web Analytics software package
GNU General Public License v3.0
1 stars 2 forks source link

Added more functionalities: custom piwik.js, piwik.php and _paq JS #2

Open brusch opened 8 years ago

brusch commented 8 years ago

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

See also:

image

jbrule commented 8 years ago

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?

brusch commented 8 years ago

Yep, correctly :-) Thanks!

jbrule commented 8 years ago

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, Josh

brusch commented 8 years ago

Hi Josh,

Thanks for your feedback! Regarding your question about rewriting piwik.js: The primary intention of this feature is to allow multiple Piwik trackers on the same page, without using a different tracking approach as described here: https://developer.piwik.org/guides/tracking-javascript-guide#multiple-piwik-trackers

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. But maybe it is also a helpful feature in the future to get around AdBlock+, ..., who knows ;-)

I'll provide a fix for the remaining 2 issues as soon as possible.

brusch commented 8 years ago

Just pushed the fixes and some more optimizations.

This is how it looks when /piwik.js is not writable:
image

jbrule commented 8 years ago

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?

brusch commented 8 years ago

Yep, I've seen this too, but my primary intention was to allow careless copy & paste as well as bypassing known tracking blockers. :)