Support » Fixing WordPress » Ad Injection and W3 Total Cache, partial ad code being inserted

  • Hi, I have code like the following in the Ad Injection fields :

    <script type="text/javascript"><!--
    google_ad_client = "xxx";
    /* high contrast blue */
    google_ad_slot = "12711";
    google_ad_width = 468;
    google_ad_height = 60;
    //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>

    Yet, when I enable W3 Total Cache, the ads stop appearing. In checking the rendered page, when caching is enabled, the ad code is snipped for some reason, and the last portion is simply dropped, leaving only:

    <script type="text/javascript"><!--
    google_ad_client = "ca-pub-0448955880093822";
    /* high contrast blue */
    google_ad_slot = "1271162507";
    google_ad_width = 468;
    google_ad_height = 60;
    //-->
Viewing 2 replies - 1 through 2 (of 2 total)
  • try changing minify settings in w3total settings, notably: JS minification, not all css and js can be safely minified, this is external javascript and its better to leave it not concatenated/minified or otherwise processed.

    Hi there, Yui! Thanks for your response. The odd thing is that I had the minimizer portion set to ‘manual’ and *didn’t* include the JS file (or any files) for the Ad Injection plugin, so not sure why having the minimizer engaged is causing ads to stop being injected.

    For what it’s worth, the only way I am able to get ads to appear is to completely disable the minimizer part of W3 Total Cache (leaving page cache on is fine)…which is unfortunate as the minimizer is one of the most effective parts of the plugin besides page caching itself (as I’m sure you know!).

    If anyone finds a way around this while keeping minimizing enabled, I’m all ears! Likewise I’ll post back if I figure it out.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Ad Injection and W3 Total Cache, partial ad code being inserted’ is closed to new replies.