Developers » Windows » Content » Gestures
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 Trackers Dispatch method.
Please note, calling the methods SendNavigation, SendExit, SendDownload, SendTouch and SendSearch modifies the Action property of the Gesture object.
Tagging examples
- Tagging a navigational button:
private void Button_clicked(object button, RoutedEventArgs e) { tracker.Gestures.Add("Go to product detail").SendNavigation(); // ... }
- Tagging a navigational button with chapters:
private void Button_clicked(object button, RoutedEventArgs e) { tracker.Gestures.Add("Go to product detail", "Products", "Cart").SendNavigation(); // ... }
- 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
Name | Type | Default value | Description |
---|---|---|---|
Name | String | Empty string | Gets or sets the gesture name |
Chapter1 | String | null | Gets or sets the first chapter |
Chapter2 | String | null | Gets or sets the second chapter |
Chapter3 | String | null | Gets or sets the third chapter |
Action | Enum | Action.Touch | Gets or sets the action type |
Level2 | Int | -1 | Gets or sets the level 2 ID |
Methods
Name | Return type | Description |
---|---|---|
SendTouch | void | Sends a hit indicating that a clickable element was touched |
SendNavigation | void | Sends a hit indicating that a navigational item was touched |
SendDownload | void | Sends a hit indicating that a download was triggered |
SendExit | void | Sends a hit indicating that the user changed the display or closed the application |
SendSearch | void | Sends a hit indicating that the user clicked on a search result item |