Skip to content

Commit

Permalink
fix(analytics): adding in a way to get mac analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
bassrock committed Jan 22, 2024
1 parent 7fee044 commit 312ad22
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion PocketKit/Sources/Analytics/Entities/APIUserEntity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ public struct APIUserEntity: Entity {
public init(consumerKey: String) {
let components = consumerKey.components(separatedBy: "-")
let id: UInt
if let identifier = components.first, let apiID = UInt(identifier) {
if ProcessInfo.processInfo.isiOSAppOnMac {
// Hack to attribute analytics to our Mac Version of Pocket.
// In the future we need to do something more with ouir app id.
id = 8775
} else if let identifier = components.first, let apiID = UInt(identifier) {
id = apiID
} else {
id = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ public class PocketSnowplowTracker: SnowplowTracker {
.scale
]

if ProcessInfo.processInfo.isiOSAppOnMac {
trackerConfiguration.devicePlatform = .desktop
trackerConfiguration.appId = "pocket-mac-next"
}

let optionalTracker = Snowplow.createTracker(
namespace: appID,
network: networkConfiguration,
Expand Down

0 comments on commit 312ad22

Please sign in to comment.