Skip to content

Commit

Permalink
Add expected pixels to ad click attribution test cases (#219)
Browse files Browse the repository at this point in the history
"Pixel" requests are sent by the mechanism DuckDuckGo relies on to
support ad click attribution in DuckDuckGo products. These help
DuckDuckGo validate that the mechanism's logic is working correctly.

Let's note the expected pixels in these shared test cases, so that
each DuckDuckGo product can ensure those requests are being made
correctly.

Further reading:
 - https://duckduckgo.com/duckduckgo-help-pages/privacy/web-tracking-protections/#duckduckgo-private-search-ads
 - https://improving.duckduckgo.com/
  • Loading branch information
kzar committed Aug 2, 2024
1 parent e6899e6 commit 105019e
Showing 1 changed file with 170 additions and 14 deletions.
184 changes: 170 additions & 14 deletions adClickFlow/shared/testCases.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"url": "https://www.search-company.site/#ad-id-1"
},
"expected": {
"url": "https://www.search-company.site/#ad-id-1"
"url": "https://www.search-company.site/#ad-id-1",
"pixels": []
}
},
{
Expand Down Expand Up @@ -37,7 +38,8 @@
"url": "https://www.ad-company.site/ping.gif",
"status": "parent blocked"
}
]
],
"pixels": []
}
}
]
Expand All @@ -52,7 +54,8 @@
"url": "https://www.search-company.site/#ad-id-2"
},
"expected": {
"url": "https://www.search-company.site/#ad-id-2"
"url": "https://www.search-company.site/#ad-id-2",
"pixels": []
}
},
{
Expand Down Expand Up @@ -81,7 +84,8 @@
"url": "https://www.ad-company.site/ping.gif",
"status": "parent blocked"
}
]
],
"pixels": []
}
}
]
Expand All @@ -96,7 +100,8 @@
"url": "https://www.search-company.site/#ad-id-3"
},
"expected": {
"url": "https://www.search-company.site/#ad-id-3"
"url": "https://www.search-company.site/#ad-id-3",
"pixels": []
}
},
{
Expand Down Expand Up @@ -124,7 +129,8 @@
"url": "https://www.ad-company.site/ping.gif",
"status": "parent blocked"
}
]
],
"pixels": []
}
}
]
Expand All @@ -139,7 +145,8 @@
"url": "https://www.search-company.site/#ad-id-4"
},
"expected": {
"url": "https://www.search-company.site/#ad-id-4"
"url": "https://www.search-company.site/#ad-id-4",
"pixels": []
}
},
{
Expand Down Expand Up @@ -168,7 +175,8 @@
"url": "https://www.ad-company.site/ping.gif",
"status": "parent blocked"
}
]
],
"pixels": []
}
}
]
Expand All @@ -183,7 +191,8 @@
"url": "https://www.search-company.site/#ad-id-5"
},
"expected": {
"url": "https://www.search-company.site/#ad-id-5"
"url": "https://www.search-company.site/#ad-id-5",
"pixels": []
}
},
{
Expand Down Expand Up @@ -211,6 +220,29 @@
"url": "https://www.ad-company.site/ping.gif",
"status": "parent blocked"
}
],
"pixels": [
{
"name": "m_ad_click_detected",
"params": {
"appVersion": "APP_VERSION",
"domainDetection": "heuristic_only",
"heuristicDetectionEnabled": "1",
"domainDetectionEnabled": "1"
}
},
{
"name": "m_ad_click_active",
"params": {
"appVersion": "APP_VERSION"
}
},
{
"name": "m_pageloads_with_ad_attribution",
"params": {
"count": "1"
}
}
]
}
}
Expand All @@ -226,7 +258,8 @@
"url": "https://www.search-company.site/#ad-id-6"
},
"expected": {
"url": "https://www.search-company.site/#ad-id-6"
"url": "https://www.search-company.site/#ad-id-6",
"pixels": []
}
},
{
Expand Down Expand Up @@ -255,6 +288,29 @@
"url": "https://www.ad-company.site/ping.gif",
"status": "parent blocked"
}
],
"pixels": [
{
"name": "m_ad_click_detected",
"params": {
"appVersion": "APP_VERSION",
"domainDetection": "heuristic_only",
"heuristicDetectionEnabled": "1",
"domainDetectionEnabled": "1"
}
},
{
"name": "m_ad_click_active",
"params": {
"appVersion": "APP_VERSION"
}
},
{
"name": "m_pageloads_with_ad_attribution",
"params": {
"count": "1"
}
}
]
}
}
Expand All @@ -270,7 +326,8 @@
"url": "https://www.search-company.site/#ad-id-7"
},
"expected": {
"url": "https://www.search-company.site/#ad-id-7"
"url": "https://www.search-company.site/#ad-id-7",
"pixels": []
}
},
{
Expand Down Expand Up @@ -298,6 +355,29 @@
"url": "https://www.ad-company.site/ping.gif",
"status": "parent blocked"
}
],
"pixels": [
{
"name": "m_ad_click_detected",
"params": {
"appVersion": "APP_VERSION",
"domainDetection": "matched",
"heuristicDetectionEnabled": "1",
"domainDetectionEnabled": "1"
}
},
{
"name": "m_ad_click_active",
"params": {
"appVersion": "APP_VERSION"
}
},
{
"name": "m_pageloads_with_ad_attribution",
"params": {
"count": "1"
}
}
]
}
}
Expand All @@ -313,7 +393,8 @@
"url": "https://www.search-company.site/#ad-id-8"
},
"expected": {
"url": "https://www.search-company.site/#ad-id-8"
"url": "https://www.search-company.site/#ad-id-8",
"pixels": []
}
},
{
Expand Down Expand Up @@ -342,6 +423,29 @@
"url": "https://www.ad-company.site/ping.gif",
"status": "parent blocked"
}
],
"pixels": [
{
"name": "m_ad_click_detected",
"params": {
"appVersion": "APP_VERSION",
"domainDetection": "matched",
"heuristicDetectionEnabled": "1",
"domainDetectionEnabled": "1"
}
},
{
"name": "m_ad_click_active",
"params": {
"appVersion": "APP_VERSION"
}
},
{
"name": "m_pageloads_with_ad_attribution",
"params": {
"count": "1"
}
}
]
}
}
Expand All @@ -357,7 +461,8 @@
"url": "https://www.search-company.site/#ad-id-5"
},
"expected": {
"url": "https://www.search-company.site/#ad-id-5"
"url": "https://www.search-company.site/#ad-id-5",
"pixels": []
}
},
{
Expand Down Expand Up @@ -386,6 +491,23 @@
"url": "https://www.ad-company.site/ping.gif",
"status": "parent blocked"
}
],
"pixels": [
{
"name": "m_ad_click_detected",
"params": {
"appVersion": "APP_VERSION",
"domainDetection": "heuristic_only",
"heuristicDetectionEnabled": "1",
"domainDetectionEnabled": "1"
}
},
{
"name": "m_ad_click_active",
"params": {
"appVersion": "APP_VERSION"
}
}
]
}
},
Expand Down Expand Up @@ -414,6 +536,14 @@
"url": "https://www.ad-company.site/ping.gif",
"status": "parent blocked"
}
],
"pixels": [
{
"name": "m_pageloads_with_ad_attribution",
"params": {
"count": "2"
}
}
]
}
}
Expand All @@ -429,7 +559,8 @@
"url": "https://www.search-company.site/#ad-id-5"
},
"expected": {
"url": "https://www.search-company.site/#ad-id-5"
"url": "https://www.search-company.site/#ad-id-5",
"pixels": []
}
},
{
Expand Down Expand Up @@ -457,6 +588,23 @@
"url": "https://www.ad-company.site/ping.gif",
"status": "parent blocked"
}
],
"pixels": [
{
"name": "m_ad_click_detected",
"params": {
"appVersion": "APP_VERSION",
"domainDetection": "heuristic_only",
"heuristicDetectionEnabled": "1",
"domainDetectionEnabled": "1"
}
},
{
"name": "m_ad_click_active",
"params": {
"appVersion": "APP_VERSION"
}
}
]
}
},
Expand Down Expand Up @@ -486,6 +634,14 @@
"url": "https://www.ad-company.site/ping.gif",
"status": "parent blocked"
}
],
"pixels": [
{
"name": "m_pageloads_with_ad_attribution",
"params": {
"count": "2"
}
}
]
}
}
Expand Down

0 comments on commit 105019e

Please sign in to comment.