Skip to content

Commit

Permalink
Add new attribution pixel (#1388)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/414235014887631/1203017403159775/f

Description:
Class that aggregates detected Ad Attributions on a websites and stores that count over a certain time interval.
  • Loading branch information
jaceklyp authored Jul 28, 2023
1 parent 7d7d2cb commit 46435ec
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10108,7 +10108,7 @@
repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 70.0.0;
version = 71.0.0;
};
};
AA06B6B52672AF8100F541C5 /* XCRemoteSwiftPackageReference "Sparkle" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/BrowserServicesKit",
"state" : {
"revision" : "214db1a9aceb643cbb5bf070b61d8f65ec196e1c",
"version" : "70.0.0"
"revision" : "f255099c2c373d7b0c484849b8903831e7b717ce",
"version" : "71.0.0"
}
},
{
Expand Down
2 changes: 2 additions & 0 deletions DuckDuckGo/ContentBlocker/ContentBlocking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ final class AppContentBlocking {
domainEvent = .adClickAttributionDetected
case .adAttributionActive:
domainEvent = .adClickAttributionActive
case .adAttributionPageLoads:
domainEvent = .adClickAttributionPageLoads
}

Pixel.fire(domainEvent, withAdditionalParameters: parameters ?? [:])
Expand Down
4 changes: 4 additions & 0 deletions DuckDuckGo/Statistics/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ extension Pixel {

case adClickAttributionDetected
case adClickAttributionActive
case adClickAttributionPageLoads

case emailEnabled
case emailDisabled
Expand Down Expand Up @@ -312,6 +313,9 @@ extension Pixel.Event {
case .adClickAttributionActive:
return "m_mac_ad_click_active"

case .adClickAttributionPageLoads:
return "m_mac_ad_click_page_loads"

// Deliberately omit the `m_mac_` prefix in order to format these pixels the same way as other platforms
case .emailEnabled: return "email_enabled_macos_desktop"
case .emailDisabled: return "email_disabled_macos_desktop"
Expand Down
1 change: 1 addition & 0 deletions DuckDuckGo/Statistics/PixelParameters.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ extension Pixel.Event {
.ampBlockingRulesCompilationFailed,
.adClickAttributionDetected,
.adClickAttributionActive,
.adClickAttributionPageLoads,
.emailEnabled,
.emailDisabled,
.emailUserCreatedAlias,
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/NetworkProtectionUI/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ let package = Package(
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "70.0.0"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "71.0.0"),
.package(path: "../SwiftUIExtensions")
],
targets: [
Expand Down

0 comments on commit 46435ec

Please sign in to comment.