Ignore cookie-database sites in tracker mapping
Cookie-database and consent-directory sites (Cookifi, Cookiepedia, cookiedatabase.org, CookieServe, ...) rank highly in web search only because they catalog cookies, not because they set them. The mapping agent could attribute a tracker to the directory operator itself instead of the vendor the page names. Instruct the agent to treat such results as reference directories and extract the named vendor, never the operator, while keeping a CMP's own product cookie attributable (OptanonConsent -> OneTrust, CookieConsent -> Cookiebot). Add a conservative code backstop that discards attributions to pure aggregators, scoped to exclude CMP vendors so legitimate own-cookie attributions survive. Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
@@ -92,6 +92,39 @@ func TestNameMatchesSiteDomain(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestNameIsCookieDatabaseAggregator(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
vendor string
|
||||
expected bool
|
||||
}{
|
||||
{name: "cookifi is denied", vendor: "Cookifi", expected: true},
|
||||
{name: "cookiepedia is denied", vendor: "cookiepedia", expected: true},
|
||||
{name: "cookie database is denied", vendor: "Cookie Database", expected: true},
|
||||
{name: "cookieserve is denied", vendor: "CookieServe", expected: true},
|
||||
{name: "spacing and casing insensitive", vendor: " COOK IFI ", expected: true},
|
||||
{name: "punctuation insensitive", vendor: "Cookie_Database", expected: true},
|
||||
{name: "onetrust is allowed", vendor: "OneTrust", expected: false},
|
||||
{name: "cookiebot is allowed", vendor: "Cookiebot", expected: false},
|
||||
{name: "cookieyes is allowed", vendor: "CookieYes", expected: false},
|
||||
{name: "cookie-script is allowed", vendor: "Cookie-Script", expected: false},
|
||||
{name: "unrelated vendor is allowed", vendor: "Google Analytics", expected: false},
|
||||
{name: "empty name", vendor: "", expected: false},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(
|
||||
tt.name,
|
||||
func(t *testing.T) {
|
||||
t.Parallel()
|
||||
assert.Equal(t, tt.expected, nameIsCookieDatabaseAggregator(tt.vendor))
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNormalizeAlnum(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user