Developers » Windows » Users » User ID
User ID
Foreword
AT Internets SDK allows you to choose from three types of user ID in order to track your visitors. You can also choose to use a custom ID. Youll be able to find this ID in the idclient variable present in hits.
Get off to a good start
The choice of type of ID to use is first made in the Tag Composer setup interface. It is also possible to modify this parameter directly in your applications code. The different types are:
- ATInternet ID
ATInternet SDK will generate a GUID.
- Device ID
The SDK retrieves this ID provided by Android. This ID is unique for each telephone. It will then always be used, unless you change ID type.
A few customers encountered duplicated ID for multiple devices. This problem comes from the Windows API, this is the reason why we discourage the usage of this identifier.
Tagging examples
- Selecting Windows ID as ID type
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, TrackerReadyHandler { Tracker tracker; public MainPage() { this.InitializeComponent(); tracker = SmartTag.Instance.defaultTracker; tracker.SetConfig("identifier", "deviceId", this); } public void TrackerReady() { string uid = tracker.GetUserId(); System.Diagnostics.Debug.WriteLine("user id :" + uid); } } }
- Selecting GUID
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, TrackerReadyHandler { Tracker tracker; public MainPage() { this.InitializeComponent(); tracker = SmartTag.Instance.defaultTracker; tracker.SetConfig("identifier", "GUID", this); } public void TrackerReady() { string uid = tracker.GetUserId(); System.Diagnostics.Debug.WriteLine("user id :" + uid); } } }