Skip to content

Commit

Permalink
feat(packages/sui-pde): avoid sending impression when consents are no…
Browse files Browse the repository at this point in the history
…t accepted
  • Loading branch information
andresz1 committed Oct 15, 2024
1 parent 2b96994 commit 4dd520d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/sui-pde/src/adapters/optimizely/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,15 @@ export default class OptimizelyAdapter {
* @returns {object} decision
*/
decide({name, attributes}) {
if (!this._hasUserConsents) {
return {enabled: false, flagKey: name}
}

const user = this._optimizely.createUserContext(this._userId, {
...this._applicationAttributes,
...attributes
})

return user.decide(name)
return user.decide(
name,
!this._hasUserConsents ? [optimizelySDK.OptimizelyDecideOption.DISABLE_DECISION_EVENT] : undefined
)
}

/**
Expand Down

0 comments on commit 4dd520d

Please sign in to comment.