new ATInternet.Tracker.Plugins.Utils(parent)
This plugin shares specific feature methods to our helper plugins.
For example plugins Page, Clicks and OnSiteAds have common usages.
Name | Type | Description |
---|---|---|
parent |
object | Instance of the Tag used |
Methods
-
customObjectToString(customObject){string}
-
Serialize to JSON format and encode the string before returning it (encodeURIComponent)
Name Type Description customObject
object Javascript object we nee to transform into a JSON encoded string -
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)
-
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 containing properties to check key
string Key word to check length
number Number of occurence possible Example
var myObject = { chapter1:'one', chapter2:'two' } var chapters = manageChapters(myObject, 'chapter', 2); // chapters = 'one::two::'