Code Monkey home page Code Monkey logo

tmviewtrackersdk's Introduction

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

  • Two platform support (iOS & Android, See ViewTracker-Android in Github for Android Version)
  • Automated Data Collection for exposure and click event.
  • Covering a variety of scenes , such as Tab、ScrollView、UIControlEventTouchUpInside、Page or App switch.
  • A good performance on Page FPS.
  • Compact API.

Performance

Install

Use Cocoapods to Get latest version of ViewTracker

pod 'ViewTracker'

Getting Started

Set a Delegate to respond to processing exposure and click events.

feature/viewtrack-opensource

#import "ViewTrackerProxy.h"
#import <TMViewTrackerSDK/TMViewTrackerSDK.h>

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

ViewTrackerProxy.h

#import <TMViewTrackerSDK/TMViewTrackerSDK.h>
@interface ViewTrackerProxy : NSObject <TMViewTrackerCommitProtocol>
@end

ViewTrackerProxy.m

#import "ViewTrackerProxy.h"

@implementation ViewTrackerProxy
- (instancetype)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;
}
- (void)ctrlClicked:(NSString*)controlName
             onPage:(NSString*)pageName
               args:(NSDictionary*)args
{
    NSLog(@"Clicked on Page(%@), controlName(%@), with args(%@)", pageName, controlName, args);
}

- (void)module:(NSString*)moduleName
  showedOnPage:(NSString*)pageName
      duration:(NSUInteger)duration
          args:(NSDictionary *)args
{

    NSLog(@"module on Page(%@), controlName(%@), duration(%lu), with args(%@)", pageName, moduleName, (unsigned long)duration, args);
}
@end
Add the tag 'controlName' to the view
#import <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。
#import <TMViewTrackerSDK/TMViewTrackerSDK.h>

...
- (void)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.

tmviewtrackersdk's People

Contributors

oldratlee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tmviewtrackersdk's Issues

为什么我用的没任何曝光

为什么我用的没任何曝光,新项目就加了一个button,然后设置上值,但是proxy类里的回调并没有触发

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.