Skip to content

feat: add google consent setting updates to GTM and GA4 kits#1220

Merged
khushi1033 merged 1 commit intoworkstation/3.0-Releasefrom
feat/add-new-consent-settings-to-gtm-ga4-kits
Mar 23, 2026
Merged

feat: add google consent setting updates to GTM and GA4 kits#1220
khushi1033 merged 1 commit intoworkstation/3.0-Releasefrom
feat/add-new-consent-settings-to-gtm-ga4-kits

Conversation

@khushi1033
Copy link
Contributor

@khushi1033 khushi1033 commented Mar 20, 2026

Background

  • Google Consent Mode v2 introduced three additional consent types (functionality_storage, personalization_storage, and security_storage) These were added to the standalone GTM and GA4 kit repos (PRs: GTM and GA4) but need to be ported into the monorepo

What Has Changed

  • Copied over changes made to GA4 and GTM kits which:
    • Added functionality_storage, personalization_storage, and security_storage to the googleConsentProperties allowlist in consent.js files
    • Updated tests to include the three new consent types in mock GDPR consent state, consent mapping arrays, and all expected data layer assertion blocks

Screenshots/Video

  • {Include any screenshots or video demonstrating the new feature or fix, if applicable}

Checklist

  • I have performed a self-review of my own code.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have tested this locally.

Additional Notes

  • {Any additional information or context relevant to this PR}

Reference Issue (For employees only. Ignore if you are an outside contributor)

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
88.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@khushi1033 khushi1033 marked this pull request as ready for review March 20, 2026 17:44
@cursor
Copy link

cursor bot commented Mar 20, 2026

PR Summary

Medium Risk
Touches consent allowlists and default-setting mappings that directly affect what consent signals are sent to Google, so misconfiguration could impact tracking/compliance. Scope is limited to adding three new consent keys plus test updates.

Overview
Adds support for Google Consent Mode v2’s new consent types—functionality_storage, personalization_storage, and security_storage—in both the GA4 and GTM kits by extending the consent-property allowlist and wiring new default setting keys into the Google-to-mParticle consent settings mapping.

Updates GA4 and GTM test suites to include these new consent purposes in mocked GDPR consent state, consent mapping inputs, and expected dataLayer consent payload assertions for both default and update flows.

Written by Cursor Bugbot for commit e3fecdf. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

defaultAnalyticsStorageConsentWeb: 'Denied',
defaultFunctionalityStorageConsentWeb: 'Granted',
defaultPersonalizationStorageConsentWeb: 'Denied',
defaultSecurityStorageConsentWeb: 'Granted',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GA4 settings-defaults test missing new consent types

Low Severity

The GTM test for "consent mappings is undefined but settings defaults are defined" was updated with defaultFunctionalityStorageConsentWeb, defaultPersonalizationStorageConsentWeb, and defaultSecurityStorageConsentWeb settings and corresponding expected values, but the equivalent GA4 test at line 3356 was not. The GA4 test still only passes the original four default consent settings (defaultAdUserDataConsentSDK, etc.) and omits defaultFunctionalityStorageConsentSDK, defaultPersonalizationStorageConsentSDK, and defaultSecurityStorageConsentSDK. This means the GA4 kit's handling of the three new consent types via settings defaults (without mappings) is untested.

Additional Locations (1)
Fix in Cursor Fix in Web

Copy link
Contributor

@nickolas-dimitrakas nickolas-dimitrakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@khushi1033 khushi1033 merged commit 5811cbb into workstation/3.0-Release Mar 23, 2026
58 of 64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants