segmentio / consent-manager

Drop-in consent management plugin for analytics.js
https://segmentio.github.io/consent-manager/
MIT License
341 stars 142 forks source link

How to overwrite `analytics.identify` call properties in `savePreferences` #243

Closed mfrazie2 closed 2 years ago

mfrazie2 commented 2 years ago

How can I set the context with an IP address at this call site? When loading the Analytics library I currently use analytics.page(null, null, {}, {context: {ip: '0.0.0.0'}}); to prevent IP address from being recorded. Is there a similar means to do this in the Consent Manager?

Issue #29 raised a similar question and was closed without comment. Given the last comment from a Segment maintainer was 2.5 years ago, I thought it would better to open a new issue.

pooyaj commented 2 years ago

@mfrazie2 would using a source middleware ( https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/middleware/ ) solve this issue?