Support » Plugin: AdRotate - Ad manager & AdSense Ads » W3 Total Cache not working

  • Resolved Jack


    I’m experimenting with the free version of AdRotate to check functionality / compatibility with my blog.

    I use W3TC for caching with some fairly simple settings – disk:basic cache, html minify, expires headers.

    I installed AdRotate and set up one group with 2 ads and default mode, placed in my sidebar via the AdRotate widget. The ads appear fine, and seem to be placed 50/50 throughout my content, rotating every hour (when W3TC rebuilds my html pages due to the html expires setting).

    When I enabled the “Check this box if you use W3 Total Caching on your site” option, I get

    AdRotate has detected one issue that requires your attention:
    » You have enable caching support but the W3TC_DYNAMIC_SECURITY definition is not set. How to configure W3 Total Cache.

    I followed the instructions at and reconfigured W3TC and my site as described. However, I still see the warning.

    I’ve noticed the security hash defined in the AdRotate settings that I’m supposed to put in my wp-config.php is changing every time I reload the page. I suspect this means that AdRotate is looking for this new hash, while I just put the hash that had been on that page in my wp-config.php. In effect, I’m in a race condition where I’m always one step behind and never have the current hash.

    Has anyone configured W3TC and AdRotate to work correctly?

    I’m fine using it as is for now, but it would be nice to be able to use dynamic mode so the ads rotate even if the page isn’t reloaded. If I try to use it without configuring W3TC, it always shows the first ad in the group. I’m hoping that’s a side effect of W3TC, since I’d expect Dynamic mode to randomly select which ad to use, or to select it as needed to balance out the ad impressions based on the weights.

    Suggestions welcomed. Thanks!

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Arnan de Gans


    If you still see the warning, then you didn’t set up the W3TC_DYNAMIC_SECURITY hash correctly.

    Where/how did you add it?

    Thread Starter Jack


    You’re right. I double-checked my wp-config.php and there was a typo on the line.

    Sorry for the mixup!

    Good news is that I got it configured and it seemed to be working well – various ad spots were obvious rotating and not cached.

    Bad news is the late initialization setting that was part of configuring W3TC for this to work added a full second to my response times. The W3TC config page clearly mentions this as a possible side effect of enabling that option, so apparently it’s expected.

    Page speed is more important to me than accurate impression tracking, and I’m comfortable with the minimal rotation, so I’ll stick with cached pages.

    I was able to configure my ad groups in dynamic mode and see they are rotating as expected, and the starting ad for different ad slots and different pages is randomized.

    Impressive plugin! Thanks again for the help! Disappointing about the page speed impact, but I can always try again whenever I decide to upgrade my hosting plan / get a CDN / go W3TC Pro.

    Plugin Author Arnan de Gans


    You can also track impressions in Google Analytics or Piwik – That offloads the stats burden to them, AND let’s you use caching in a more effective way.

    Take a look:,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘W3 Total Cache not working’ is closed to new replies.