Title: GDPR, analytics &amp; caching
Last modified: May 27, 2020

---

# GDPR, analytics & caching

 *  Resolved [Milan](https://wordpress.org/support/users/milantopalov/)
 * (@milantopalov)
 * [6 years ago](https://wordpress.org/support/topic/gdpr-analytics-caching/)
 * Caching plugins (e.g. WP Super Cache) in general conflict with GDPR settings 
   in SEOPress.
 * Since entire HTML page is cached, analytics tracking script will run (or not)
   if it has been included in the latest cache (or not) – regardless of wether user
   accepted the terms (or not).
 * Thus we get problematic situations such as these:
    - user did not accept the terms, but was served the page with analytics tracking
      code (because it was cached as such)
    - user did accept the terms, but was served the page with no analytics tracking
      code (because it was cached as such)
 * To go around this problem, SEOPress plugin should load/run tracking codes using
   javascript, as opposed to including it server side (as it does now).
    -  This topic was modified 6 years ago by [Milan](https://wordpress.org/support/users/milantopalov/).

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

 *  Plugin Author [Benjamin Denis](https://wordpress.org/support/users/rainbowgeek/)
 * (@rainbowgeek)
 * [6 years ago](https://wordpress.org/support/topic/gdpr-analytics-caching/#post-12905595)
 * Hi,
 * you have to exclude this JS file in your settings:
    /wp-content/plugins/wp-seopress/
   assets/js/seopress-cookies-ajax.js and this cookie seopress-user-consent-accept
 * Tested with WP-Rocket, should work with other caching plugin.
 *  [Tobo](https://wordpress.org/support/users/infonetzlichtcom/)
 * (@infonetzlichtcom)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/gdpr-analytics-caching/#post-13085286)
 * Hi Benjamin, hi Milan,
 * I have the exact same problem and cannot get it running with WP Rocket OR Litespeed
   Cache.
 * What do you mean with exclude “seopress-user-consent-accept” cookie? When I exclude
   the cookie from cache, the cache is not longer working when the cookie is set.
   Page isn’t cached because the cookie is preventing that.
 * /wp-content/plugins/wp-seopress/assets/js/seopress-cookies-ajax.js exclude that
   file? From optimization? Minify?
 * Do you found a solution Milan? Any other advice?
 * Would be awesome!
 *  [Tobo](https://wordpress.org/support/users/infonetzlichtcom/)
 * (@infonetzlichtcom)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/gdpr-analytics-caching/#post-13090356)
 * Dunno what was wrong. It is working out of the box without excluding anything
   with litespeed.

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

The topic ‘GDPR, analytics & caching’ is closed to new replies.

 * ![](https://ps.w.org/wp-seopress/assets/icon-128x128.gif?rev=3158903)
 * [SEOPress - AI SEO Plugin & On-site SEO](https://wordpress.org/plugins/wp-seopress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-seopress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-seopress/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-seopress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-seopress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-seopress/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Tobo](https://wordpress.org/support/users/infonetzlichtcom/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/gdpr-analytics-caching/#post-13090356)
 * Status: resolved