Developers » Windows » Getting started » Tracker initialisation
Tracker initialisation
Get off to a good start
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 SmartTag class allows you to initialise one or several trackers, name them, and memorise them.
Initialisation
Using a unique tracker for your application
If your application does not require the use of several trackers, the SmartTag class exposes a defaultTracker method that allows you to easily manage a tracker.
SmartTag.Instance.defaultTracker
Access to the defaultTracker object allows you to instantiate a tracker named defaultTracker and memorise its instance. When you call this object in the future, you will recover the same instance.
Using several trackers
If you need to manage several trackers, the SmartTag class enables you to instantiate, name, and memorise these different instances.
To initialize several trackers, you should add the following code in your project :
public MainPage() { this.InitializeComponent(); defaultTracker = SmartTag.Instance.defaultTracker; audioTracker = SmartTag.Instance.Tracker("audioTracker"); cartTracker = SmartTag.Instance.Tracker("cartTracker"); }
In the above example, three tracker instances are created:
- defaultTracker: instance by default
- audioTracker: a tracker used to tag your audio streams
- cartTracker: a tracker used to tag your product cart
When calling these properties/methods (e.g. in a Page), you will recover these previously created instances.
Last update: 29/10/2015