Class: Tag

ATInternet.Tracker. Tag

Main Tag Object.

new ATInternet.Tracker.Tag(config, context, callback)

Name Type Description
config object Configuration of the Tag
context object Context of the Tag
callback function Executed when tracker is ready

Members

Module for buffer management.
See:

builderBuildManager

Module for hit builder.
See:

callbacksCallbacksManager

Module for callback management.
See:
Module for plugins management.
See:

triggersTriggersManager

Module for triggers management.
See:

inneraisleobject

[Object added by plugin SalesTracker] Tags to track aisle values.
Properties:
Name Type Description
set function Tag helper, see details here ATInternet.Tracker.Tag#aisle.set

innercartobject

[Object added by plugin SalesTracker] Tags to track cart values.
Properties:
Name Type Description
set function Tag helper, see details here ATInternet.Tracker.Tag#cart.set
add function Tag helper, see details here ATInternet.Tracker.Tag#cart.add

innerclickobject

[Object added by plugin Clicks] Tags for clicks.
Properties:
Name Type Description
send function Tagging method for clicks (helper), see details here ATInternet.Tracker.Tag#click.send
set function Alternative tagging method for clicks (helper), see details here ATInternet.Tracker.Tag#click.set

innerclickListenerobject

[Object added by plugin Clicks] Tags for clicks using a listener.
Properties:
Name Type Description
send function Tagging method for clicks (helper), see details here ATInternet.Tracker.Tag#clickListener.send

innerclientSideUserIdobject

[Object added by plugin ClientSideUserId] Tags to manage a user ID on client side mode.
Properties:
Name Type Description
set function Tag helper, see details here ATInternet.Tracker.Tag#clientSideUserId.set

innercustomTreeStructureobject

[Object added by plugin Page] Tags to obtain a completely customised view of all your traffic.
Properties:
Name Type Description
set function Tag helper, see details here ATInternet.Tracker.Tag#customTreeStructure.set

innercustomVarsobject

[Object added by plugin Page] Tags to associate page and site variables specific to your activity.
Properties:
Name Type Description
set function Tag helper, see details here ATInternet.Tracker.Tag#customVars.set

innerdynamicLabelobject

[Object added by plugin Page] Tags to track the history of a page whose content has been modified.
Properties:
Name Type Description
set function Tag helper, see details here ATInternet.Tracker.Tag#dynamicLabel.set

inneridentifiedVisitorobject

[Object added by plugin IdentifiedVisitor] Tags to identify a visitor.
Properties:
Name Type Description
set function Tag helper, see details here ATInternet.Tracker.Tag#identifiedVisitor.set
unset function Tag helper, see details here ATInternet.Tracker.Tag#identifiedVisitor.unset

innerinternalSearchobject

[Object added by plugin InternalSearch] Tags to manage internal searches data.
Properties:
Name Type Description
set function Tag helper, see details here ATInternet.Tracker.Tag#internalSearch.set
send function Tag helper, see details here ATInternet.Tracker.Tag#internalSearch.send

innermvTestingobject

[Object added by plugin MvTesting] Tags to manage multivariate testing data.
Properties:
Name Type Description
set function Tag helper, see details here ATInternet.Tracker.Tag#mvTesting.set
add function Tag helper, see details here ATInternet.Tracker.Tag#mvTesting.add

innernuggAdobject

[Object added by plugin NuggAd] Tags to manage nugg.ad data.
Properties:
Name Type Description
set function Tag helper, see details here ATInternet.Tracker.Tag#nuggAd.set

innerofflineobject

[Object added by plugin Offline] Tags to manage local storage.
Properties:
Name Type Description
getLength function Tag helper, see details here ATInternet.Tracker.Tag#offline.getLength
remove function Tag helper, see details here ATInternet.Tracker.Tag#offline.remove
get function Tag helper, see details here ATInternet.Tracker.Tag#offline.get
send function Tag helper, see details here ATInternet.Tracker.Tag#offline.send

innerorderobject

[Object added by plugin SalesTracker] Tags to track order values.
Properties:
Name Type Description
set function Tag helper, see details here ATInternet.Tracker.Tag#order.set

innerpageobject

[Object added by plugin Page] Tags to manage a page.
Properties:
Name Type Description
set function Tag helper, see details here ATInternet.Tracker.Tag#page.set
send function Tag helper, see details here ATInternet.Tracker.Tag#page.send
reset function Tag helper, see details here ATInternet.Tracker.Tag#page.reset

innerproductobject

[Object added by plugin SalesTracker] Tags to track viewed products.
Properties:
Name Type Description
add function Tag helper, see details here ATInternet.Tracker.Tag#product.add

innerpublisherobject

[Object added by plugin OnSiteAds] Tags for publisher campaigns
Properties:
Name Type Description
set function Tag helper, see details here ATInternet.Tracker.Tag#publisher.set
add function Tag helper, see details here ATInternet.Tracker.Tag#publisher.add
send function Tag helper, see details here ATInternet.Tracker.Tag#publisher.send

innerrichMediaobject

[Object added by plugin RichMedia] Tags to manage media measurement.
Properties:
Name Type Description
add function Tag helper, see details here ATInternet.Tracker.Tag#richMedia.add
remove function Tag helper, see details here ATInternet.Tracker.Tag#richMedia.remove
removeAll function Tag helper, see details here ATInternet.Tracker.Tag#richMedia.removeAll
send function Tag helper, see details here ATInternet.Tracker.Tag#richMedia.send

innerselfPromotionobject

[Object added by plugin OnSiteAds] Tags for self-promotion campaigns
Properties:
Name Type Description
set function Tag helper, see details here ATInternet.Tracker.Tag#selfPromotion.set
add function Tag helper, see details here ATInternet.Tracker.Tag#selfPromotion.add
send function Tag helper, see details here ATInternet.Tracker.Tag#selfPromotion.send

innertagsobject

[Object added by plugin Page] Tags to define the theme(s) of the content your users visit.
Properties:
Name Type Description
set function Tag helper, see details here ATInternet.Tracker.Tag#tags.set

innerversionstring

Version of the tracker.

innerweboramaobject

[Object added by plugin Weborama] Tags to collect marketing data from Weborama Partner.
Properties:
Name Type Description
set function Tag helper, see details here ATInternet.Tracker.Tag#weborama.set
callback function Tag helper, see details here ATInternet.Tracker.Tag#weborama.callback

Methods

configPlugin(plg, cfg, callback){object}

Set the specific configuration of a plugin. If the configuration already exists, set only the undefined properties.
Name Type Description
plg string Name of the plugin concerned
cfg object Value of the plugin configuration
callback function Function which be called if the plugin configuration change

debug(trigger, level, message, details)

Use to emit debug triggers.
Name Type Description
trigger string Trigger that you want to emit
level string DEBUG, ERROR, WARNING
message string
details * Data you want to transmit to listeners
Example
tag.debug('RichMedia:richMedia:remove', 'DEBUG', 'method ended', {playerId: plyr, media: mediaObject});

delContext(key1, key2)

Delete context value or parameter value in context(s).
Name Type Description
key1 string Context name
key2 string Context parameter name (first level)
Example
tag.delContext('myContext'); //=> Delete 'myContext' content
tag.delContext('myContext', 'param'); //=> Delete 'param' content in 'myContext'
tag.delContext(undefined, 'param');  //=> Delete 'param' content in all contexts

delParam()

Use to delete a stored parameter.
See:

emit(trigger, data)

Use to trigger event.
Name Type Description
trigger string Trigger to emit
data object Data to transmit to listeners
See:
Example
tag.emit('RichMedia:richMedia:remove', {
      lvl: 'DEBUG',
      msg: 'method ended',
      details: {playerId: plyr, media: mediaObject}
  });

getConfig(key){*}

Get configuration.
Name Type Description
key string Configuration property name
Returns:
property value if exist, undefined if not

getContext(key){*}

Get a context variable.
Name Type Description
key string Context variable name

getParam(filterList, withOptions){string|object}

Get variables from the buffer using the filter given, with possibility of returning options or not.
Name Type Description
filterList Array List of key/value(s) in an array. (ex : [[key1,value1],[key2,[value2A,value2B]]]) Filter on variable's options
withOptions boolean If true only returns value else returns object with value and options
See:
Example
// This filter will get variables with hitType 'page' OR 'all', AND with permanent true
var filter = [
 ['hitType',['page','all']],
 ['permanent',true]
]

var dataObj = tag.getParam(filter, true); // true to get options
dataObj = {
 'variableExample' : {
     value:'value',
     options: {
         hitType:['page'],
         permanent:true
     }
  }
}

var dataObj = tag.getParam(filter); // no option in results
dataObj = {
 'variableExample':'value'
}

getParams(param){string|object}

Use to get the collection of hit parameters stored (or a value if a parameter name is given).
Name Type Description
param string Parameter name (optional)
See:

onTrigger(trigger, callback){number}

Use to add a trigger listener.
Name Type Description
trigger string Trigger you want to subscribe
callback function Method that you want to be triggered
See:
Returns:
ID
Example
// It returns the ID of the callback so you can delete it if needed.
var idCallback = tag.onTrigger('myTrigger', callback(trig, data, idCallbackBis){});

sendHit(customParams, filters)

Send the hit and call the callback if present The hit will integrate parameters stored
Name Type Description
customParams object Object which contains some hit parameters that you would like to send specifically (they are given priority over the current buffer)
filters Array List of buffer filters
See:

sendUrl(hit)

Send single hit from complete url. An event will be sent thanks to TriggersManager :
- "Tracker:Hit:Sent:Ok" with the hit as data if succeed,
- "Tracker:Hit:Sent:Error" with error as data otherwise.
Name Type Description
hit string Url to send
See:

setConfig(key, value, ifNotExist){*}

Set configuration.
Name Type Description
key string Configuration property name
value * Configuration property value
ifNotExist boolean If true, the property will only be set if the configuration property doesn't exist

setContext(key, value)

Set a context variable.
Name Type Description
key string context variable name
value *

setParam(name, value, options)

Set value for a hit variable (overrides if present).
Name Type Description
name string Name of the hit variable
value string | number | function | Array value of the hit variable
options object Configuration of the variable, if no hitType defined, it will be "page" by default
See:
Example
tag.setParam('test1', 'val1', {hitType: ['test', 'click'], permanent: true, encode: true});
 

innerdispatch()

[Helper added by plugin Utils] Dispatch all tags.

innerdispatchRedirect(tagObject){boolean}

[Helper added by plugin Utils] Dispatch all tags (with automatic redirect management).
Name Type Description
tagObject object Tag object, used here to tell how we have to do the redirection (url/target)