Developers » Windows » Content » Level 2s
Level 2s
Foreword
AT Internets 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.
Get off to a good start
Once your tag is initialised, you can modify the level 2 ID used in the sending of hits.
To use SDK class and methods, add ATInternet namespace to your Page.
Tagging
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 object which itself possesses a Level2 subproperty. By default, this property has a value of 0. By editing this propertys value, the level 2 ID will be added in to future hits.
To disable this feature, simply reset the ID to 0.
Tagging examples
In these examples, well 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
public MainPage() { this.InitializeComponent(); tracker = SmartTag.Instance.defaultTracker; tracker.Context.Level2 = 1; tracker.Screens.Add().SendView(); }
- Delete trackers level 2 by default when screen is changed
protected override void OnNavigatedFrom (NavigationEventArgs e) { tracker.Context.Level2 = 0; }
- Override a level 2 for a hit
protected override void OnNavigatedFrom (NavigationEventArgs e) { tracker.Context.Level2 = 0; }
- Surcharge d’un niveau 2 pour un hit
using System; using System.Collections.Generic; using Windows.Data.Json; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using ATInternet; using Windows.UI.Xaml.Navigation; namespace App1 { public sealed partial class MainPage : Page, TrackerDelegate, TrackerReadyHandler { Tracker tracker; public MainPage() { this.InitializeComponent(); tracker = SmartTag.Instance.defaultTracker; tracker.Context.Level2 = 1; tracker.Screens.Add().SendView(); } private void Button_clicked(object button, RoutedEventArgs e) { Gesture gesture = tracker.Gestures.Add("hello"); gesture.Level2 = 2; gesture.SendTouch(); } }