SmartTag migration guide

  • iOS
  • watchOS
  • tvOS
 

Preliminary declaration

Before Previously, it was necessary to initialize tag at the opening of the application:

ATTag *tag = [ATTag sharedATTag];
[tag setSiteId:@"YOURSITEID"];
[tag setSubdomain:@"YOURLOG"];

SmartTag With SmartTag, it is necessary to instantiate the Tracker you will work wih. In order to do so, you need to add this ligne before your tagging:

// From TagComposer
let tracker = ATInternet.sharedInstance.defaultTracker

// From other source
let tracker = ATInternet.sharedInstance.tracker("myTracker", configuration: ["log":"YOURLOG", "logSSL":"YOURSSLLOG", "site":"YOURSITEID"])
// From TagComposer
Tracker *tracker = [[ATInternet sharedInstance] defaultTracker];

// From other source
Tracker *tracker = [[ATInternet sharedInstance] tracker:@"myTracker" configuration:@{@"log":@"YOURLOG", @"logSSL":@"YOURSSLLOG", @"site":@"YOURSITEID"}];

Tracker initialisation >  

Hits sending

Before With SDK V1, hits we were sent via the following method:

ATParams *params = [[ATParams alloc] init];
[params xt_sendTag];

SmartTag With SmartTag, hits are sent via the following method:

tracker.dispatch()
[self.tracker dispatch];

With .send* helpers, hits are sent when the method call.

Operating principle >  

Define page information

Before

[params setLevel2:@"10"];
[params setPage:@"Chapter1::Chapter2::Chapter3::Pagename"];

SmartTag

// First Method
var screen = tracker.screens.add("Pagename", chapter1: "Chapter1", chapter2: "Chapter2", chapter3: "Chapter3")
screen.level2 = 10

// Second Method
var screen = tracker.screens.add("Pagename")
screen.chapter1 = "Chapter1"
screen.chapter2 = "Chapter2"
screen.chapter3 = "Chapter3"
screen.level2 = 10
// First Method
Screen *screen = [tracker.screens add:@"Pagename" chapter1:@"Chapter1" chapter2:@"Chapter2" chapter3:@"Chapter3"];
screen.level2 = 10;

// Second Method
Screen *screen = [tracker.screens add:@"Pagename"];
screen.chapter1 = @"Chapter1";
screen.chapter2 = @"Chapter2";
screen.chapter3 = @"Chapter3";
screen.level2 = 10;

Screens >  

Click tag

Before

[params xt_click:@"15" andClickName:@"Clickname" andClickType:ATParams.clicType.navigation];

SmartTag 

// First Method
var gesture = tracker.gestures.add("Clickname", chapter1: "Chapter1", chapter2: "Chapter2", chapter3: "Chapter3")
gesture.level2 = 10

// Second Method
var gesture = tracker.gestures.add("Clickname")
gesture.chapter1 = "Chapter1"
gesture.chapter2 = "Chapter2"
gesture.chapter3 = "Chapter3"
gesture.level2 = 10
// First Method
Gesture *gesture = [tracker.gestures add:@"Clickname" chapter1:@"Chapter1" chapter2:@"Chapter2" chapter3:@"Chapter3"];
gesture.level2 = 10;

// Second Method
Gesture *gesture = [tracker.gestures add:@"Clickname"];
gesture.chapter1 = @"Chapter1";
gesture.chapter2 = @"Chapter2";
gesture.chapter3 = @"Chapter3";
gesture.level2 = 10;

Gestures >
 

Was this post helpful?

Last update: 19/09/2017