-
Notifications
You must be signed in to change notification settings - Fork 1
/
TiGoogleananalyticsTracker.m
59 lines (48 loc) · 1004 Bytes
/
TiGoogleananalyticsTracker.m
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
//
// TiGoogleanalyticsTracker.m
// googleanalytics
//
// Created by Dawson Toth on 8/19/13.
//
//
#import "TiGoogleananalyticsTracker.h"
@implementation TiGoogleanalyticsTracker
-(id)initWithTracker:(id<GAITracker>)t
{
if (self = [super init]) {
// DToth: GAI.h tells us not to retain/release the tracker, so we won't.
tracker = t;
}
return self;
}
#pragma mark Public API
-(id)get:(id)key
{
ENSURE_SINGLE_ARG(key, NSString);
return [tracker get:key];
}
-(id)name
{
return tracker.name;
}
-(void)send:(id)args
{
ENSURE_SINGLE_ARG(args, NSDictionary);
[tracker send:args];
}
-(void)set:(id)args
{
NSString *key;
NSString *value;
ENSURE_ARG_COUNT(args,2);
ENSURE_ARG_AT_INDEX(key, args, 0, NSString);
ENSURE_ARG_AT_INDEX(value, args, 1, NSString);
[tracker set:key value:value];
}
-(void)dealloc
{
// DToth: GAI.h tells us not to retain/release the tracker, so we won't.
tracker = nil;
[super dealloc];
}
@end