Derive consent mode from geolocation, not banner config
The consent mode is now determined dynamically by the visitor's country and its applicable regulation. The configured consent_mode column is dropped from cookie_banners and added to cookie_consent_records to persist the geo-derived mode at consent-recording time. When no regulation matches, the default is OPT_OUT. Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -1239,7 +1239,6 @@ func CreateCookieBanner(c *testutil.Client, attrs ...Attrs) string {
|
||||
"origin": a.getString("origin", SafeOrigin()),
|
||||
"cookiePolicyUrl": a.getString("cookiePolicyUrl", "https://example.com/cookies"),
|
||||
"consentExpiryDays": a.getInt("consentExpiryDays", 365),
|
||||
"consentMode": a.getString("consentMode", "OPT_IN"),
|
||||
}
|
||||
if ppURL := a.getStringPtr("privacyPolicyUrl"); ppURL != nil {
|
||||
input["privacyPolicyUrl"] = *ppURL
|
||||
@@ -1295,11 +1294,6 @@ func (b *CookieBannerBuilder) WithConsentExpiryDays(days int) *CookieBannerBuild
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *CookieBannerBuilder) WithConsentMode(mode string) *CookieBannerBuilder {
|
||||
b.attrs["consentMode"] = mode
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *CookieBannerBuilder) Create() string {
|
||||
return CreateCookieBanner(b.client, b.attrs)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user