Using Logic Hop with Cache Plugins

By default, Logic Hop functions at the Pre-page Level and Page Level. This allows Logic Hop to fully integrate with the WordPress Engine in real-time.

Pre-page Level and Page Level functionality means Conditions and Goals are evaluated and tracked BEFORE a page is generated to enable redirects, page tracking, triggering Goals and creating Conditional CSS. In-page elements, such as Widget Conditions and Shortcode Conditions, are evaluated and rendered DURING page generation.

Cache Plugins such as WP Super Cache, W3 Total Cache and WP Rocket help speed up WordPress by caching pages. Put simply, this means pages are dynamically generated once. Subsequent page views bypass the WordPress Engine and visitors are served the static cached pages.

While caching is great for speed and performance, it bypasses Pre-page Level and Page Level processing and the default Logic Hop functionality.

Cache Compatible Javascript Tracking

Logic Hop has a Javascript Tracking feature which allows the use of any cache Plugin while keeping the benefit of the page view tracking, Goal tracking and page redirects.

Javascript Tracking

Enabling Javascript Tracking

To enable Javascript Tracking, visit the Logic Hop Settings page, check the “Enable Javascript Tracking” box and click the Save Changes button.

Logic Hop Javascript Tracking relies on AJAX. Click here for more information on how Javascript requests are handled.

Important Note: In order for caching to work properly, your caching system must bypass caching for the file /wp-admin/admin-ajax.php – Most caching systems have this bypass in place as a default.

ConvertKit & Drip Users: Your caching system must bypass caching for the following query strings:

  • ConvertKit:
    • convertkit=true
  • Drip:
    • drip=true

Please Note: If you are not using a Cache Plugin, we recommend leaving the Javascript Tracking function disabled.

Caching & Pages & Posts Events

Page & Post events can be used with cache plugins when Javascript Tracking is enabled. All events (Tracking, Goal on Load, Goal on Condition & Redirect on Condition) will be evaluated and processed by Javascript after the page is loaded.

Redirect Note: Page redirects will display the initial page prior to reloading. Reloads will be triggered by Javacsript.

Caching & Conditional CSS

Conditional CSS can be used with cache plugins. Conditional CSS rules are generated when the page is loaded and are not cached.

Caching & Widgets

Conditional Widgets can be used with cache plugins when Javascript Tracking is enabled. Click here for full details.

Caching & Javascript

Conditional Javascript can be used with cache plugins with or without Javascript Tracking being enabled. Click here for full details.

Caching & Shortcodes

When using a Cache Plugin we recommend against using Logic Hop Shortcodes unless caching is disabled for those pages. Caching pages with Logic Hop Shortcodes elements will cause unexpected results.

As an alternative to Data Shortcodes, Javascript Variables can be used to display user data via AJAX. This allows dynamic data to be displayed when caching is enabled. Click here for full details.

Disabling Caching for Specific Pages

Cache plugins typically provide settings to disable caching for specific pages. Disabling caching of a specific page will allow full Logic Hop functionality on that page without enabling Javascript Tracking.

  • WP Super Cache
    • Go to WP Super Cache Advanced Settings
    • Click Advanced
    • Locate the box Accepted Filenames & Rejected URIs
    • Check which page(s) to exclude or enter the URL of the page(s) you wish to exclude.
      • Example: /about/
  • W3 Total Cache
    • Go to W3 Total Cache Performance > Page Cache
    • Click Advanced
    • Locate the box Never cache the following pages
    • Enter the URL of the page(s) you wish to exclude.
      • Example: /about/
  • WP Rocket
    • Go to WP Rocket Advanced Options
    • Locate the box Never cache the following pages
    • Enter the URL of the page(s) you wish to exclude.
      • Example: /about/
    • Click here for detailed information.
  • Wordfence
    • Go to Wordfence Performance Setup
    • Locate You can add items like URLs, cookies and browsers (user-agents) to exclude from caching
    • Add logichop as a Cookie Name Contains.
    • Enter the URL Matches for the page(s) you wish to exclude.
      • Example: /about/
    • Click here for detailed information.

Logic Hop Settings for WPEngine

Cache Settings for Specific Hosts & Services

Hosting companies and services that provide caching typically provide settings to bypass certain pages, query strings and cookies. Known settings are listed below.

At minimum, Cookies and PHP Sessions must be available and the file /wp-admin/admin-ajax.php must not be subject to caching (this is the default for most services).

If integrating with ConvertKit or Drip, specific query string values must also be bypassed:

  • ConvertKit:
    • convertkit=true
  • Drip:
    • drip=true

This list will be regularly updated as new settings are added. If you have a question about a specific hosting company or service, click here to contact us.

  • Cloudflare
    • Cloudflare caching works with Logic Hop Javascript page tracking, goal track, conditions and data variables.
    • If using ConvertKit or Drip, your Cloudflare Page Rules should set and ordered as follows:
      • http://domain.com/wp-*
        • Browser Cache TTL: 4 hours
        • Cache Level: Bypass
        • Disable Apps
        • Disable Performance
      • If using ConvertKit:
        • http://www.promoshed.com/*convertkit=true*
          • Cache Level: Bypass
      • If using Drip:
        • http://www.promoshed.com/*drip_email=*
          • Cache Level: Bypass
      • http://domain.com/*
        • Browser Cache TTL: 4 hours
        • Cache Level: Cache Everything
        • Edge Cache TTL: 8 hours