Skip to content

Install on WordPress

Add the tracking script to a WordPress site so it loads in the <head> of every page. Use a theme setting, a header plugin, or Google Tag Manager.

Before you begin

  • You are an administrator of the WordPress site.
  • You have the script tag from the Enfonica Console: open the tracking site, click Settings, scroll to Tracking script and click Copy script.

Option 1: theme settings

Many themes have a field for header scripts, often under Appearance > Customize or the theme's own options page, labelled something like Header scripts or Custom code. Paste the tag there and publish.

Option 2: a header plugin

If the theme has no such field, install a plugin that inserts code into the header, such as WPCode. Add the tag as a header snippet that loads on all pages, and activate it.

Option 3: the theme's header file

Edits to theme files are overwritten by theme updates. Do this only in a child theme.

  1. Click Appearance > Theme File Editor and open header.php.
  2. Paste the tag before </head>.
  3. Click Update File.

The tag is now in the header of every page.

Option 4: Google Tag Manager

If the site already loads Google Tag Manager, add the script there. See Install with Google Tag Manager.

Caching and optimisation plugins

Page caching doesn't affect the script, because numbers are swapped in the browser. Optimisation features that delay or combine JavaScript can stop it working:

  • Exclude ctjs.au from any Delay JavaScript, Defer JavaScript or Combine JavaScript setting in plugins such as WP Rocket, LiteSpeed Cache or Autoptimize. A delayed script misses the visitor's first seconds on the page and may not swap the number before they call.
  • Clear the cache after adding the tag so cached pages include it.

Verify

Open the site, view the page source, and confirm the tag is in <head>. Then follow Verify the installation.