User ID

 

Foreword

AT Internet’s 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. You’ll 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 application’s 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

  1. 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);
            }
        }
    }

     

  2. 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);
            }
        }
    }
 

Was this post helpful?

Last update: 04/05/2016