NexaGuard
    NexaGuard
    • NexaGuard Onboarding
    • iOS Setup
    • Android Setup
    • Web Setup
    • Webflow and Wix
    • WordPress Integration
    • Drupal Integration
    • Shopify Integration
    • LICENSE

    Drupal Integration

    Integrate NexaGuard CMP with Drupal#

    The NexaGuard Consent Management Platform (CMP) provides an enterprise-grade solution for GDPR, ePrivacy, and Google Consent Mode v2 compliance in Drupal.
    This guide describes the complete installation, configuration, and verification process for the NexaGuard CMP Drupal Module.

    Overview#

    NexaGuard CMP enables Drupal websites to collect, manage, and transmit user consent signals to third-party services like Google Ads, Google Analytics, and other marketing tools.
    The module works seamlessly across Drupal 9, 10, and 11, automatically injecting the CMP loader script into your site’s <head> section.
    Once installed, the module will:
    Display a customizable consent banner across all pages.
    Capture and store user consent preferences.
    Handle Google Consent Mode v2 default and update events automatically.
    Maintain compliance with privacy regulations globally.

    Module Details#

    PropertyValue
    Module NameNexaGuard CMP
    PackagePrivacy
    DescriptionIntegrates NexaGuard Consent Management Platform into Drupal for GDPR and Google Consent Mode v2 compliance.
    Core compatibilityDrupal 9, 10, 11
    LicenseGPL-2.0-or-later
    MaintainerNexaGuard Inc.
    Project URLhttps://www.drupal.org/project/nexaguard_cmp

    Requirements#

    Drupal 9 or higher
    PHP 8.1 or higher
    Administrator privileges to install modules
    A valid NexaGuard CMP account and Settings ID

    Installation#

    Option 1 — Install via Composer#

    Option 2 — Manual Installation#

    1.
    Download the latest release from the Drupal project page:
    https://www.drupal.org/project/nexaguard_cmp
    2.
    Extract the archive to /modules/custom/nexaguard_cmp or /modules/contrib/nexaguard_cmp.
    3.
    Enable the module:
    Extend → NexaGuard CMP → Enable
    4.
    Clear caches (drush cr or via the admin interface).

    Configuration#

    1.
    Navigate to Configuration → System → NexaGuard CMP.
    2.
    Enter your Settings ID (from your NexaGuard dashboard).
    3.
    Configure additional options:
    ✅ Auto-inject CMP Script.
    ✅ Enable Google Consent Mode v2.
    ✅ Inject only for anonymous users.
    ✅ Exclude admin pages from injection.
    4.
    Click Save Configuration.

    Script Injection Behavior#

    After configuration, the module automatically injects the CMP loader script into the <head> of all public pages:
    The module ensures this script is loaded only once and integrates seamlessly with Drupal caching systems.
    If Google Consent Mode is enabled, it automatically executes gtag('consent', 'default') and gtag('consent', 'update') events based on user consent.

    Verification#

    Option 1 — Browser Developer Tools#

    1.
    Open your site and inspect using Developer Tools (F12).
    2.
    In the Network tab, filter for “loader.js” or “consent”.
    3.
    Confirm that loader.js is loaded from https://cmp.nexaguard.com and consent events are triggered.

    Option 2 — Google Tag Assistant#

    1.
    Install Google Tag Assistant.
    2.
    Record your session and reload the page.
    3.
    Verify “Consent Mode active” and gtag('consent', 'update') events after user action.

    Option 3 — NexaGuard Debug Mode#

    Add ?nxg_debug=1 to your site URL.
    Example: https://example.com/?nxg_debug=1
    The debug overlay will show banner status, consent categories, and Consent Mode values.

    Advanced Options#

    FeatureDescription
    Anonymous Users OnlyDisplays the banner only to logged-out visitors.
    Exclude Admin RoutesPrevents CMP injection on /admin/* pages.
    Debug ModeAdds CMP overlay for consent diagnostics.
    Custom Asset URLsAllows custom CMP endpoints for testing or staging environments.

    Troubleshooting#

    IssueCauseSolution
    CMP banner not visibleMissing or invalid Settings IDVerify the ID in NexaGuard CMP configuration
    CMP script duplicatedCached theme injectionClear caches and verify only one <script> appears
    Consent Mode inactivegtag or Tag Manager misconfiguredEnable Google Consent Mode v2 option
    Admin pages affectedExclude Admin Routes disabledEnable the exclude admin option under configuration

    Uninstallation#

    1.
    Navigate to Extend → NexaGuard CMP → Uninstall.
    2.
    Run the following commands if using Drush:
    All configurations are safely removed.

    Security and Compliance#

    NexaGuard CMP ensures your site meets major international privacy standards:
    GDPR (General Data Protection Regulation)
    ePrivacy Directive (EU Cookie Law)
    Google Consent Mode v2
    CCPA / CPRA (California)
    All communications are performed via HTTPS with TLS encryption.
    User consent preferences are stored securely and anonymized.

    Verification for Google Audit#

    Module provides guided setup with configuration UI.
    CMP loader injects automatically into all public pages.
    Google Consent Mode default and update signals function as required.
    Public documentation and release available at https://www.drupal.org/project/nexaguard_cmp.
    This module fully satisfies Google’s Gold Tier x.3.a (3+ CMS integrations) requirement.

    Support#

    For help or inquiries, contact our support team:
    📧 [email protected]
    🌐 https://www.nexaguard.com

    © NexaGuard Inc. — All Rights Reserved.
    Version: 1.0.4 | Last Updated: October 2025
    Previous
    WordPress Integration
    Next
    Shopify Integration