Skip to content

Commit aa56556

Browse files
authored
Treat C001 as a regular category in OneTrust consent wrapper. (#895)
1 parent ddb9eea commit aa56556

File tree

3 files changed

+6
-21
lines changed

3 files changed

+6
-21
lines changed

.changeset/swift-falcons-wonder.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@segment/analytics-consent-wrapper-onetrust': patch
3+
---
4+
5+
Remove strictly neccessary cookie logic

packages/consent/consent-wrapper-onetrust/src/domain/wrapper.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
} from '@segment/analytics-consent-tools'
88

99
import {
10-
isAllTrackingDisabled,
1110
getConsentedGroupIds,
1211
getGroupData,
1312
getOneTrustGlobal,
@@ -22,7 +21,7 @@ export const oneTrust = (
2221
options: OneTrustOptions = {}
2322
) =>
2423
createWrapper({
25-
shouldLoad: async (ctx) => {
24+
shouldLoad: async () => {
2625
await resolveWhen(() => {
2726
const oneTrustGlobal = getOneTrustGlobal()
2827
return (
@@ -31,16 +30,8 @@ export const oneTrust = (
3130
oneTrustGlobal.IsAlertBoxClosed()
3231
)
3332
}, 500)
34-
35-
const trackingDisabled = isAllTrackingDisabled(getConsentedGroupIds())
36-
if (trackingDisabled) {
37-
ctx.abort({
38-
loadSegmentNormally: false,
39-
})
40-
}
4133
},
4234
getCategories: (): Categories => {
43-
// TODO: Do we check if *all* the destination's mapped cookie categories are consented by the user in the browser.?
4435
// so basically, if a user has 2 categories defined in the UI: [Functional, Advertising],
4536
// we need _all_ those categories to be valid
4637

@@ -51,7 +42,6 @@ export const oneTrust = (
5142
// - if the user has selected categories this session
5243
// - if user has no categories selected because they deliberately do not consent to anything and the popup was dismissed in a previous session
5344
const { userSetConsentGroups, userDeniedConsentGroups } = getGroupData()
54-
// TODO: filter by relevent categories
5545
const consentedCategories = userSetConsentGroups.reduce<Categories>(
5646
(acc, c) => {
5747
return {

packages/consent/consent-wrapper-onetrust/src/lib/onetrust-api.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,3 @@ export const getGroupData = (): UserConsentGroupData => {
8585

8686
return userConsentGroupData
8787
}
88-
89-
/**
90-
* The website needs these cookies in order to function properly (example: identify items placed into a shopping cart).
91-
* This category is enabled by default, even if user has not made a selection.
92-
*/
93-
const STRICTLY_NECCESSARY_CATEGORY = 'C0001'
94-
95-
export const isAllTrackingDisabled = (groupIds: string[]): boolean => {
96-
return groupIds.length === 1 && groupIds[0] === STRICTLY_NECCESSARY_CATEGORY
97-
}

0 commit comments

Comments
 (0)