Class: Utils

ATInternet.Tracker.Plugins. Utils

Plugin with utils methods.

new ATInternet.Tracker.Plugins.Utils(tag)

This plugin shares specific feature methods to our helper plugins. For example plugins Page, Clicks and OnSiteAds have common usages.
Name Type Description
tag object Instance of the Tag used

Methods

getDocumentLevel(){object}

Get document level to use from global configuration or the default one (document.)

getLocation(){string}

Get the current location (URL associated with the document level configured)

getLocation(){string}

Get the current location (URL associated with the document level configured)

getQueryStringValue(name, str){string|null|undefined}

Get the value of a queryString variable
Name Type Description
name string Variable that you want to get
str string String in which we will look the wanted variable (considered as queryString format)
Returns:
This method returns a string if the variable exists with a value, it returns null if the variable is not present (or not correct for a queryString) or it returns undefined if the variable exists but doesn't have any value (ex : '&variable=')

manageChapters(tagObject, key, length){string}

Check an iterative property in an object and build a specific string from it
Name Type Description
tagObject object Object including properties to be checked
key string Key to be checked
length number | string Number of occurences
Example
var myObject = {
    chapter1:'one',
    chapter2:'two'
}
var chapters = manageChapters(myObject, 'chapter', 2);
// chapters = 'one::two::'