Skip to content

Commit

Permalink
Merge pull request #108 from Giphy/task/improve-moat-logs
Browse files Browse the repository at this point in the history
Task/improve moat logs
  • Loading branch information
cgmaier authored Jan 31, 2020
2 parents 3144c3a + e01a83d commit a7515be
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Sources/GiphyTracking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ extension GPHMedia {
}
}
guard let partner = GiphyCore.partner, let script = GiphyCore.omidJS, scripts.count > 0 else { return }
GiphyCore.log("OM:",bottleData?.tid ?? ""," creating and adding session")

GiphyCore.log("OM:",bottleData?.tid ?? ""," creating and adding session for ", self.type.rawValue)

// setup context
var _context: OMIDGiphyAdSessionContext?
Expand Down Expand Up @@ -104,6 +105,7 @@ extension GPHMedia {


let adSession = GPHAdSession(session: session)
adSession.mediaType = self.type
adSession.tid = bottleData?.tid ?? ""
GPHTrackingManager.adSessions[self] = adSession
GiphyCore.log("OM:", bottleData?.tid ?? ""," session created successfully")
Expand All @@ -123,6 +125,7 @@ class GPHAdSession: NSObject {
private var omSession: OMIDGiphyAdSession?
var hasLoggedImpression: Bool = false
var tid = ""
var mediaType: GPHMediaType = .gif

weak var view: UIView? {
didSet {
Expand All @@ -147,7 +150,6 @@ class GPHAdSession: NSObject {
// add friendly obstruction views, like the ad pill
for subview in mainAdView.subviews {
if subview is GPHFriendlyObstructionView {
GiphyCore.log("OM:",tid," adding friendly obstruction view")
omSession?.addFriendlyObstruction(subview)
}
}
Expand All @@ -172,11 +174,11 @@ class GPHAdSession: NSObject {
GiphyCore.log("OM: logging an impression failed:", error)
return
}
GiphyCore.log("OM:",tid," impression occured")
GiphyCore.log("OM:",tid," impression occured for: ", self.mediaType.rawValue)
}

func finish() {
GiphyCore.log("OM:",tid," finishing session")
GiphyCore.log("OM:",tid," finishing session for: ", self.mediaType.rawValue)
omSession?.finish()
}
}
Expand Down

0 comments on commit a7515be

Please sign in to comment.