segmentio / analytics-next

Segment Analytics.js 2.0
https://segment.com/docs/connections/sources/catalog/libraries/website/javascript
MIT License
403 stars 136 forks source link

Consent module pollutes logs when using OneTrust's "Consent Rate Optimization" feature. #1049

Closed backjo closed 6 months ago

backjo commented 6 months ago

When using OneTrust's 'Consent Rate Optimization' feature, they ask you to populate the OneTrust global object in the following shape:

window.OneTrust = {"id":"423070798","isAnonymous":false,"token":"<someJWT>"}})

This is causing a lot of log noise due to this validation error -> https://github.com/segmentio/analytics-next/blob/50a969bacc943abb4bd52ec158a66babf426beef/packages/consent/consent-wrapper-onetrust/src/lib/onetrust-api.ts#L64

silesky commented 6 months ago

Fixed in https://github.com/segmentio/analytics-next/releases/tag/%40segment%2Fanalytics-consent-wrapper-onetrust%400.4.1