-
-
Notifications
You must be signed in to change notification settings - Fork 779
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Merge branch 'main' into twn
Showing
10 changed files
with
161 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import Foundation | ||
import WMF | ||
|
||
final class ArticleLinkInteractionFunnel { | ||
|
||
static let shared = ArticleLinkInteractionFunnel() | ||
|
||
private enum Action: String, Codable { | ||
case navigate = "navigate" | ||
} | ||
|
||
private struct Event: EventInterface { | ||
static let schema: EventPlatformClient.Schema = .articleLinkInteraction | ||
let action: Action | ||
let pageID: Int | ||
let wikiID: String | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case action = "action" | ||
case pageID = "page_id" | ||
case wikiID = "wiki_db" | ||
} | ||
} | ||
|
||
private func logEvent(action: ArticleLinkInteractionFunnel.Action, pageID: Int, project: WikimediaProject) { | ||
|
||
let wikiID = project.notificationsApiWikiIdentifier | ||
|
||
let event: ArticleLinkInteractionFunnel.Event = ArticleLinkInteractionFunnel.Event(action: action, pageID: pageID, wikiID: wikiID) | ||
EventPlatformClient.shared.submit(stream: .articleLinkInteraction, event: event) | ||
} | ||
|
||
func logArticleView(pageID: Int, project: WikimediaProject) { | ||
logEvent(action: .navigate, pageID: pageID, project: project) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-6 Bytes
(100%)
Wikipedia/iOS Native Localizations/en.lproj/Localizable.strings
Binary file not shown.