Identified visitors

 

Foreword

Identified visitors are the visitors you’re able to recognise following authentication (sign up, subscription, sign in…). These visitors can be regrouped into categories to give you a greater overall view during your analyses.

A visitor can be identified with a numerical or textual ID.

 

Get off to a good start

Once your tag is initialised, you can add visitor identification information.

To use SDK class and methods, add ATInternet namespace to your Page.

 

Tagging

The tracker possesses an IdentifiedVisitor object. This object offers a group of methods for enabling or disabling visitor identification. This type of tagging is persistent by default, meaning that even if the application is exited, the visitor identification data will be present in the hits, once the application is reopened. In “non persistent” mode, data will be automatically erased once the application is exited. It is also possible to manually delete identification data.

 

Tagging examples

  1. Tagging a screen with a numerical visitor ID
    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
        {
            Tracker tracker;
    
            public MainPage()
            {
                this.InitializeComponent();
                tracker = SmartTag.Instance.defaultTracker;
                IdentifiedVisitor visitor = tracker.IdentifiedVisitor;
                visitor.set(145942);
                tracker.Screens.Add("screen1").SendView();
            }
        }
    }
  2. Tagging a screen with a numerical ID and a category
    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
        {
            Tracker tracker;
    
            public MainPage()
            {
                this.InitializeComponent();
                tracker = SmartTag.Instance.defaultTracker;
                IdentifiedVisitor visitor = tracker.IdentifiedVisitor;
                visitor.Set(145942, 2);
                tracker.Screens.Add("screen1").SendView();
            }
        }
    }
  3. Tagging an ad with the addition of a textual visitor ID
    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
        {
            Tracker tracker;
    
            public MainPage()
            {
                this.InitializeComponent();
                tracker = SmartTag.Instance.defaultTracker;
                IdentifiedVisitor visitor = tracker.IdentifiedVisitor;
                visitor.Set("user145942");
                tracker.Screens.Add("screen1").SendView();
            }
        }
    }
  4. Tagging an ad with the addition of a textual ID and a category
    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
        {
            Tracker tracker;
    
            public MainPage()
            {
                this.InitializeComponent();
                tracker = SmartTag.Instance.defaultTracker;
                IdentifiedVisitor visitor = tracker.identifiedVisitor;
                visitor.Set("user145942", 3);
                _tracker.Screens.Add("screen1").SendView();
            }
        }
    }
  5. To disable visitor identification (e.g. when a user logs off)
    private void LogOut() 
    {
         IdentifiedVisitor visitor = tracker.IdentifiedVisitor;
         visitor.Unset();
    }
  6. Disabling persistent mode
    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("persistentIdentifiedVisitor", "false", this);
            }
    
            public void TrackerReady()
            {
                System.Diagnostics.Debug.WriteLine("user id won’t be persisted anymore");
            }
        }
    }
Was this post helpful?
Yes
No
Last update: 29/10/2015