Repository: Automattic/pocket-casts-ios
File: podcasts/AnalyticsHelper.swift (Swift)

Code before:
    }

    class func listImpression(listId: String, category: String?) {
        var properties = ["list_id": listId]
        if let category {
            properties["category"] = category
        }
        Analytics.track(.discoverListImpression, properties: properties)
        bumpStat("discover_list_impression", parameters: properties)
    }

    class func bannerImpression(adID: String, source: String) {
        let properties = ["id": adID, "promotion": source]
        Analytics.track(.bannerAdImpression, properties: properties)
        bumpStat("banner_ad_impression", parameters: properties)
    }

    class func bannerTapped(adID: String, source: String) {
        let properties = ["id": adID, "promotion": source]
        Analytics.track(.bannerAdTapped, properties: properties)
        bumpStat("banner_ad_tapped", parameters: properties)
    }

    class func bannerReport(adID: String, reason: String, source: Any) {
        let properties = ["id": adID, "promotion": source]
        Analytics.track(.bannerAdReport, properties: properties)
        bumpStat("banner_ad_report", parameters: properties)
        Analytics.track(.bannerAdReport, source: source, properties: [
            "ad_id": adID,
            "reason": reason
        ])
    }

    class func forceTouchPlay() {
        logEvent("play_force_touch", parameters: nil)
    }

    class func forceTouchPause() {
        logEvent("pause_force_touch", parameters: nil)
    }

    class func forceTouchMarkPlayed() {
        logEvent("mark_as_played_force_touch", parameters: nil)
    }

    class func forceTouchTopFilter() {
        logEvent("top_filter_force_touch", parameters: nil)
    }

    class func forceTouchPodcast() {
        logEvent("podcast_force_touch", parameters: nil)

Review comment (suggestion):
@bjtitus I see the banner reported twice. Is it correct?
Example:
```
🔵 Tracked: banner_ad_report ["id": "7d972870-4509-013e-6964-3697f02c49bb", "promotion": "player"]
🔵 Tracked: banner_ad_report ["ad_id": "7d972870-4509-013e-6964-3697f02c49bb", "source": "player", "reason": "malicious"]
```

Code after:
    }

    class func listImpression(listId: String, category: String?) {
        var properties = ["list_id": listId]
        if let category {
            properties["category"] = category
        }
        Analytics.track(.discoverListImpression, properties: properties)
        bumpStat("discover_list_impression", parameters: properties)
    }

    class func bannerImpression(adID: String, source: String) {
        let properties = ["id": adID, "promotion": source]
        Analytics.track(.bannerAdImpression, properties: properties)
        bumpStat("banner_ad_impression", parameters: properties)
    }

    class func bannerTapped(adID: String, source: String) {
        let properties = ["id": adID, "promotion": source]
        Analytics.track(.bannerAdTapped, properties: properties)
        bumpStat("banner_ad_tapped", parameters: properties)
    }

    class func bannerReport(adID: String, reason: String, source: Any) {
        let properties = ["ad_id": adID, "promotion": source, "reason": reason]
        Analytics.track(.bannerAdReport, properties: properties)
        bumpStat("banner_ad_report", parameters: properties)
    }

    class func forceTouchPlay() {
        logEvent("play_force_touch", parameters: nil)
    }

    class func forceTouchPause() {
        logEvent("pause_force_touch", parameters: nil)
    }

    class func forceTouchMarkPlayed() {
        logEvent("mark_as_played_force_touch", parameters: nil)
    }

    class func forceTouchTopFilter() {
        logEvent("top_filter_force_touch", parameters: nil)
    }

    class func forceTouchPodcast() {
        logEvent("podcast_force_touch", parameters: nil)
    }

    class func forceTouchDiscover() {
        logEvent("discover_force_touch", parameters: nil)