Overview

Conetix uses and recommends the use of W3 Total Cache for WordPress sites to ensure the highest possible website response times. W3 Total Cache (W3TC) does this by generating a static HTML version of the site and serves this directly where it’s safe to do so. However, if you’re using a URL with Google Analytics tracking (eg, the URL has utm_medium=facebook or similar), by default W3TC won’t cache the page as it doesn’t explicitly know this URL is safe to do so.

Similarly, if you’re running Facebook ads with their tracking code (fbclid), then these can also be marked as safe to ignore as well.

Thankfully, this can be over-ridden by adjusting the W3 Total Cache settings.

Note

As the Google Analytics and Facebook uses the client / browser to implement the tracking information, there’s no issue with having these URL’s cached. 

Instructions

  1. Login to your WordPress site.
  2. Under Performance on the left hand side, select Page Cache:
    Allow W3 Total Cache to pages with Google Analytics and Facebook Click ID Tags
  3. Under Accepted query strings, add the variables on separate lines:
  • utm_source
  • utm_medium
  • utm_content
  • utm_campaign
  • utm_term
  • gclid
  • fbclid
  1. Your configuration should look like this:
    Allow W3 Total Cache to pages with Google Analytics and Facebook Click ID Tags
  2. Save all settings and test your site again to confirm caching is working.

Tip

We have a debugging guide for W3 Total Cache to help identify other pages which may not be cached, as there may be other GET query strings which require an explicit rule.

Was this article helpful?

Related Articles