Manos Chorianopoulos

add trackers final

...@@ -227,6 +227,8 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{ ...@@ -227,6 +227,8 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
227 firebaseEvent.setParameter = ("type", "gift") 227 firebaseEvent.setParameter = ("type", "gift")
228 SwiftEventBus.post("firebase", sender: firebaseEvent) 228 SwiftEventBus.post("firebase", sender: firebaseEvent)
229 229
230 + swiftApi().logTrackersEvent("click", ("Contextual:" + (campaigns[indexPath.row]._ccms?._sessionId ?? "")))
231 +
230 let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self)) 232 let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
231 let vc = storyboard.instantiateViewController(withIdentifier: "ContextualViewController") as! SwiftWarplyFramework.ContextualViewController 233 let vc = storyboard.instantiateViewController(withIdentifier: "ContextualViewController") as! SwiftWarplyFramework.ContextualViewController
232 vc.ccms = campaigns[indexPath.row]._ccms 234 vc.ccms = campaigns[indexPath.row]._ccms
...@@ -244,6 +246,8 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{ ...@@ -244,6 +246,8 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
244 for item in ccmsCampaigns { 246 for item in ccmsCampaigns {
245 if (item._loyaltyCampaignId == campaigns[indexPath.row].session_uuid) { 247 if (item._loyaltyCampaignId == campaigns[indexPath.row].session_uuid) {
246 248
249 + swiftApi().logTrackersEvent("click", ("Telco:" + (item._sessionId)))
250 +
247 let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel() 251 let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
248 firebaseEvent._eventName = "loyalty_sdk_offer_selected" 252 firebaseEvent._eventName = "loyalty_sdk_offer_selected"
249 firebaseEvent.setParameter = ("name", (item._title)) 253 firebaseEvent.setParameter = ("name", (item._title))
...@@ -273,6 +277,8 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{ ...@@ -273,6 +277,8 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
273 for item in couponsetsList { 277 for item in couponsetsList {
274 if (item.uuid == couponsetUuid) { 278 if (item.uuid == couponsetUuid) {
275 279
280 + swiftApi().logTrackersEvent("click", ("Loyalty:" + (campaigns[indexPath.row].session_uuid ?? "")))
281 +
276 let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel() 282 let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
277 firebaseEvent._eventName = "loyalty_sdk_offer_selected" 283 firebaseEvent._eventName = "loyalty_sdk_offer_selected"
278 firebaseEvent.setParameter = ("name", (item.name ?? "")) 284 firebaseEvent.setParameter = ("name", (item.name ?? ""))
...@@ -327,6 +333,8 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{ ...@@ -327,6 +333,8 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
327 ccmsCampaignFound = item 333 ccmsCampaignFound = item
328 } 334 }
329 } 335 }
336 + swiftApi().logTrackersEvent("click", ("Contextual:" + (ccmsCampaignFound._sessionId)))
337 +
330 url = swiftApi().constructCcmsUrl(campaigns[indexPath.row], ccmsCampaignFound) 338 url = swiftApi().constructCcmsUrl(campaigns[indexPath.row], ccmsCampaignFound)
331 params = swiftApi().constructCcmsParams(campaigns[indexPath.row], ccmsCampaignFound) 339 params = swiftApi().constructCcmsParams(campaigns[indexPath.row], ccmsCampaignFound)
332 340
...@@ -343,6 +351,8 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{ ...@@ -343,6 +351,8 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
343 print("CCMS_CLICK " + String(data: data, encoding: .utf8)!) 351 print("CCMS_CLICK " + String(data: data, encoding: .utf8)!)
344 352
345 } else { 353 } else {
354 + swiftApi().logTrackersEvent("click", ("Loyalty:" + (campaigns[indexPath.row].session_uuid ?? "")))
355 +
346 url = swiftApi().constructCampaignUrl(campaigns[indexPath.row]) 356 url = swiftApi().constructCampaignUrl(campaigns[indexPath.row])
347 params = swiftApi().constructCampaignParams(campaigns[indexPath.row]) 357 params = swiftApi().constructCampaignParams(campaigns[indexPath.row])
348 358
......
...@@ -267,6 +267,8 @@ extension MFYViewController: UITableViewDelegate, UITableViewDataSource{ ...@@ -267,6 +267,8 @@ extension MFYViewController: UITableViewDelegate, UITableViewDataSource{
267 firebaseEvent.setParameter = ("type", "gift") 267 firebaseEvent.setParameter = ("type", "gift")
268 SwiftEventBus.post("firebase", sender: firebaseEvent) 268 SwiftEventBus.post("firebase", sender: firebaseEvent)
269 269
270 + swiftApi().logTrackersEvent("click", ("Contextual:" + (campaign._ccms?._sessionId ?? "")))
271 +
270 let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self)) 272 let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
271 let vc = storyboard.instantiateViewController(withIdentifier: "ContextualViewController") as! SwiftWarplyFramework.ContextualViewController 273 let vc = storyboard.instantiateViewController(withIdentifier: "ContextualViewController") as! SwiftWarplyFramework.ContextualViewController
272 vc.ccms = campaign._ccms 274 vc.ccms = campaign._ccms
...@@ -284,6 +286,8 @@ extension MFYViewController: UITableViewDelegate, UITableViewDataSource{ ...@@ -284,6 +286,8 @@ extension MFYViewController: UITableViewDelegate, UITableViewDataSource{
284 for item in ccmsCampaigns { 286 for item in ccmsCampaigns {
285 if (item._loyaltyCampaignId == campaign.session_uuid) { 287 if (item._loyaltyCampaignId == campaign.session_uuid) {
286 288
289 + swiftApi().logTrackersEvent("click", ("Telco:" + (item._sessionId)))
290 +
287 let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel() 291 let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
288 firebaseEvent._eventName = "loyalty_sdk_offer_selected" 292 firebaseEvent._eventName = "loyalty_sdk_offer_selected"
289 firebaseEvent.setParameter = ("name", (item._title)) 293 firebaseEvent.setParameter = ("name", (item._title))
...@@ -312,6 +316,8 @@ extension MFYViewController: UITableViewDelegate, UITableViewDataSource{ ...@@ -312,6 +316,8 @@ extension MFYViewController: UITableViewDelegate, UITableViewDataSource{
312 for item in couponsetsList { 316 for item in couponsetsList {
313 if (item.uuid == couponsetUuid) { 317 if (item.uuid == couponsetUuid) {
314 318
319 + swiftApi().logTrackersEvent("click", ("Loyalty:" + (campaign.session_uuid ?? "")))
320 +
315 let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel() 321 let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
316 firebaseEvent._eventName = "loyalty_sdk_offer_selected" 322 firebaseEvent._eventName = "loyalty_sdk_offer_selected"
317 firebaseEvent.setParameter = ("name", (item.name ?? "")) 323 firebaseEvent.setParameter = ("name", (item.name ?? ""))
...@@ -372,6 +378,9 @@ extension MFYViewController: UITableViewDelegate, UITableViewDataSource{ ...@@ -372,6 +378,9 @@ extension MFYViewController: UITableViewDelegate, UITableViewDataSource{
372 ccmsCampaignFound = item 378 ccmsCampaignFound = item
373 } 379 }
374 } 380 }
381 +
382 + swiftApi().logTrackersEvent("click", ("Contextual:" + (ccmsCampaignFound._sessionId)))
383 +
375 url = swiftApi().constructCcmsUrl(campaign, ccmsCampaignFound) 384 url = swiftApi().constructCcmsUrl(campaign, ccmsCampaignFound)
376 params = swiftApi().constructCcmsParams(campaign, ccmsCampaignFound) 385 params = swiftApi().constructCcmsParams(campaign, ccmsCampaignFound)
377 386
...@@ -388,6 +397,8 @@ extension MFYViewController: UITableViewDelegate, UITableViewDataSource{ ...@@ -388,6 +397,8 @@ extension MFYViewController: UITableViewDelegate, UITableViewDataSource{
388 print("CCMS_CLICK " + String(data: data, encoding: .utf8)!) 397 print("CCMS_CLICK " + String(data: data, encoding: .utf8)!)
389 398
390 } else { 399 } else {
400 + swiftApi().logTrackersEvent("click", ("Loyalty:" + (campaign.session_uuid ?? "")))
401 +
391 url = swiftApi().constructCampaignUrl(campaign) 402 url = swiftApi().constructCampaignUrl(campaign)
392 params = swiftApi().constructCampaignParams(campaign) 403 params = swiftApi().constructCampaignParams(campaign)
393 404
......
...@@ -415,6 +415,8 @@ import SwiftEventBus ...@@ -415,6 +415,8 @@ import SwiftEventBus
415 415
416 // MARK: - Actions 416 // MARK: - Actions
417 @IBAction func qustionnaireButtonAction(_ sender: Any) { 417 @IBAction func qustionnaireButtonAction(_ sender: Any) {
418 + swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "Questionnaire"))
419 +
418 swiftApi().openQuestionnaire(self); 420 swiftApi().openQuestionnaire(self);
419 } 421 }
420 422
...@@ -429,6 +431,8 @@ import SwiftEventBus ...@@ -429,6 +431,8 @@ import SwiftEventBus
429 firebaseEvent._eventName = "did_tap_gifts_for_you_badge" 431 firebaseEvent._eventName = "did_tap_gifts_for_you_badge"
430 firebaseEvent.setParameter = ("screen", "Loyalty Wallet") 432 firebaseEvent.setParameter = ("screen", "Loyalty Wallet")
431 SwiftEventBus.post("firebase", sender: firebaseEvent) 433 SwiftEventBus.post("firebase", sender: firebaseEvent)
434 +
435 + swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "DealsBanner"))
432 } 436 }
433 @IBAction func couponEarnButtonAction(_ sender: Any) { 437 @IBAction func couponEarnButtonAction(_ sender: Any) {
434 438
...@@ -437,12 +441,17 @@ import SwiftEventBus ...@@ -437,12 +441,17 @@ import SwiftEventBus
437 firebaseEvent.setParameter = ("screen", "Loyalty Wallet") 441 firebaseEvent.setParameter = ("screen", "Loyalty Wallet")
438 SwiftEventBus.post("firebase", sender: firebaseEvent) 442 SwiftEventBus.post("firebase", sender: firebaseEvent)
439 443
444 + swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "LoyaltyBanner"))
445 +
440 let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self)) 446 let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
441 let vc = storyboard.instantiateViewController(withIdentifier: "LoyaltyAnalysisViewController") as! SwiftWarplyFramework.LoyaltyAnalysisViewController 447 let vc = storyboard.instantiateViewController(withIdentifier: "LoyaltyAnalysisViewController") as! SwiftWarplyFramework.LoyaltyAnalysisViewController
442 self.navigationController?.pushViewController(vc, animated: true) 448 self.navigationController?.pushViewController(vc, animated: true)
443 } 449 }
444 @IBAction func activeCodeButtonAction(_ sender: Any) { 450 @IBAction func activeCodeButtonAction(_ sender: Any) {
445 print("Active DFY coupon banner Tapped!") 451 print("Active DFY coupon banner Tapped!")
452 +
453 + swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "ActiveDealsBanner"))
454 +
446 let couponDetails = swiftApi.ActiveDFYCouponEventModel() 455 let couponDetails = swiftApi.ActiveDFYCouponEventModel()
447 couponDetails._isPressed = true 456 couponDetails._isPressed = true
448 SwiftEventBus.post("dfy_coupon_details", sender: couponDetails) 457 SwiftEventBus.post("dfy_coupon_details", sender: couponDetails)
...@@ -476,6 +485,10 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{ ...@@ -476,6 +485,10 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{
476 485
477 public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 486 public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
478 487
488 + let couponSetData: swiftApi.CouponSetItemModel? = coupons[indexPath.row].couponset_data
489 + let couponName = couponSetData?.name ?? ""
490 + swiftApi().logTrackersEvent("click", ("Coupon:" + couponName))
491 +
479 let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self)) 492 let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
480 let vc = storyboard.instantiateViewController(withIdentifier: "CouponBarcodeViewController") as! SwiftWarplyFramework.CouponBarcodeViewController 493 let vc = storyboard.instantiateViewController(withIdentifier: "CouponBarcodeViewController") as! SwiftWarplyFramework.CouponBarcodeViewController
481 vc.coupon = coupons[indexPath.row] 494 vc.coupon = coupons[indexPath.row]
......
...@@ -5029,6 +5029,8 @@ public class swiftApi { ...@@ -5029,6 +5029,8 @@ public class swiftApi {
5029 for item in couponsetsList { 5029 for item in couponsetsList {
5030 if (item.uuid == couponsetUuid) { 5030 if (item.uuid == couponsetUuid) {
5031 5031
5032 + swiftApi().logTrackersEvent("click", ("Loyalty:" + (campaign.session_uuid ?? "")))
5033 +
5032 let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel() 5034 let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
5033 firebaseEvent._eventName = "loyalty_sdk_offer_selected" 5035 firebaseEvent._eventName = "loyalty_sdk_offer_selected"
5034 firebaseEvent.setParameter = ("name", (item.name ?? "")) 5036 firebaseEvent.setParameter = ("name", (item.name ?? ""))
...@@ -5051,6 +5053,8 @@ public class swiftApi { ...@@ -5051,6 +5053,8 @@ public class swiftApi {
5051 } 5053 }
5052 5054
5053 } else { 5055 } else {
5056 + swiftApi().logTrackersEvent("click", ("Loyalty:" + (campaign.session_uuid ?? "")))
5057 +
5054 let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self)) 5058 let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
5055 let vc = storyboard.instantiateViewController(withIdentifier: "CampaignViewController") as! SwiftWarplyFramework.CampaignViewController 5059 let vc = storyboard.instantiateViewController(withIdentifier: "CampaignViewController") as! SwiftWarplyFramework.CampaignViewController
5056 5060
...@@ -5083,6 +5087,8 @@ public class swiftApi { ...@@ -5083,6 +5087,8 @@ public class swiftApi {
5083 5087
5084 if ((ccms._loyaltyCampaignId == "") || (ccms._loyaltyCampaignId == "NA")) { 5088 if ((ccms._loyaltyCampaignId == "") || (ccms._loyaltyCampaignId == "NA")) {
5085 5089
5090 + swiftApi().logTrackersEvent("click", ("Contextual:" + (ccms._sessionId)))
5091 +
5086 let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel() 5092 let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
5087 firebaseEvent._eventName = "loyalty_sdk_offer_selected" 5093 firebaseEvent._eventName = "loyalty_sdk_offer_selected"
5088 firebaseEvent.setParameter = ("name", (ccms._title)) 5094 firebaseEvent.setParameter = ("name", (ccms._title))
...@@ -5104,6 +5110,8 @@ public class swiftApi { ...@@ -5104,6 +5110,8 @@ public class swiftApi {
5104 5110
5105 if (isCcmsOffer && (loyaltyCampaign.session_uuid == ccms._loyaltyCampaignId)) { 5111 if (isCcmsOffer && (loyaltyCampaign.session_uuid == ccms._loyaltyCampaignId)) {
5106 5112
5113 + swiftApi().logTrackersEvent("click", ("Contextual:" + (ccms._sessionId)))
5114 +
5107 let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self)) 5115 let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
5108 let vc = storyboard.instantiateViewController(withIdentifier: "CampaignViewController") as! SwiftWarplyFramework.CampaignViewController 5116 let vc = storyboard.instantiateViewController(withIdentifier: "CampaignViewController") as! SwiftWarplyFramework.CampaignViewController
5109 vc.campaignUrl = swiftApi().constructCcmsUrl(loyaltyCampaign, ccms) 5117 vc.campaignUrl = swiftApi().constructCcmsUrl(loyaltyCampaign, ccms)
...@@ -5117,6 +5125,8 @@ public class swiftApi { ...@@ -5117,6 +5125,8 @@ public class swiftApi {
5117 5125
5118 } else if (isTelco && (loyaltyCampaign.session_uuid == ccms._loyaltyCampaignId)) { 5126 } else if (isTelco && (loyaltyCampaign.session_uuid == ccms._loyaltyCampaignId)) {
5119 5127
5128 + swiftApi().logTrackersEvent("click", ("Telco:" + (ccms._sessionId)))
5129 +
5120 let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel() 5130 let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
5121 firebaseEvent._eventName = "loyalty_sdk_offer_selected" 5131 firebaseEvent._eventName = "loyalty_sdk_offer_selected"
5122 firebaseEvent.setParameter = ("name", (ccms._title)) 5132 firebaseEvent.setParameter = ("name", (ccms._title))
......