Manos Chorianopoulos

add trackers final

......@@ -227,6 +227,8 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
firebaseEvent.setParameter = ("type", "gift")
SwiftEventBus.post("firebase", sender: firebaseEvent)
swiftApi().logTrackersEvent("click", ("Contextual:" + (campaigns[indexPath.row]._ccms?._sessionId ?? "")))
let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
let vc = storyboard.instantiateViewController(withIdentifier: "ContextualViewController") as! SwiftWarplyFramework.ContextualViewController
vc.ccms = campaigns[indexPath.row]._ccms
......@@ -244,6 +246,8 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
for item in ccmsCampaigns {
if (item._loyaltyCampaignId == campaigns[indexPath.row].session_uuid) {
swiftApi().logTrackersEvent("click", ("Telco:" + (item._sessionId)))
let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
firebaseEvent._eventName = "loyalty_sdk_offer_selected"
firebaseEvent.setParameter = ("name", (item._title))
......@@ -273,6 +277,8 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
for item in couponsetsList {
if (item.uuid == couponsetUuid) {
swiftApi().logTrackersEvent("click", ("Loyalty:" + (campaigns[indexPath.row].session_uuid ?? "")))
let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
firebaseEvent._eventName = "loyalty_sdk_offer_selected"
firebaseEvent.setParameter = ("name", (item.name ?? ""))
......@@ -327,6 +333,8 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
ccmsCampaignFound = item
}
}
swiftApi().logTrackersEvent("click", ("Contextual:" + (ccmsCampaignFound._sessionId)))
url = swiftApi().constructCcmsUrl(campaigns[indexPath.row], ccmsCampaignFound)
params = swiftApi().constructCcmsParams(campaigns[indexPath.row], ccmsCampaignFound)
......@@ -343,6 +351,8 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
print("CCMS_CLICK " + String(data: data, encoding: .utf8)!)
} else {
swiftApi().logTrackersEvent("click", ("Loyalty:" + (campaigns[indexPath.row].session_uuid ?? "")))
url = swiftApi().constructCampaignUrl(campaigns[indexPath.row])
params = swiftApi().constructCampaignParams(campaigns[indexPath.row])
......
......@@ -267,6 +267,8 @@ extension MFYViewController: UITableViewDelegate, UITableViewDataSource{
firebaseEvent.setParameter = ("type", "gift")
SwiftEventBus.post("firebase", sender: firebaseEvent)
swiftApi().logTrackersEvent("click", ("Contextual:" + (campaign._ccms?._sessionId ?? "")))
let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
let vc = storyboard.instantiateViewController(withIdentifier: "ContextualViewController") as! SwiftWarplyFramework.ContextualViewController
vc.ccms = campaign._ccms
......@@ -284,6 +286,8 @@ extension MFYViewController: UITableViewDelegate, UITableViewDataSource{
for item in ccmsCampaigns {
if (item._loyaltyCampaignId == campaign.session_uuid) {
swiftApi().logTrackersEvent("click", ("Telco:" + (item._sessionId)))
let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
firebaseEvent._eventName = "loyalty_sdk_offer_selected"
firebaseEvent.setParameter = ("name", (item._title))
......@@ -312,6 +316,8 @@ extension MFYViewController: UITableViewDelegate, UITableViewDataSource{
for item in couponsetsList {
if (item.uuid == couponsetUuid) {
swiftApi().logTrackersEvent("click", ("Loyalty:" + (campaign.session_uuid ?? "")))
let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
firebaseEvent._eventName = "loyalty_sdk_offer_selected"
firebaseEvent.setParameter = ("name", (item.name ?? ""))
......@@ -372,6 +378,9 @@ extension MFYViewController: UITableViewDelegate, UITableViewDataSource{
ccmsCampaignFound = item
}
}
swiftApi().logTrackersEvent("click", ("Contextual:" + (ccmsCampaignFound._sessionId)))
url = swiftApi().constructCcmsUrl(campaign, ccmsCampaignFound)
params = swiftApi().constructCcmsParams(campaign, ccmsCampaignFound)
......@@ -388,6 +397,8 @@ extension MFYViewController: UITableViewDelegate, UITableViewDataSource{
print("CCMS_CLICK " + String(data: data, encoding: .utf8)!)
} else {
swiftApi().logTrackersEvent("click", ("Loyalty:" + (campaign.session_uuid ?? "")))
url = swiftApi().constructCampaignUrl(campaign)
params = swiftApi().constructCampaignParams(campaign)
......
......@@ -415,6 +415,8 @@ import SwiftEventBus
// MARK: - Actions
@IBAction func qustionnaireButtonAction(_ sender: Any) {
swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "Questionnaire"))
swiftApi().openQuestionnaire(self);
}
......@@ -429,6 +431,8 @@ import SwiftEventBus
firebaseEvent._eventName = "did_tap_gifts_for_you_badge"
firebaseEvent.setParameter = ("screen", "Loyalty Wallet")
SwiftEventBus.post("firebase", sender: firebaseEvent)
swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "DealsBanner"))
}
@IBAction func couponEarnButtonAction(_ sender: Any) {
......@@ -437,12 +441,17 @@ import SwiftEventBus
firebaseEvent.setParameter = ("screen", "Loyalty Wallet")
SwiftEventBus.post("firebase", sender: firebaseEvent)
swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "LoyaltyBanner"))
let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
let vc = storyboard.instantiateViewController(withIdentifier: "LoyaltyAnalysisViewController") as! SwiftWarplyFramework.LoyaltyAnalysisViewController
self.navigationController?.pushViewController(vc, animated: true)
}
@IBAction func activeCodeButtonAction(_ sender: Any) {
print("Active DFY coupon banner Tapped!")
swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "ActiveDealsBanner"))
let couponDetails = swiftApi.ActiveDFYCouponEventModel()
couponDetails._isPressed = true
SwiftEventBus.post("dfy_coupon_details", sender: couponDetails)
......@@ -476,6 +485,10 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{
public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let couponSetData: swiftApi.CouponSetItemModel? = coupons[indexPath.row].couponset_data
let couponName = couponSetData?.name ?? ""
swiftApi().logTrackersEvent("click", ("Coupon:" + couponName))
let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
let vc = storyboard.instantiateViewController(withIdentifier: "CouponBarcodeViewController") as! SwiftWarplyFramework.CouponBarcodeViewController
vc.coupon = coupons[indexPath.row]
......
......@@ -5029,6 +5029,8 @@ public class swiftApi {
for item in couponsetsList {
if (item.uuid == couponsetUuid) {
swiftApi().logTrackersEvent("click", ("Loyalty:" + (campaign.session_uuid ?? "")))
let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
firebaseEvent._eventName = "loyalty_sdk_offer_selected"
firebaseEvent.setParameter = ("name", (item.name ?? ""))
......@@ -5051,6 +5053,8 @@ public class swiftApi {
}
} else {
swiftApi().logTrackersEvent("click", ("Loyalty:" + (campaign.session_uuid ?? "")))
let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
let vc = storyboard.instantiateViewController(withIdentifier: "CampaignViewController") as! SwiftWarplyFramework.CampaignViewController
......@@ -5083,6 +5087,8 @@ public class swiftApi {
if ((ccms._loyaltyCampaignId == "") || (ccms._loyaltyCampaignId == "NA")) {
swiftApi().logTrackersEvent("click", ("Contextual:" + (ccms._sessionId)))
let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
firebaseEvent._eventName = "loyalty_sdk_offer_selected"
firebaseEvent.setParameter = ("name", (ccms._title))
......@@ -5104,6 +5110,8 @@ public class swiftApi {
if (isCcmsOffer && (loyaltyCampaign.session_uuid == ccms._loyaltyCampaignId)) {
swiftApi().logTrackersEvent("click", ("Contextual:" + (ccms._sessionId)))
let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
let vc = storyboard.instantiateViewController(withIdentifier: "CampaignViewController") as! SwiftWarplyFramework.CampaignViewController
vc.campaignUrl = swiftApi().constructCcmsUrl(loyaltyCampaign, ccms)
......@@ -5117,6 +5125,8 @@ public class swiftApi {
} else if (isTelco && (loyaltyCampaign.session_uuid == ccms._loyaltyCampaignId)) {
swiftApi().logTrackersEvent("click", ("Telco:" + (ccms._sessionId)))
let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
firebaseEvent._eventName = "loyalty_sdk_offer_selected"
firebaseEvent.setParameter = ("name", (ccms._title))
......