consentics
  1. How the Consentics install works /
  2. Install Consentics on WordPress

Install Consentics on WordPress

If your theme or host does not already give you a place to add code to every page's head, which route you use depends on your site. Most sites should use Route 1; developers comfortable editing a child theme can use Route 2 instead.

Before you start

You'll need administrator access to your WordPress site. If your site is hosted on WordPress.com, installing plugins (Route 1) is available on its paid plans, which WordPress.com currently names Personal, Premium, Business and Commerce, and not on the free plan; editing theme files (Route 2) also depends on your plan, so check WordPress.com's own plan page before starting.

Install one way, not both, or you risk double-counting: pasting the snippet through more than one route.

Route 1: a header-scripts plugin (most sites)

If your site doesn't already have a way to add code to every page's <head>, install a plugin that offers a header-scripts or custom-code field. One widely used option is WPCode (formerly Insert Headers and Footers), which adds a Code Snippets, then Header & Footer page to your WordPress admin menu; other plugins offer an equivalent field under their own settings, so follow your chosen plugin's instructions for where to paste header code.

  1. Go to your Consentics install page (Account, Properties, your site, Install) and copy your snippet. See the install basics for why you should always copy your exact snippet from there rather than reusing an example.
  2. In your plugin's settings, find the field for header or <head> scripts.
  3. Paste your Consentics snippet into that field.
  4. Save your changes.
  5. Go back to your Consentics install page and check the waiting-for-first-event status. It turns green once Consentics receives your first page view. If it's still waiting after a few minutes, purge any caching plugin or CDN in front of your site and check the page was actually saved, not just previewed.

Route 2: a child theme (developers)

If you're comfortable editing theme files, you can add the snippet directly through a child theme's functions.php, without installing a separate plugin.

This works for block themes (the ones you edit in the Site Editor) as well as classic themes. WordPress calls wp_head() itself when it renders a block theme, so an action added on wp_head fires either way, and a child theme of a block theme can carry a functions.php just as a classic child theme does.

  1. Go to your Consentics install page (Account, Properties, your site, Install) and copy your snippet. See the install basics for why you should always copy your exact snippet from there rather than reusing an example.
  2. In your child theme's functions.php, add an action on wp_head at priority 1, so the snippet is added early in the head:
<?php
// Illustration only: paste your real Consentics snippet from your install
// page, not the example below. See "Get your snippet" in the install
// basics for why a placeholder site key will not work.
add_action( 'wp_head', function () {
    echo '<script async src="https://static.consentics.example/static/icv_analytics/icva-tag.js" data-icva-site="icva_xxxxxxxxxxxxxxxxxxxxxxxx"></script>';
}, 1 );
  1. Save functions.php and confirm your site still loads without a PHP error.
  2. Go back to your Consentics install page and check the waiting-for-first-event status. It turns green once Consentics receives your first page view.

Caveats

  • Purge full-page caching after installing. If your site uses a caching plugin or a CDN, the banner won't appear for visitors served a cached page until you clear that cache.
  • Turn off any other consent banner. If a different plugin already shows a cookie or consent banner, deactivate it. Two consent banners running at once confuse visitors and can produce conflicting consent records.
  • Multisite needs one site key per site. If you run a WordPress multisite network, each site in the network is a separate Consentics property with its own site key. Repeat the route you chose for each site.

WooCommerce

On either route above, the Consentics banner, consent recording, Google Consent Mode v2 signalling, and page analytics all work on any page that renders your theme header, which for a standard WooCommerce store includes the shop, cart, checkout and order-received pages.

What doesn't work yet on either route: Consentics' four commerce events, view item, add to cart, begin checkout and purchase, are not available through a pasted header snippet. Reporting those events reliably needs WooCommerce's own hooks, which a header script cannot reach. If commerce event tracking is what you need, contact us to discuss your options.

FAQ

A theme update wiped my snippet. What happened? If you added the snippet directly to your active theme's files rather than a child theme, updating that theme replaces those files, including your changes. Use a child theme for Route 2 so theme updates don't remove your snippet.

Do I need the WP Consent API? Not for this install. Both routes here work without it.

Caching plugin or CDN: which do I need to clear? Whichever one sits between your visitors and your site. If you're not sure, check your hosting provider's or caching plugin's documentation for how to purge its cache after a header or code change.