-
Notifications
You must be signed in to change notification settings - Fork 0
Tracker initialisation 73f10b
Once the AT Internet library has been integrated with your project, you should initialise your tracker in order to tag your different views or actions.
The ATInternet class allows you to initialise one or several trackers, name them, and memorise them.
To make the most of all features offered by AT Internet’s tracker, it is strongly recommended you initialise the trackers in your application’s AppDelegate class.
Be careful, the same instance of Tracker must not be shared in a concurrent programming,
otherwise the application will crash. The SDK code is not thread-safe, so it is necessary to use a different instance of Tracker per thread.
If your application does not require the use of several trackers, the ATInternet class exposes a defaultTracker property that allows you to easily manage a tracker.
To initialise this tracker, add the following code to the app delegate AppDelegate:
ATInternet.sharedInstance.defaultTracker[[ATInternet sharedInstance] defaultTracker];Access to the defaultTracker property allows you to instantiate a tracker named defaultTracker and memorise its instance. When you call this property in the future, you will recover the same instance.
If you need to manage several trackers, the ATInternet class enables you to instantiate, name, and memorise these different instances.
To initialise your different trackers, add the following code in the app delegate AppDelegate:
import Tracker
// import Tracker if you downloaded it from Cocoapods
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
ATInternet.sharedInstance.defaultTracker
ATInternet.sharedInstance.tracker("audioTracker")
ATInternet.sharedInstance.tracker("cartTracker")
return true
}import UIKit
import Tracker
// import Tracker if you downloaded if from Cocoapods
class ViewController: UIViewController {
let tracker: Tracker = ATInternet.sharedInstance.defaultTracker
let audioTracker: Tracker = ATInternet.sharedInstance.tracker("audioTracker")
let cartTracker: Tracker = ATInternet.sharedInstance.tracker("cartTracker")
override func viewDidLoad() {
super.viewDidLoad()
}
}#import "AppDelegate.h"
#import "Tracker-Swift.h" // with Cocoapods
#import "Tracker/Tracker-Swift.h" // with TagComposer
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[ATInternet sharedInstance] defaultTracker];
[[ATInternet sharedInstance] tracker:@"audioTracker"];
[[ATInternet sharedInstance] tracker:@"videoTracker"];
return YES;
}#import "ViewController.h"
#import "Tracker-Swift.h" // with Cocoapods
#import "Tracker/Tracker-Swift.h" // with TagComposer
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
Tracker *defaultTracker = [[ATInternet sharedInstance] defaultTracker];
Tracker *audioTracker = [[ATInternet sharedInstance] tracker:@"audioTracker"];
Tracker *videoTracker = [[ATInternet sharedInstance] tracker:@"videoTracker"];
}-
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