keycdn / cache-enabler

A lightweight caching plugin for WordPress that makes your website faster by generating static HTML files.
https://wordpress.org/plugins/cache-enabler/
123 stars 46 forks source link

Query string variables for campaign tracking with Matomo et al. #39

Closed sebastiangreger closed 5 years ago

sebastiangreger commented 5 years ago

After switching from more complex caching solutions, Cache Enabler works like a charm. Thank you for this great, minimalistic plugin!

There is however one shortcoming:

Caching currently only works if the HTTP request contains either no GET variables at all, or some of the GET variables used for campaign tracking by Google Analytics (_utmsource, _utmmedium, _utmcampaign, as hardcoded in advanced-cache.php, line 44).

Alternative analytics solutions also use GET variables for campaign tracking (for example Piwik/Matomo: _pkcampaign, _pkkwd, _pksource, _pkmedium, _pkcontent). Currently, using these tags inevitably bypasses the cache, as would for instance using the remaining two GA parameters _utmterm or _utmcontent, neither currently included in the exclusion rule. Other analytics software may use additional ones, also some social sharing services or newsletter platforms attach such tags by default.

For advanced users of (alternative) analytics solutions, it would be very useful to be able to freely define rules for "ignored GET variables" on the Cache Enabler settings page, similar to the existing RegExp fields for "excluded pages" and "matching cookies".