-
-
Name |
Type |
Description |
tagObject |
object
|
6 properties : level1, level2, level3, level4, level5, level6 |
Example
tag.aisle.set({
level1: "10[high_tech]",
level2: "20[Computers_network]",
level3: "30[Computers]",
level4: "40[Laptops]",
level5: "50[Asus]",
level6: "60[17]"
});
-
-
Name |
Type |
Description |
tagObject |
object
|
1 property : product |
Example
tag.cart.add({
product: {
category1: "1[Computers_and_Networking]",
category2: "25[Computers]",
category3: "56[Laptops]",
...
category6: "300[Chromebook]",
productId: "564[laptop_ACER_A56]",
quantity: 1,
unitPriceTaxIncluded: 549,
unitPriceTaxFree: 456.2,
discountTaxIncluded: 10,
discountTaxFree: 8.04,
promotionalCode: "Offre_New_Customer"
}
});
-
-
Name |
Type |
Description |
tagObject |
object
|
2 properties : cartId, isBasketPage |
Example
tag.cart.set({
cartId: 8235,
isBasketPage: true
});
-
-
[Helper added by plugin
Clicks] Tagging method for clicks (helper). This method should be called when the click happens.
Name |
Type |
Description |
tagObject |
object
|
tag object, must contain at least properties 'name' and 'type'. Should contain the property 'elem' to let the sdk manages the click redirection or submit if necessary |
Examples
<a href="http://example.com/" onclick="return tracker.click.send({elem:this,name:'clickName',level2:'clickLvl2',type:'exit'});">link</a>
<a href="http://example.com/" onclick="return myFunction(this);">link</a>
<script type="text/javascript">
function myFunction(element){
// your code
return tracker.click.send({
elem:element,
name:'clickName',
chapter1:'chap1',
chapter2:'chap2',
chapter3:'chap3',
level2:'clickLvl2',
type:'exit',
event:eventObj,
callback:callback
});
}
</script>
-
-
[Helper added by plugin
Clicks] Alternative tagging method for clicks (helper). Do not send the hit itself (it must be used with tracker.dispatch).
Name |
Type |
Description |
tagObject |
object
|
tag object, must contain at least properties 'name' and 'type' (and 'elem' if link/form with redirection/submit) |
Example
tracker.click.set({
name:'clickName',
chapter1:'chap1',
chapter2:'chap2',
chapter3:'chap3',
level2:'clickLvl2',
type:'exit'
});
//...
tracker.dispatch();
-
clickListener.send(tagObject)
-
[Helper added by plugin
Clicks] Tagging method for clicks (helper). This method should be called when loading the page
Name |
Type |
Description |
tagObject |
object
|
tag object |
Example
tracker.clickListener.send({
elem:document.getElementById('myLink/myForm'),
name:'clickName',
chapter1:'chap1',
chapter2:'chap2',
chapter3:'chap3',
level2:'clickLvl2',
type:'exit'
callback:callback
});
-
-
[Helper added by plugin
ClientSideUserId] Add a user ID to all hits "&idclient=" and store it in the cookie "atuserid".
Name |
Type |
Description |
id |
string
|
number
|
User ID |
Example
tag.clientSideUserId.set();
-
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 |
-
customTreeStructure.set(tagObject)
-
[Helper added by plugin
Page] Set custom tree structure.
Name |
Type |
Description |
tagObject |
object
|
3 properties : category1, category2, category3 |
Example
tag.customTreeStructure.set({
mycategory1: 1,
mycategory2: 2,
mycategory3: 3
});
-
customVars.set(tagObject)
-
[Helper added by plugin
Page] Set page and site variables.
Name |
Type |
Description |
tagObject |
object
|
2 properties : site, page |
Example
tag.customVars.set({
site: {
1: 'site1',
5: 'site5',
20: 'site20'
},
page: {
1: 'page1',
5: 'page5',
20: 'page20'
}
});
-
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});
-
-
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
-
-
Use to delete a stored parameter.
- See:
-
-
dynamicLabel.set(tagObject)
-
[Helper added by plugin
Page] Set dynamic label.
Name |
Type |
Description |
tagObject |
object
|
5 properties : pageId, chapter1, chapter2, chapter3, update |
Example
tag.dynamicLabel.set({
pageId: '123456',
chapter1: 'mychapter1',
chapter2: 'mychapter2',
chapter3: 'mychapter3',
update: '200910031045'
});
-
-
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}
});
-
-
Get configuration.
Name |
Type |
Description |
key |
string
|
Configuration property name |
Returns:
property value if exist, undefined if not
-
-
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:
-
-
identifiedVisitor.set(tagObject)
-
Name |
Type |
Description |
tagObject |
object
|
2 properties : id, category |
Example
tag.identifiedVisitor.set({
id:'id123', // or a numeric value, id:123456
category:'123'
});
-
identifiedVisitor.unset()
-
[Helper added by plugin
IdentifiedVisitor] Unset an identified visitor (delete all cookies and parameters from buffer)
-
internalSearch.send(tagObject)
-
Name |
Type |
Description |
tagObject |
object
|
3 properties : keyword, resultPageNumber, resultPosition |
Example
tag.internalSearch.send({
keyword: 'test',
resultPageNumber: '123',
resultPosition: '2'
});
-
internalSearch.set(tagObject)
-
[Helper added by plugin
InternalSearch]Set internal searches properties.
Name |
Type |
Description |
tagObject |
object
|
3 properties : keyword, resultPageNumber, resultPosition |
Example
tag.internalSearch.set({
keyword: 'test',
resultPageNumber: '123',
resultPosition: '2'
});
-
-
[Helper added by plugin
MvTesting] Add a new version for a variable.
Name |
Type |
Description |
tagObject |
object
|
2 properties : variable, version |
Example
tag.mvTesting.add({
variable: '1[Header]',
version: '2[Grey]'
});
-
-
[Helper added by plugin
MvTesting] Set multivariate testing default properties.
Name |
Type |
Description |
tagObject |
object
|
3 properties : test, waveId, creation |
Example
tag.mvTesting.set({
test: '1[My_first_Test]',
waveId: 1,
creation: '2[Version2_page_subscription]'
});
-
-
[Helper added by plugin
NuggAd] Set nugg.ad properties.
Example
tag.nuggAd.set();
-
-
[Helper added by plugin
Offline] Get hits array from local storage.
Example
var hitArr = tag.offline.get();
-
offline.getLength(){number}
-
[Helper added by plugin
Offline] Get estimated storage data length.
Example
var len = tag.offline.getLength();
-
-
[Helper added by plugin
Offline] Remove hits from local storage.
Example
tag.offline.remove();
-
-
[Helper added by plugin
Offline] Send hits from local storage.
Example
tag.offline.send();
-
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){});
-
-
Name |
Type |
Description |
tagObject |
object
|
10 properties : orderId, turnover, status, newCustomer, amount, delivery, paymentMethod, discount, confirmationRequired, orderCustomVariables |
Example
tag.order.set({
orderId: 8235,
turnover: 2049,
status: 1,
newCustomer: true,
amount: {
amountTaxIncluded: 2049,
amountTaxFree: 1649.36,
taxAmount: 339.64
},
delivery: {
shippingFeesTaxIncluded: 19.9,
shippingFeesTaxFree: 16,
deliveryMethod: "1[Colissimo]"
},
paymentMethod: 1,
discount: {
discountTaxIncluded: 9.9,
discountTaxFree: 7.96,
promotionalCode: "CDPR15485Q"
},
confirmationRequired: false,
orderCustomVariables: [5, 30 ,14, "[contact tel]", 1],
});
-
-
[Helper added by plugin
Page] Reset page context.
Example
tag.page.reset();
-
-
[Helper added by plugin
Page] Tagging method for page (helper).
Name |
Type |
Description |
tagObject |
object
|
5 properties : name, chapter1, chapter2, chapter3, customObject |
Example
tag.page.send({
name: 'pageName',
chapter1: 'mychapter1',
chapter2: 'mychapter2',
chapter3: 'mychapter3',
customObject: {
one: 1,
two: 2
},
customVars: {
page: {
1: 'page1',
5: 'page5',
20: 'page20'
},
site: {
1: 'site1',
5: 'site5',
20: 'site20'
}
},
dynamicLabel: {
pageId: '123456',
chapter1: 'mychapter1',
chapter2: 'mychapter2',
chapter3: 'mychapter3',
update: '200910031045'
},
tags: {
keywords: ['tag','Key']
},
customTreeStructure: {
category1: mycategory1,
category2: mycategory2,
category3: mycategory3
}
});
-
-
[Helper added by plugin
Page] Set page properties.
Name |
Type |
Description |
tagObject |
object
|
5 properties : name, chapter1, chapter2, chapter3, customObject |
Example
tag.page.set({
name: 'pageName',
chapter1: 'mychapter1',
chapter2: 'mychapter2',
chapter3: 'mychapter3',
customObject: {
one: 1,
two: 2
}
});
-
-
Name |
Type |
Description |
tagObject |
object
|
4 properties : productId, category1, category2, category3 |
Example
tag.product.add({
productId: "564[laptop_ACER_A56]",
category1: "1[Computers_and_Networking]",
category2: "25[Computers]",
category3: "56[Laptops]"
});
-
-
[Helper added by plugin
OnSiteAds] Tagging method for publisher campaigns, allow to cumulate campaigns to be sent with the tag.dispatch() method
Name |
Type |
Description |
tagObject |
object
|
tagObject must contain a property 'click' or 'impression', you can force a specific prefix with a property 'prefix' |
Example
tag.publisher.add({
impression:{
campaignId : 'id[label]',
creation : 'id[label]',
variant : 'id[label]',
format : '[120x40]',
generalPlacement : '[label]',
detailedPlacement : 'id[label]',
advertiserId : 'id[label]',
url : '[urlEncoded]'
}
});
tag.publisher.add({
impression:{
campaignId : 'id2[label2]',
creation : 'id2[label2]',
variant : 'id2[label2]',
format : '[60x40]',
generalPlacement : '[label2]',
detailedPlacement : 'id2[label2]',
advertiserId : 'id2[label2]',
url : '[urlEncoded2]'
}
});
tag.dispatch();
This will send a self-promotion campaign like : &atc=PUB-id[campaignId]-id[creation]-id[variant]-id-[generalPlacement]-[detailedPlacement]-id[advertiserId]-urlencoded
-
publisher.send(tagObject)
-
[Helper added by plugin
OnSiteAds] Alternative tagging method for publisher campaigns. This method manages redirections on click if necessary
Name |
Type |
Description |
tagObject |
object
|
The campaign , you can add a "customObject" property, and an "elem" property to manage redirection |
Example
<a href="..." onclick="return tag.publisher.send({elem:this,click:{campaignId:'id[label]',creation:'id[label]',variant:'id[label]',format:'[120x40]',generalPlacement:'[label]',detailedPlacement:'id[label]',advertiserId:'id[label]',url:'[urlEncoded]'}});">Pub</a>
-
-
[Helper added by plugin
OnSiteAds] Tagging method for publisher campaigns, to be used with the tag.dispatch() method
Name |
Type |
Description |
tagObject |
object
|
tagObject must contain a property 'click' or 'impression', you can force a specific prefix with a property 'prefix' |
Example
tag.publisher.set({
impression:{
campaignId : 'id[label]',
creation : 'id[label]',
variant : 'id[label]',
format : '[120x40]',
generalPlacement : '[label]',
detailedPlacement : 'id[label]',
advertiserId : 'id[label]',
url : '[urlEncoded]'
}
});
tag.dispatch();
This will send a self-promotion campaign like : &atc=PUB-id[campaignId]-id[creation]-id[variant]-id-[generalPlacement]-[detailedPlacement]-id[advertiserId]-urlencoded
-
-
[Helper added by plugin
RichMedia] Add media object.
Name |
Type |
Description |
tagObject |
object
|
10 properties : mediaType, playerId, mediaLevel2, mediaLabel,
previousMedia, refreshDuration, duration, isEmbedded, broadcastMode, webdomain |
Example
tag.richMedia.add({
mediaType: "video",
playerId: 333,
mediaLevel2: "mediaLevel2",
mediaLabel: "mediaLabel",
previousMedia: "previousMedia",
refreshDuration: 5,
duration: 20,
isEmbedded: true,
broadcastMode: "clip",
webdomain: "http://www.atinternet.com"
});
-
-
[Helper added by plugin
RichMedia] Remove a player with all associated media.
Name |
Type |
Description |
plyr |
number
|
Player ID |
Example
tag.richMedia.remove(333);
-
-
[Helper added by plugin
RichMedia] Remove all players and media.
Example
tag.richMedia.removeAll();
-
-
[Helper added by plugin
RichMedia] Send a media action ("play", "pause", "stop", "info").
Name |
Type |
Description |
tagObject |
object
|
4 properties : action, playerId, mediaLabel, isBuffering |
Example
tag.richMedia.send({
action: "info",
playerId: 333,
mediaLabel: "mediaLabel",
isBuffering: true
});
-
-
[Helper added by plugin
OnSiteAds] Tagging method for self-promotion campaigns, allow to cumulate campaigns to be sent with the tag.dispatch() method
Name |
Type |
Description |
tagObject |
object
|
tagObject must contain a property 'click' or 'impression', you can force a specific prefix with a property 'prefix' |
Example
tag.selfPromotion.add({
impression : {
adId : 'integer',
format : 'id[format]',
productId : 'productId'
}
});
tag.selfPromotion.add({
impression : {
adId : 'integer2',
format : 'id2[format2]',
productId : 'productId2'
}
});
tag.dispatch();
This will send a self-promotion campaign like : &ati=INT-integer-id[format]||productId,INT-integer2-id2[format2]||productId2
-
-
[Helper added by plugin
OnSiteAds] Alternative tagging method for self-promotion campaigns. This method manages redirections on click if necessary
Name |
Type |
Description |
tagObject |
object
|
The campaign , you can add a "customObject" property, and an "elem" property to manage redirection |
Example
<a href="..." onclick="return tag.selfPromotion.send({elem:this,click:{adId:'id',format:'[120x40]',productId:'id'}});">Pub</a>
-
-
[Helper added by plugin
OnSiteAds] Tagging method for self-promotion campaigns, to be used with the tag.dispatch() method
Name |
Type |
Description |
tagObject |
object
|
tagObject must contain a property 'click' or 'impression', you can force a specific prefix with a property 'prefix' |
Example
tag.selfPromotion.set({
impression : {
adId : 'integer',
format : 'id[format]',
productId : 'productId'
}
});
tag.dispatch();
This will send a self-promotion campaign like : &ati=INT-integer-id[format]||productId
tag.selfPromotion.set({
click : {
adId : 'integer',
format : 'id[format]',
productId : 'productId'
}
});
tag.dispatch();
This will send a self-promotion campaign like : &atc=INT-integer-id[format]||productId
tag.selfPromotion.set({
click : {
adId : 'integer',
format : 'id[format]',
productId : 'productId'
},
prefix : 'VALUE',
customObject:{one:1,two:2}
});
tag.dispatch();
This will send a self-promotion campaign like : &atc=VALUE-integer-id[format]||productId
-
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:
-
-
-
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 |
-
-
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});
-
-
[Helper added by plugin
Page] Set keywords.
Name |
Type |
Description |
tagObject |
object
|
1 property : keywords |
Example
tag.tags.set({
keywords: ['tag','Key']
});
-
-
[Helper added by plugin
TvTracking] Set TvTracking parameters.
Example
tag.tvTracking.set();
-
-
[Helper added by plugin
Weborama] Callback (called by Partner).
Example
code class="javascript">tag.weborama.callback();
-
-
[Helper added by plugin
Weborama] Set Weborama parameters.
Name |
Type |
Description |
name |
string
|
Name of the Tag reference variable |
Example
tag.weborama.set();
-
-
[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) |