Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the Google Tag Manager forwarder’s consent handling to support three additional Google consent types and allows configuring their default values via forwarder settings.
Changes:
- Added
functionality_storage,personalization_storage, andsecurity_storageto the list of supported Google consent properties. - Added new forwarder setting mappings for default consent values for the new consent types.
- Added unit tests covering default-settings behavior and consent-mapping behavior for the new consent types.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/consent.js |
Extends supported consent properties and settings-to-consent mapping for the three new consent types. |
test/tests.js |
Adds unit tests validating default consent payloads and mapping behavior for the three new consent types. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
test/tests.js
Outdated
| ); | ||
|
|
||
| var expectedDataLayer = [ |
There was a problem hiding this comment.
Pull request overview
Adds support for three additional Google Consent Mode consent types in the Google Tag Manager kit, allowing them to be set via forwarder default settings or mapped from the user’s GDPR consent state.
Changes:
- Extend the supported Google consent property allowlist to include
functionality_storage,personalization_storage, andsecurity_storage. - Add forwarder default-setting key mappings for the three new consent properties.
- Add unit tests validating default-settings behavior and consent-mapping behavior for the new properties.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/consent.js |
Adds the three new consent properties to the valid property list and maps them to new forwarder default settings keys. |
test/tests.js |
Adds unit coverage for default settings and consentMappingWeb → GDPR consent state mapping for the new consent types. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
test/tests.js
Outdated
| it('should support functionality_storage, personalization_storage, and security_storage consent types', (done) => { | ||
| mParticle.forwarder.init( |
There was a problem hiding this comment.
Where it makes sense, instead of having separate tests for this, i'd recommend you include these in any previous tests that currently test the existing consent types ad_storage, ad_user_data, etc.
This is better for maintainability.
There was a problem hiding this comment.
Yeah that makes sense in this case. Removed the extra test, and just added the changes to the existing tests.
* feat: add new consent settings * test: fix getCurrentUser mock state leak in consent tests * test: add changes to existing tests
# [2.3.0](v2.2.0...v2.3.0) (2026-03-16) ### Features * add new consent settings ([#53](#53)) ([9568261](9568261))
Instructions
developmentSummary
Testing Plan
Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)