-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathSimcoeAnalyticsEngine.swift
More file actions
65 lines (50 loc) · 2.39 KB
/
SimcoeAnalyticsEngine.swift
File metadata and controls
65 lines (50 loc) · 2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
// SimcoeAnalyticsEngine.swift
// SimcoeExample
//
// Created by Jonathan Samudio on 2/22/17.
// Copyright © 2017 Prolific Interactive. All rights reserved.
//
import Foundation
import Simcoe
import CoreLocation
internal class SimcoeAnalyticsEngine: AnalyticsEngine {
func run(with providers: [AnalyticsTracking]) {
Simcoe.run(with: providers)
}
func track(event: String, withAdditionalProperties properties: Properties?) {
Simcoe.track(event: event, withAdditionalProperties: properties)
}
func trackLifetimeIncrease(byAmount amount: Double,
forItem item: String?,
withAdditionalProperties properties: Properties?) {
Simcoe.trackLifetimeIncrease(byAmount: amount, forItem: item, withAdditionalProperties: properties)
}
func track(location: CLLocation, withAdditionalProperties properties: Properties?) {
Simcoe.track(location: location, withAdditionalProperties: properties)
}
func track(pageView: String, withAdditionalProperties properties: Properties?) {
Simcoe.track(pageView: pageView, withAdditionalProperties: properties)
}
func logAddToCart<T : SimcoeProductConvertible>(_ product: T, eventProperties: Properties?) {
Simcoe.logAddToCart(product, eventProperties: eventProperties)
}
func logRemoveFromCart<T: SimcoeProductConvertible>(_ product: T, eventProperties: Properties?) {
Simcoe.logRemoveFromCart(product, eventProperties: eventProperties)
}
func trackCheckoutEvent<T: SimcoeProductConvertible>(_ products: [T], eventProperties: Properties?) {
Simcoe.trackCheckoutEvent(products, eventProperties: eventProperties)
}
func log(error: String, withAdditionalProperties properties: Properties?) {
Simcoe.log(error: error, withAdditionalProperties: properties)
}
func trackPurchaseEvent<T: SimcoeProductConvertible>(_ products: [T], eventProperties: Properties?) {
Simcoe.trackPurchaseEvent(products, eventProperties: eventProperties)
}
func setUserAttribute(_ key: String, value: AnyObject) {
Simcoe.setUserAttribute(key, value: value)
}
func logViewDetail<T: SimcoeProductConvertible>(_ product: T, eventProperties: Properties?) {
Simcoe.logViewDetail(product, eventProperties: eventProperties)
}
}