-
Notifications
You must be signed in to change notification settings - Fork 0
Level 2s 43d787
AT Internet�s SDK offers you the possibility to �separate� your application into different sections (called �level 2s�). These level 2s allow you to better target certain parts of your application in order to zoom in on how these parts are used.
Once your tag is initialised, you can modify the level 2 ID used in the sending of hits.
In the case of a Swift project, be sure to import the Tracker (or TrackerExtension if your target is an extension) module in your ViewController. In the case of an Objective-C project, be sure to import the headers Tracker-Swift.h or Tracker-Swift.h in case of a Cocoapods integration.
The SDK allows you to modify the level 2 ID that will be sent during a screen hit, a gesture hit You Can also modify the level 2 ID in a more �global� manner for permanent use.
The tracker possesses a context property which itself possesses a level2 subproperty. By default, this property is 0. By editing this property�s value, the level 2 ID will be added in to future hits.
To disable this feature, simply reset the ID to 0.
In these examples, we�ll consider the addition of level 2 information on screen tagging.
-
Setup of a level 2 when a user enters a particular section of the app
override func viewWillAppear(animated: Bool) {
ATInternet.sharedInstance.defaultTracker.context.level2 = 1
ATInternet.sharedInstance.defaultTracker.screens.add("home").sendView()
}- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[ATInternet sharedInstance].defaultTracker.context.level2 = 1;
[[[ATInternet sharedInstance].defaultTracker.screens add:@"home"] sendView];
}-
Delete tracker�s level 2 by default when screen is changed
override func viewWillDisappear(animated: Bool) {
ATInternet.sharedInstance.defaultTracker.context.level2 = 0
}- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[ATInternet sharedInstance].defaultTracker.context.level2 = 0;
}-
Override a level 2 for a hit
import UIKit
import Tracker
class ViewController: UIViewController {
let tracker: Tracker = ATInternet.sharedInstance.defaultTracker
override func viewDidLoad() {
super.viewDidLoad()
}
override func viewWillAppear(animated: Bool) {
// Set level 2 ID for next hits
tracker.context.level2 = 1
tracker.screens.add("home").sendView()
}
@IBAction func touchButton(sender: UIButton) {
let touch = tracker.gestures.add("ButtonTouch")
touch.level2 = 2 // Override level 2 ID for this hit
touch.sendTouch()
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// Level 2 ID will be equal to "1"
tracker.gestures.add("Go to product detail").sendNavigation()
}
}#import "Tracker/Tracker-Swift.h"
@interface ViewController ()
@property (nonatomic, strong) Tracker* tracker;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.tracker = [ATInternet sharedInstance].defaultTracker;
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
// Set level 2 ID for next hits
self.tracker.context.level2 = 1;
[[self.tracker.screens add:@"home"] sendView];
}
- (IBAction)touchButton:(UIButton *)sender {
Gesture *touch = [self.tracker.gestures add:@"ButtonTouch"];
touch.level2 = 2; // Override level 2 for this hit
[touch sendTouch];
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Level 2 ID will be equal to "1"
[[self.tracker.gestures add:@"Go to product detail"] sendNavigation];
}
@end-
Data API
- Data flow
- Advice optimizations data flow
- Error codes data flow
- Faq data flow
- General information data flow
- Technical information data flow
- Reporting API v3
- Getting started
- Methods
- Parameters
- Technical information
- REST API
- Campaigns
- Custom variables
- Getting started rest
- Methods rest
- Response structure parameters rest
- Fixed periods
- Parameters compatibility
- Relative periods
- Structure of the response
- “code” parameter
- “columns” parameter
- “evo” parameter
- “filter” parameter
- “include” parameter
- “lng” parameter
- “max-results” parameter
- “page-num” parameter
- “period” parameter
- “period” parameter: “H” v. “He” & “MN” v. “MNe”
- “retention” parameter
- “segmentdesc” parameter
- “segment” parameter
- “sep” parameter
- “sort” parameter
- “space” parameter
- Technical specifications rest
- Data flow
-
Data collection
- Android
- Advanced features
- Campaigns
- Changelog
- Content
- Ecommerce
- Getting started
- Users
- Apple
- Advanced features
- Campaigns
- Changelog
- Content
- Ecommerce
- Getting started
- Users
- General
- Cddc renew staging process
- Changelog
- Craft your hit
- Encoded parameters
- Server side cookie management
- Supported taggings
- Tagging deletion
- Utilisation of dispatch sdks
- JavaScript
- Advanced features
- Campaigns
- Changelog
- Content
- Ecommerce
- Getting started
- Partners javascript
- Users
- Piano Analytics
- Event tagging piano analytics
- Getting started piano analytics
- Piano analytics tagging
- Feeding piano analytics with as2 tagging
- Tagging custom properties sdk
- Android