Gestures

 

Get off to a good start

Once your tag is initialised, you can start tagging gestures made by your users.

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

Declare a Tracker-type variable in your Page

using System;
using System.Collections.Generic;
using Windows.Data.Json;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using ATInternet;

namespace App1
{
    public sealed partial class MainPage : Page
    {
        Tracker tracker;

        public MainPage()
        {
            this.InitializeComponent();
            tracker = SmartTag.Instance.defaultTracker;
        }
    }
}
 

Tagging

To tag a gesture, the tracker exposes a Gestures object that offers an Add method.

By default, this method adds “touch”-type tagging. You can edit the event type via the Action object of the Gesture object, returned by the Add method.

The different actions are the following:

  • Touch: Sends a hit indicating that a “touch” has occurred
  • Navigate: Sends a hit indicating that a navigational item was touched
  • Download: Sends a hit indicating that a download was triggered
  • Exit: Sends a hit indicating that the user changed the display or closed the application
  • Search: Sends a hit indicating that the user “clicked” on a search result item

To send the defined information, you must manually call the method SendNavigation, SendExit, SendDownload, SendTouch or SendSearch of your Gesture object, or call the Tracker’s Dispatch method.

Please note, calling the methods SendNavigation, SendExit, SendDownload, SendTouch and SendSearch modifies the Action property of the Gesture object.

 

Tagging examples

  1. Tagging a navigational button:
    private void Button_clicked(object button, RoutedEventArgs e)
    {
         tracker.Gestures.Add("Go to product detail").SendNavigation();
         // ...
    }
  2. Tagging a navigational button with chapters:
    private void Button_clicked(object button, RoutedEventArgs e)
    {
         tracker.Gestures.Add("Go to product detail", "Products", "Cart").SendNavigation();
         // ...
    }
  3. Tagging a button touch:
    private void Button_clicked(object button, RoutedEventArgs e)
    {
         Gesture gesture = tracker.Gestures.Add("Hello world !");
         gesture.Level2 = 1;
         gesture.SendTouch();
         // ...
    }
 

Gesture class

 

Properties

NameTypeDefault valueDescription
NameStringEmpty stringGets or sets the gesture name
Chapter1StringnullGets or sets the first chapter
Chapter2StringnullGets or sets the second chapter
Chapter3StringnullGets or sets the third chapter
ActionEnumAction.TouchGets or sets the action type
Level2Int-1Gets or sets the level 2 ID
 

Methods

NameReturn typeDescription
SendTouchvoidSends a hit indicating that a “clickable” element was touched
SendNavigationvoidSends a hit indicating that a navigational item was touched
SendDownloadvoidSends a hit indicating that a download was triggered
SendExitvoidSends a hit indicating that the user changed the display or closed the application
SendSearchvoidSends a hit indicating that the user “clicked” on a search result item
 

Was this post helpful?

Last update: 29/10/2015