Skip to content

eason-lz/TrackRecorder

Repository files navigation

TrackRecorder

Version License Platform

Requirements

  • iOS 10.0+

Usage

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

TrackRecorder is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'TrackRecorder'

Quick Start

代码
  • 首先需要引入头文件

#import <TrackRecorder/TrackRecordManager.h>

  • 添加代理

<TrackRecordDelegate>

TrackRecordManager.sharedInstance.delegate = **self**;

  • 实现代理方法

    - (void)TrackRecordClickWithDictionary:(nonnull NSDictionary *)dic {
    
        NSLog(@"click%@",dic);
    
    }
    - (void)TrackRecordVisitWithDictionary:(nonnull NSDictionary *)dic {
    
        NSLog(@"visit%@",dic);
    
    }
    
配置文件

需要在本地项目中创建一个名为"TrackRecordConfig"的plist文件

文件格式如图:

image-confitPlist

使用方法:

  • PageEvents:

在PageEvents下新建一个Dictionary,以Controller名字作为key(如果是swift项目需要在前面添加项目名称)

  • ControlEvents:

在ControlEvents下新建一个Dictionary,以方法点击事件名称作为key,如果是swift代码需要将事件名称进行转换如:@objc func countDownAction(sender: CountDownButton) 转换为countDownActionWithSender:

  • CollectionViewEvents和TableViewEvents:

在TableViewEvents或CollectionViewEvents下新建Dictionary,section作为一级key,row作为二级key

  • TapEvents:

在TapEvents下新建Dictionary,控制器名字作为一级key(如果是swift项目需要在前面加项目名称),加载手势的视图的tag作为二级key

Author

eason, 18210437675@163.com

License

TrackRecorder is available under the MIT license. See the LICENSE file for more info.

About

一个只需配置的无侵入埋点方案

Resources

License

Stars

Watchers

Forks

Packages