Custom screen and application variables

 

Foreword

Custom application variables allow you to associate information with a user’s activity while s/he is using your application.

Custom screen variables focus on a view in particular, and allow you, notably, to tag the fields of an entry form.

 

Get off to a good start

Once your tag is initialised, you can add your custom variables to your screen hit.

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

 

Tagging

The tracker makes available a CustomVars-type object that exposes an Add method. This method accepts three parameters:

  • VarId: index of the indicator
  • Value: value of the indicator, character string in the format:
    • text: [lorem]
    • decimal: “,” or “.” separator, two characters maximum after the separator
    • date: yyyymmdd
    • country: ISO
    • duration: integer
  • Type: type of indicator
 

Tagging example

  1. Site indicator, with a date value
    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;
                tracker.CustomVars.Add(1, "345687", CustomVarType.App);
                tracker.Screens.Add("My Screen with a CustomVar").SendView();
            }
        }
    }
  2. Screen indicator, with a text value
    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;
                tracker.CustomVars.Add(2, "[object]", CustomVarType.Screen);
                tracker.Screens.Add("My Screen with a CustomVar").SendView();
            }
        }
    }
 

CustomVar class

 

Properties

Name Type Default value Description
VarId Int -1 Gets or sets the variable ID
Type Enum CustomVarType.App Gets or sets the variable type
Value String Empty string Gets or sets the variable value
Was this post helpful?
Yes
No
Last update: 23/02/2018