Title: tracker getting cached
Last modified: December 15, 2018

---

# tracker getting cached

 *  [andrew55](https://wordpress.org/support/users/andrew55/)
 * (@andrew55)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/tracker-getting-cached/)
 * After getting odd statistics, I went looking and it seems the js tracker is getting
   cached on our site.
 * On this test page:
 * [test page](https://www.lifeleap.org/blank-test/)
 * …you should see this cached result:
 * `paq.push(['setUserId', 'testuser2']);`
 * So it seems at least the user variable is getting cached (which prevents accurate
   tracking).
 * We use W3TC and Autoptimize, but W3TC seems to be causing the cache issue.
 * Any suggestions for prevent cache of the Matomo’s js tracker, while still being
   able to use cache plugins?
 * Thanks for any help.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [braekling](https://wordpress.org/support/users/braekling/)
 * (@braekling)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/tracker-getting-cached/#post-10996813)
 * Having a look at your site, I can’t see the user ID setting. So at least for 
   not logged-in users it seems to work, doesn’t it?
 * I’m not using any caching plugins, so it’s hard to say. But maybe W3TC offers
   an option to ignore a specific piece of code? At least, it’s possible to [disable minifying inline JS](https://code.tutsplus.com/articles/configuring-w3-total-cache-advanced-minification-settings--wp-31043)…
   maybe this is a workaround?
 *  Thread Starter [andrew55](https://wordpress.org/support/users/andrew55/)
 * (@andrew55)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/tracker-getting-cached/#post-10996932)
 * Thank you for the reply. The user IDs work great. I think the issue is that they
   are getting cached (which destroys tracking ability).
 * I’m switching to LiteSpeed Cache soon, so maybe they will have a workaround to
   prevent cache.
 *  Plugin Author [braekling](https://wordpress.org/support/users/braekling/)
 * (@braekling)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/tracker-getting-cached/#post-11042455)
 * Hm, yes, the tracking code has to be generated for each user individually, so
   if the generated pages get cached, this leads into problems. But on the other
   hand, caching should not affect dynamic components, so I bet there should be 
   a solution.
 * If you find a solutions, please feel free to share – or maybe somebody else is
   able to provide some additional information?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘tracker getting cached’ is closed to new replies.

 * ![](https://ps.w.org/wp-piwik/assets/icon-256x256.png?rev=3529668)
 * [Connect Matomo - Analytics Dashboard for WordPress](https://wordpress.org/plugins/wp-piwik/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-piwik/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-piwik/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-piwik/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-piwik/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-piwik/reviews/)

## Tags

 * [W3TC](https://wordpress.org/support/topic-tag/w3tc/)

 * 3 replies
 * 2 participants
 * Last reply from: [braekling](https://wordpress.org/support/users/braekling/)
 * Last activity: [7 years, 5 months ago](https://wordpress.org/support/topic/tracker-getting-cached/#post-11042455)
 * Status: not resolved