Gestures

  • iOS
  • watchOS
  • tvOS
 

Get off to a good start

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

In the case of a Swift project, be sure to import the SmartTracker (or tvOSTracker/watchOSTracker if your target is a tvOS or watchOS device) module in your ViewController. In the case of an Objective-C project, be sure to import the headers or SmartTracker-Swift.h (or Tracker-Swift.h with Cocoapods).

Declare a Tracker type variable in your ViewController.

 

Tagging

To tag a gesture, the tracker exposes a gestures property that offers an add method.

By default, this method adds “touch”-type tagging. You can edit the event type via the action property 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:

  2. Tagging a navigational button with chapters:

  3. Tagging a button touch:

  4. Tagging a touch with a name defined via a CustomObject (the name will be treated via DataManager)

 

Gesture class

 

Properties

Name Type Default value Description
name String Empty string Gets or sets the gesture name
chapter1 String? nil Gets or sets the first chapter
chapter2 String? nil Gets or sets the second chapter
chapter3 String? nil Gets or sets the third chapter
action Enum Action.Touch Gets or sets the action type
level2 Int? nil Gets or sets the level 2 ID
customObjects CustomObjects CustomObjects Gets or sets the customObject
 

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
Was this post helpful?
Yes
No
Last update: 01/12/2016