WP Manifestindependent plugin directory
manifest / analytics / analytics-with-consent

Analytics with Consent WP Registry grade A. No security issues foundWP RegistryNo security issues foundOpen the reportA

Google Analytics + CIVIC Cookie Control

★ 2stars
v1.7.2latest · 22d ago

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/dxw/analytics-with-consent/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

A WordPress plugin that combines a basic implementation of the Civic Cookie Control Mechanism with a basic implementation of Google Analytics (pageview tracking only).

Installation

With Whippet:

Without Whippet (not recommended):

  • Copy this repo into your wp-content/plugins/ folder.

Setup

You will need:

  • A Civic Cookie Control API Key:
    • Use the Civic Cookie Control download page
    • Select the licence: "Community" (usually), "Pro" or "Multisite" (if required)
    • Complete the form. This can be set up using standard client email i.e. @clients.govpress.com
    • Check email for API details
    • Save the CivicUK login and API details in 1Password
    • Login to CivicUK
    • Set the domain The setup can be tested on staging sites by setting the domain in the CivicUK account to the staging domain, then changing it to the production domain for release.
  • A Universal Analytics Tracking ID from Google Analytics (usually in format UA-xxxxxxxx-x), or a Google Analytics 4 Measurement ID (format G-xxxxxxxxxx) or a Google Tag Manager id (format GTM-xxxxxx).

Note: GTM should only be used for embedding Google Analytics, because the cookie consent mechanism will not cover other scripts that could be embedded via GTM.

Activate the plugin, and add the relevant info to the plugin's settings page under Settings > Analytics with Consent.

On a multisite, this will need to be done on a per-subsite basis.

Security

You can use the awc_gtm_tag_policy filter to restrict GTM tags, via a blocklist and/or an allowlist. For example, site owners may not want GTM users to be able to add certain tags to their site, for security hardening, code stability, or data collection reasons. In your plugin or theme:

add_filter('awc_gtm_tag_policy', function () {
    return [
            'allowlist' => ['<id>', '<id>', ...],
            'blocklist' => ['<id>', '<id>', ...],
    ];
});

It's important to note that blocklists override allowlists e.g. if the same tag exists in both lists, it is the blocklist that takes precedence.

You can see the full list of tag IDs via Google's 'Restrict tag deployment' documentation.

Customisation

You can use the awc_civic_cookie_control_config filter to add to or over-ride the default Civic Cookie Control config this plugin provides.

e.g. if you wanted to change the panel position from left to right, in your plugin or theme:

add_filter('awc_civic_cookie_control_config', function ($config) {
    $config['position'] = 'RIGHT';
    return $config;
});

If you're adding config that requires JavaScript function calls (e.g. the "onAccept" and "onRevoke" parameters for specific cookie types), you can pass the name of any function that is in the global namespace. e.g.

add_filter('awc_civic_cookie_control_config', function ($config) {
    $config['optionalCookies'][0]['onAccept] = 'doThis'; \\this will call the doThis() function in the global namespace
    return $config;
});

You can also do the same with namespaced functions (as long as the top-level object is in the global namespace). e.g.

add_filter('awc_civic_cookie_control_config', function ($config) {
    $config['optionalCookies'][0]['onAccept] = 'myNamespace.doThis'; \\this will call the myNamespace.doThis() function
    return $config;
});

Note that you can't pass JavaScript closures directly.

CHANGELOG and versioning

Please update the CHANGELOG as you develop, and publish and tag new releases.

As well as the individual version tags, we also have a major version tag (currently v1) that tracks the latest release for that major version. That has to be manually updated after you've done the release on GitHub as follows:

(e.g. if you'd just published v1.6.0):

git checkout main
git fetch --tags -f
git tag -f v1 v1.6.0
git push origin -f --tags

Releases

17 releases.

Tag
Published
v1.7.2 latest
Sep 30, 2026 22d ago
Aug 13, 2026 2mo ago
Jun 5, 2026 4mo ago
Jun 26, 2025 1 year ago
Dec 12, 2024 1 year ago
Nov 28, 2024 1 year ago
Nov 26, 2024 1 year ago
Jul 9, 2024 2 years ago
Mar 6, 2024 2 years ago
Nov 3, 2022 3 years ago
Oct 11, 2022 4 years ago
May 5, 2022 4 years ago
May 25, 2021 5 years ago
Apr 12, 2021 5 years ago
Mar 3, 2021 5 years ago
Feb 26, 2021 5 years ago
Nov 13, 2020 5 years ago

These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.

A grade

Security

Analytics with Consent 1.7.2 · audited by WP Registry

No security issues found.

Audited release
1.7.2
Findings
none
Worst severity
—
Content hash
544386b19dbb88a0c4cde2db…

WP Registry hashes the installable build and reports on that exact bytes-for-bytes copy. Embargoed findings are withheld until they are disclosed, so a clean verdict means nothing public is outstanding. WP Manifest does not audit code itself.