Skip to content

Commit beb8462

Browse files
authored
Merge pull request #1843 from SUI-Components/fix/pde-consents
feat(packages/sui-pde): avoid sending impression when consents are not accepted
2 parents 2b96994 + 4dd520d commit beb8462

File tree

1 file changed

+4
-5
lines changed
  • packages/sui-pde/src/adapters/optimizely

1 file changed

+4
-5
lines changed

packages/sui-pde/src/adapters/optimizely/index.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,15 @@ export default class OptimizelyAdapter {
126126
* @returns {object} decision
127127
*/
128128
decide({name, attributes}) {
129-
if (!this._hasUserConsents) {
130-
return {enabled: false, flagKey: name}
131-
}
132-
133129
const user = this._optimizely.createUserContext(this._userId, {
134130
...this._applicationAttributes,
135131
...attributes
136132
})
137133

138-
return user.decide(name)
134+
return user.decide(
135+
name,
136+
!this._hasUserConsents ? [optimizelySDK.OptimizelyDecideOption.DISABLE_DECISION_EVENT] : undefined
137+
)
139138
}
140139

141140
/**

0 commit comments

Comments
 (0)