alibaba/TMViewTrackerSDK

Name: TMViewTrackerSDK

Owner: Alibaba

Description: ViewTracker is a sdk can help Developers to collect exposure and click events automatically.

Created: 2017-08-14 02:25:24.0

Updated: 2018-05-18 15:47:06.0

Pushed: 2017-10-23 09:00:14.0

Homepage: https://github.com/alibaba/TMViewTrackerSDK/blob/master/README.md

Size: 321

Language: Objective-C

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ViewTracker - iOS

ViewTracker is a tool to automatically collect exposure and click event data.

Now just support Objective-C, not swift support.

The system requirement for ViewTracker is iOS 7.0+

????

Feature
Performance
Install

Use Cocoapods to Get latest version of ViewTracker

'ViewTracker'
Getting Started
Set a Delegate to respond to processing exposure and click events.

feature/viewtrack-opensource

ort "ViewTrackerProxy.h"
ort <TMViewTrackerSDK/TMViewTrackerSDK.h>


[[TMViewTrackerManager sharedManager] setCommitProtocol:[ViewTrackerProxy new]];

ViewTrackerProxy.h

ort <TMViewTrackerSDK/TMViewTrackerSDK.h>
erface ViewTrackerProxy : NSObject <TMViewTrackerCommitProtocol>

ViewTrackerProxy.m

ort "ViewTrackerProxy.h"

lementation ViewTrackerProxy
nstancetype)init

if (self = [super init]) {
    //init ViewTrack Config
    NSDictionary * dictionary = @{kExposureSwitch:@(1),
                                  kClickSwitch:@(1)};

    [[TMViewTrackerManager sharedManager] setViewTrackerConfig:dictionary];

    //register notification to handle changes of config from server.
}
return self;

oid)ctrlClicked:(NSString*)controlName
         onPage:(NSString*)pageName
           args:(NSDictionary*)args

NSLog(@"Clicked on Page(%@), controlName(%@), with args(%@)", pageName, controlName, args);


oid)module:(NSString*)moduleName
owedOnPage:(NSString*)pageName
  duration:(NSUInteger)duration
      args:(NSDictionary *)args


NSLog(@"module on Page(%@), controlName(%@), duration(%lu), with args(%@)", pageName, moduleName, (unsigned long)duration, args);


Add the tag 'controlName' to the view
ort <TMViewTrackerSDK/TMViewTrackerSDK.h>


view.controlName=@"banner-0";
view.args=@{@"picName":@"pic1"};

Set pageName in viewDidAppear.It is recommended to set it in the base class?
ort <TMViewTrackerSDK/TMViewTrackerSDK.h>


oid)viewDidAppear:(BOOL)animated

[super viewDidAppear:animated];
[TMViewTrackerManager setCurrentPageName:@"Tab-1"];


Author
LICENSE

ViewTracker is available under the Apache2.0 license. See the LICENSE file for more info.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.