Skip to main content

DigiWedge CMP for WordPress

The DigiWedge CMP plugin delivers Consent Mode v2, strict script blocking, GTM helpers, and diagnostics for WordPress sites. Install it on single sites or across a multisite network to centralise consent management while respecting regional policies.

Before You Start

  • WordPress admin (or Network Admin) privileges to install/activate plugins.
  • A staging environment is strongly recommended for first-time setup and theme verification.
  • Remove any manually embedded DigiWedge CMP snippet or GTM helper from your theme before enabling the plugin—the plugin injects the bundle automatically.

Supported Versions

ComponentVersion
WordPress6.5+
PHP8.1+
Node (build tooling)22

Installation

  1. Download the release archive (wp-cmp-<version>.zip) from your CI artifact or GitHub release.
  2. WP Admin → Plugins → Add NewUpload Plugin.
  3. Select the ZIP → Install NowActivate (choose Network Activate if you are on multisite).

Configuration

Once activated, navigate to Settings → DigiWedge CMP. Configure the following:

FieldDescription
Registry Base URLYour DigiWedge registry endpoint (e.g. https://registry.example.com).
Site KeyThe tenant site identifier.
Preview TokenOptional token for preview/staging configurations.
Region ModeAuto uses the Region API; Force applies a fixed region code (e.g. EU, US-CA).
Forced Region CodeRequired when Region Mode = Force.
E2E Region OverrideAllows Playwright or QA to set x-e2e-region via localStorage.
GTM HelperAdds a lightweight window.dataLayer + gtag stub if GA4 Consent Mode is absent.
Strict Script BlockingDefers matching third-party scripts until the visitor grants consent.
Blocking PatternsOne substring per line (e.g. google-analytics.com). Matches against <script src="...">.

CMP settings screen

Multisite Networks

Network Admins can define defaults under Network Admin → Settings → CMP (Network). Site-level pages inherit these defaults and may override them locally. The form highlights inherited values so editors know what the network mandates.

Network defaults screen

Strict Blocking & GTM Assist

  • Strict Blocking converts matching <script> tags to type="text/plain" until consent is granted. When the visitor accepts (any consent state with granted), the original scripts are restored and executed.
  • GTM Helper ensures window.dataLayer and gtag exist for legacy GA4/GTM setups. Enable it when the site hasn’t yet embedded Consent Mode v2.
    • Inline scripts without a src attribute are unaffected; keep using the DigiWedge Consent APIs inside your theme or blocks if you need custom handling.

Diagnostics

Visit Settings → CMP Diagnostics for a live snapshot:

  • Last region + source (auto API vs forced setting).
  • Config fetch status (200 or 304) and ETag age.
  • Count of scripts currently blocked by strict mode.

The plugin stores the latest snapshot in localStorage (dw.cmp.diagnostics) for easy inspection during QA.

Diagnostics screen

CI / Release Pipeline

The repo includes two workflows:

WorkflowPurpose
wp-cmp-ci.ymlBuild, PHP unit checks, Playwright tests, zip artifact (matrix: PHP 8.1 / 8.2, Node 22).
wp-cmp-release.ymlTriggered on wp-cmp-v* tags. Runs full suite, installs composer --no-dev, zips wp-cmp-<tag>.zip, and attaches it to the GitHub release.

Troubleshooting

  • Config not loading? Check diagnostics for HTTP status/ETag. Verify the registry URL/site key.
  • Scripts still firing before consent? Add their CDN host to Blocking Patterns (one per line). Confirm the diagnostics page reports the expected blocking count.
  • Multisite confusion? Network defaults populate site forms. Sites can override values; the description shows when a network default is in effect.
  • E2E testing: Toggle the “E2E Region Override” setting, then set localStorage.setItem('dw.cmp.e2eRegion', 'EU') during tests to force deterministic regions.

Updates & Support

  • New plugin builds publish tagged archives via the wp-cmp-release.yml workflow. Download the latest wp-cmp-*.zip and repeat the Upload flow, or run pnpm nx run wp-cmp:release locally and replace the plugin directory.
  • Review the changelog in apps/cmp/wp-cmp/CHANGELOG.md for upgrade notes and any migration steps.
  • Questions or issues? Open a ticket in the DigiWedge CMP repository or contact the platform team through the usual support channel.

See also