Operating principle

  • iOS
  • watchOS
  • tvOS
 

General principles

The AT Internet tag allows you to follow your users’ activity throughout your application’s lifecycle.

To help you, the tag makes available classes (helpers) enabling the quick implementation of tracking for different application events (screen loads, gestures, video plays…).

These helpers enable you to define or add different types of tagging and put them in a queue. This queue can be “emptied” by calling the dispatch method, available in the Tracker class: Dispatch()

The tracker is not compatible for use with competing accesses (thread-safety)

 

List of available classes

NameDescription
ScreenClass enabling the tagging of screens
DynamicScreenClass enabling the tagging of screens whose name can vary (e.g: news feed)
GestureClass enabling the tagging of gestures
CampaignClass enabling the addition of campaign information on your screen hits
PublisherClass enabling the tagging of your ads
SelfPromotionClass enabling the tagging of your self-promotion campaigns
AisleClass enabling the tagging of your aisles (in the case of SalesTracker tagging)
CartClass enabling the tagging of your product cart (in the case of SalesTracker tagging)
OrderClass enabling the tagging of your orders (in the case of SalesTracker tagging)
LocationClass enabling the addition of geolocation information on your screen hits
CustomObjectClass enabling the addition of custom objects on your hits
CustomVarClass enabling the addition of custom variables on your screen hits
IdentifiedVisitorClass enabling the management of user identification
InternalSearchClass enabling the tagging of your internal search engine
NuggAdClass enabling the addition of information from our partner NuggAd in your hits
MediaPlayerClass enabling the tagging of your audio and video feed
ProductClass enabling the tagging of your products
CustomTreeStructureClass enabling the tagging of your custom tree
 

Advanced tagging

Aside from using helpers, it is also possible to “manually” tag your application via the setParam method of the Tracker.

The setParam method allows you to add a parameter that will be sent on the next hit or on all following hits (volatile or persistent).

This method can take as a parameter the object ParamOption allowing for definition of the following information:

  • relativePosition: Parameter’s position in the hit with regards to another parameter
  • relativeParameterKey: Relative parameter key
  • append: Allows concatenation of several values in the same variable
  • separator: In the case of a table-type variable, defines the separator shown in the URL. When the append option is used, the separator will be used to separate the concatenated values.
  • encode: Allows encoding of the variable’s value (true by default)
  • persistent: Indicates if the variable must be present in all hits, or only in the following hit..

In order to send the defined variables, you must then call the Tracker‘s dispatch method.

 

Advanced tagging example

  1. Tagging a screen:
    override func viewWillAppear(_ animated: Bool) {
        let s2ParamOption = ParamOption()
            s2ParamOption.persistent = true // Level 2 ID will be repeated on all hits
            
        let _ = ATInternet.sharedInstance.defaultTracker
            .setParam("s2", value: 1, options: s2ParamOption)
            .setParam("p", value: "Home") // Set screen name
            .dispatch() // send hit
    }
    - (void)viewWillAppear:(BOOL)animated {
        // Set screen name
        [[[ATInternet sharedInstance] defaultTracker] setStringParam:@"p" value:@"Home"];
        
        // Set level 2 ID for screen
        ParamOption *s2ParamOption = [[ParamOption alloc] init];
        s2ParamOption.persistent = YES; // Level 2 ID will be repeated on all hits
        
        [[[ATInternet sharedInstance] defaultTracker] setIntParam:@"s2" value:1 options:s2ParamOption];
        
        // Send hit
        [[[ATInternet sharedInstance] defaultTracker] dispatch];
    }
  2. Sending a hit with a custom object:

    The hit will be considered as screen tagging

    override func viewWillAppear(_ animated: Bool) {
        ATInternet.sharedInstance.defaultTracker.setParam("stc", value: ["myCustomObject" : ["myLanguage": "fr", "myDevice": "iPad"]])
        ATInternet.sharedInstance.defaultTracker.dispatch()
    }
    - (void)viewWillAppear:(BOOL)animated {    
        // Set a custom object
        [[[ATInternet sharedInstance] defaultTracker] setDictionaryParam:@"stc" value:@{@"myCustomObject":@{@"myLanguage":@"fr",@"myDevice":@"iPad"}}];
        
        // Send hit
        [[[ATInternet sharedInstance] defaultTracker] dispatch];
    }
 

Default variables

When a hit is sent, the AT Internet tracker will automatically add variables to feed basic analyses:

NameDescription
vtagGets the SDK version
ptagGets the platform where the SDK is integrated (e.g.: iOS, Android …)
lngGets the user language
mfmdGets the device make and model
osGets the name and version of the device’s operating system
apvrGets the application version
apidGets the application bundle name
hlGets the device’s local time
rGets the device’s resolution
carGets the device’s operator/carrier
cnGets the connection type
tsGets a timestamp indicating the time of hit creation
idclientGets the user ID
stcGets the JSON containing the application lifecycle data, crash information if applicable, or custom objects
 

Was this post helpful?

Last update: 26/02/2019