Methods
addPageEvent(node, type, fn, tn)
Add an event listener.
Parameters:
Name | Type | Description |
---|---|---|
node |
object | The node from where event must be fired |
type |
string | Name of event ('click', 'load', ...) |
fn |
function | Function that must be fired |
tn |
string | Expected type of node ('A', 'DIV', ...) |
addPageEventClick(node, fn)
Add a click listener on any node.
Parameters:
Name | Type | Description |
---|---|---|
node |
object | The node from where event must be fired |
fn |
function | Function that must be fired |
addPageEventLink(node, fn)
Add a click listener on A node.
Parameters:
Name | Type | Description |
---|---|---|
node |
object | The node from where event must be fired |
fn |
function | Function that must be fired |
addPageEventLoad(node, fn)
Add a load listener.
Parameters:
Name | Type | Description |
---|---|---|
node |
object | The node from where event must be fired (commonly: window) |
fn |
function | Function that must be fired |
addPageEventSubmit(node, fn)
Add a submit listener (typically on a FORM).
Parameters:
Name | Type | Description |
---|---|---|
node |
object | The node from where event must be fired (a FORM in most cases) |
fn |
function | Function that must be fired |
beginCustomSalesOrder(fp)
Allows controlling Sales order initialization.
Mapped to CStatApp.beginSalesOrder
Parameters:
Name | Type | Description |
---|---|---|
fp |
string | Final path, as computed for Perimeter mapping (Initial or Customized or Remainder) |
beginCustomSalesProduct(pdt, an)
Allow controlling Product initialization, before it is collected.
Mapped to CStatApp.beginSalesProduct
Parameters:
Name | Type | Description |
---|---|---|
pdt |
stat_sales.Product | Product object |
an |
Array.<object> | List of nodes describing this Product |
beginCustomSearch(fp)
Allow controlling Search tracking initialization.
Mapped to CStatApp.beginSearch
Parameters:
Name | Type | Description |
---|---|---|
fp |
string | Final path, as computed for Perimeter mapping (Initial or Customized or Remainder) |
beginCustomVideo(fp)
Entry point before videos collection
Mapped to CStatApp.beginVideo
Parameters:
Name | Type | Description |
---|---|---|
fp |
string | Final path, as computed for Perimeter mapping (Initial or Customized or Remainder) |
beginCustomVisitor(fp)
Allows controlling Visitor ID & Category initialization.
Mapped to CStatApp.beginVisitor
Parameters:
Name | Type | Description |
---|---|---|
fp |
string | Final path, as computed for Perimeter mapping (Initial or Customized or Remainder) |
clickStat(name, type, linkURL, target)
Raise navigation or download click tag with or without executing the link (in the same window)
(compared to xt_med, page doesn't need to be marked before, it just needs to be prepared with pageStatPrepare)
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Click tag name (including chapters) |
type |
string | Click tag type ('N', 'S', 'T') |
linkURL |
string | Link target |
target |
string | Target type |
- Deprecated:
- Yes
clickStatEvent(name, type, fn)
Send click, and execute a function once done acknoledged.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Click tag name (including chapters) |
type |
string | Click tag type ('N', 'S', 'T', 'A') |
fn |
function | The function to be fired when click has been sent |
- Deprecated:
- Do not use for new developments.
comparePath(path, filter) → {boolean}
Compare page path to filter
Parameters:
Name | Type | Description |
---|---|---|
path |
string | Path to compare |
filter |
string | Filter to compare (wildcard '*' allowed at begining or end, or at folder end) |
true if path matches filter
doCustomAlert()
Allows custom handling of a global error state that prevents statistics activation.
By default: does nothing.
Called when the Configuration is missing or corrupted.
doCustomCheck() → {boolean}
Custom condition to allow global statistic enabling.
By default: return true.
false when there’s something wrong that should prevents statistic tag.
doCustomMarker()
Allows controlling trackers activation (i.e. markers injection), triggered on DOMContentLoaded.
Mapped to CStatApp.activate
endCustomSalesOrder(fp)
Allows controlling Sales order completion & checking.
Mapped to CStatApp.endSalesOrder
Parameters:
Name | Type | Description |
---|---|---|
fp |
string | Final path, as computed for Perimeter mapping (Initial or Customized or Remainder) |
endCustomSalesProduct(pdt, an)
Allows controlling Product initialization, after it is collected (for control & completion).
Mapped to CStatApp.endSalesProduct
Parameters:
Name | Type | Description |
---|---|---|
pdt |
stat_sales.Product | Product object |
an |
Array.<object> | List of nodes describing this Product |
endCustomSearch(fp)
Allows controlling Search tracking after collection.
Mapped to CStatApp.endSearch
Parameters:
Name | Type | Description |
---|---|---|
fp |
string | Final path, as computed for Perimeter mapping (Initial or Customized or Remainder) |
endCustomVideo(fp)
Entry point after videos collection
Mapped to CStatApp.endVideo
Parameters:
Name | Type | Description |
---|---|---|
fp |
string | Final path, as computed for Perimeter mapping (Initial or Customized or Remainder) |
endCustomVisitor(fp)
Allows controlling Visitor ID & Category collected values.
Mapped to CStatApp.endVisitor
Parameters:
Name | Type | Description |
---|---|---|
fp |
string | Final path, as computed for Perimeter mapping (Initial or Customized or Remainder) |
filterNodeName(nn) → {string}
Apply filter on a string to avoid forbidden characters, encode result string.
Parameters:
Name | Type | Description |
---|---|---|
nn |
string | The name to be filtered |
Filtered name
filterXtPageName(name, esepopt, leafexopt) → {string}
Apply filter on a tag name to avoid forbidden characters, encode result string.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
name |
string | The name to be filtered |
||
esep |
string |
<optional> |
"_" | Separator used to replace exceeded chapter marks (cannot be empty, _ by default) |
leafex |
string |
<optional> |
Leaf exception: discarded when found at the last place |
Filtered name
getClickStatURL(name, type) → {string}
Get click tag URL
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Click tag name (including chapters) |
type |
string | Click tag type ('N', 'S', 'T', 'A') |
- Deprecated:
- Yes
the request URL that should be used as img.src
getCustomExtraChapter() → {string}
Allows changing in Page names the separator used to replace :: when the number of chapter is greater than 3.
It is used only by Page names, so it doesn't impact any click nor event name, except when they embed Page name with %x: in this case the Extra Chapter is used to replace all chapter separators.
Mapped to CStatApp.getExtraChapter
New extra separator
getCustomExtraLeaf() → {string}
Declare a value to be removed from an ATI page tag name when found as leaf name (when there are chapters).
It is used only by Page names, so it doesn't impact any click nor event name.
It can be useful to remove ::undefined at the end of a name.
Mapped to CStatApp.getExtraLeaf
Leaf value to be removed.
getCustomLinkName(href, type) → {string}
Allows customizing a click name from its target URL
Mapped to CStatApp.getLinkName
Parameters:
Name | Type | Description |
---|---|---|
href |
string | URL of link |
type |
string | Click tag type ('N', 'S', 'T', 'A') |
Click name
getCustomLinkNodeName(node, type, eopt) → {string}
Allows customizing tag name corresponding to a given node (link or not). By default: call stat_link.getLinkNodeNameNc
Mapped to CStatApp.getLinkNodeName
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
node |
object | The node from which click tag is raised |
|
type |
string | Click tag type ('N', 'S', 'T', 'A', 'IS') |
|
e |
object |
<optional> |
Current event |
Click tag name
getCustomNodeLabel(node) → {string}
Allows controlling the way a text is retrieved from a node when # is used in an click & event names.
Called by stat_link.getNameChapter. It doesn't change other values extraction.
Mapped to CStatApp.getNodeLabel
Parameters:
Name | Type | Description |
---|---|---|
node |
object | DOM node |
node label
getCustomPath(p, isGlobal) → {string}
Allows customizing the path to be compared with Production or Perimeters Path root, by adding virtual folders or move/remove existing ones.
Mapped to CStatApp.getProductionPath (isGlobal=true) and CStatApp.getPerimeterPath (isGlobal=false)
Parameters:
Name | Type | Description |
---|---|---|
p |
string | Initial Path (Original path shorten with common path) when isGlobal is true, Customized path when false |
isGlobal |
boolean | true for Production Path, false for Perimeter Path |
Customized path
getCustomSearchPos(node)
Allows controlling the calculation of result click position (replace standard calculation).
Mapped to CStatApp.getSearchPos
Parameters:
Name | Type | Description |
---|---|---|
node |
Clicked result link node |
Computed node position
getCustomVideoPattern(fp)
Allows controlling the pattern used to recognize a YouTube video.
Mapped to CStatApp.getVideoPattern
By default: return 'www.youtube.com/embed/'
Parameters:
Name | Type | Description |
---|---|---|
fp |
string | Final path, as computed for Perimeter mapping (Initial or Customized or Remainder) |
Video pattern to be found in iframe.src. If empty, default will be used.
getCustomVideoTheme(fp) → {string}
Allows controlling the Theme associated to the page Videos.
Mapped to CStatApp.getVideoTheme
Parameters:
Name | Type | Description |
---|---|---|
fp |
string | Final path, as computed for Perimeter mapping (Initial or Customized or Remainder) |
The Video Theme of the page.
getDomainCookie2() → {string}
Retrieve the cookie domain, by removing the term before first node
hostname minus subdomain
getPageDomain(u) → {string}
Retrieve domain from URL
Parameters:
Name | Type | Description |
---|---|---|
u |
string | URL to check |
The domain of this URL
getPageHostname(u) → {string}
Retrieve hostname from URL
Parameters:
Name | Type | Description |
---|---|---|
u |
string | URL to check, current one if not specified |
The hostname of checked URL
getPageLastName(u) → {string}
Retrieve the last name in URL: folder or filename without extension, once path shorten with removed folders
Parameters:
Name | Type | Description |
---|---|---|
u |
string | URL to check |
The leaf name of this URL
getPageLastTag(tagName) → {string}
Retrieve the last value of a given tag name used in current page
If the tag name is present several time, only the last value is considered
Parameters:
Name | Type | Description |
---|---|---|
tagName |
string | The tag name ('H1', 'TITLE', ...) |
The value of last occurrence of this tag name
getPageMetaContent(n) → {string}
Get the content attribute of a meta defined in page.
Parameters:
Name | Type | Description |
---|---|---|
n |
string | Meta name |
The content value of meta tag
getPageParam(p) → {string}
Retrieve parameter in current URL
Parameters:
Name | Type | Description |
---|---|---|
p |
string | Parameter to retrieve (case insensitive) |
The parameter value, 'undefined' or null if missing
getPageShortenPath(p) → {string}
Remove common path and possibly next folder (when required) from Original Path name.
Don't remove page extension, if any.
Parameters:
Name | Type | Description |
---|---|---|
p |
string | Original Path name |
The shorten path corresponding to given URL (less shortener and possibly next)
getPageStatPath(p, noCustom) → {string}
Get Inital or Customized path from Original path name.
Call getPageShortenPath, then remove page extension and last slash if any, then -if noCustom is missing or false- call getCustomPath(p, true) which is mapped to CStatApp.getProductionPath
Parameters:
Name | Type | Description |
---|---|---|
p |
string | Original Path name |
noCustom |
boolean | Prevent final call to getCustomPath |
The Initial path if noCustom=true, the Customized path otherwise.
getPageSubdomain(u) → {string}
Retrieve Page subdomain
Parameters:
Name | Type | Description |
---|---|---|
u |
string | URL to check |
Current URL subdomain
getUrlArray(u) → {string}
Retrieve URL as an array of elements
Parameters:
Name | Type | Description |
---|---|---|
u |
string | URL to check |
Array of url elements [protocol,subdomain,domain,path]
getUrlParser(surl) → {object}
Retrieve parameter parser in given URL (parameters can be retrieved in lowercase)
Parameters:
Name | Type | Description |
---|---|---|
surl |
string | URL to parse |
The map which contains parsed parameters. Use as object[parameter], with parameter in lower case
getXtChapter(p, n) → {string}
Extract one chapter from an ATI tag name
Parameters:
Name | Type | Description |
---|---|---|
p |
string | ATI tag name (chapter1::chapter2...::pageName), current Page tag if omitted |
n |
number | Chapter index, from 0 to 2. 0 if omitted. Negative value allowed (-1=last one) |
Corresponding chapter. Empty if index is page name or further
getXtDomain() → {string}
Retrieve ATI server domain
ATI server domain to be used by tag
getXtPageName(p) → {string}
Extract page name (leaf) from an ATI tag name
Parameters:
Name | Type | Description |
---|---|---|
p |
string | ATI tag name (chapter1::chapter2...::pageName), current Page tag if omitted |
String on the right of last '::' separator, same as given string if no separator
getXtSubdomain() → {string}
Retrieve ATI server subdomain
ATI server subdomain to be used by tag
initCustomSalesProducts(fp)
Allows controlling Sales Product initialization (fill stat_sales.Products), after collection.
Mapped to CStatApp.initSalesProducts
Parameters:
Name | Type | Description |
---|---|---|
fp |
string | Final path, as computed for Perimeter mapping (Initial or Customized or Remainder) |
isCustomEqualPath(p1, p2) → {boolean}
Allows controlling the method used to compare current URL and map entries.
Not Mapped in Class Customizer
By default, a case sensitive comparison is done. Generated templates now use a case insensitive comparison.
Parameters:
Name | Type | Description |
---|---|---|
p1 |
string | Path to compare |
p2 |
string | Path to compare |
true when paths are equal.
isCustomExcluded()
Allows controlling pages exclusion for content tags.
Mapped to CStatApp.isExcluded
isCustomExitLink(u) → {boolean}
Allows custom handling of Outbound links identification.
Mapped to CStatApp.isExitLink
Parameters:
Name | Type | Description |
---|---|---|
u |
string | Link URL |
true when Outbound link (Exit), false when Inbound link (Navigation), undefined when cannot be determined (Action).
isCustomOptedIn() → {boolean}
Allows implementing GDPR compliance.
By default: return true.
- Tutorials:
true if statistics cookies are allowed. Otherwise, ATI is switched in Privacy mode and GA is blocked.
isCustomPreview() → {boolean}
Allows controlling the usage of PreProd configuration.
By default: return true
false to prevent PreProd switching in any case.
isPagePreview(hps) → {boolean}
Retrieve forced preview status, from statp parameter (preview if > 0) or host name patterns
Preview status is stored for all the session, until it is explicitely changed.
Parameters:
Name | Type | Description |
---|---|---|
hps |
string | Host Name Patterns (starting or ending by dot, separated by |) |
true if current status is Preview, false if it's Production
isURIencoded() → {boolean}
Ask if a string is URI encoded
true if already encoded
onCustomVideoEvent(e)
Allows adding a Video Event handler
Mapped to CStatApp.onVideoEvent
Parameters:
Name | Type | Description |
---|---|---|
e |
object | Video Event |
pageStatInjection(p_xtpageopt, newpathopt)
Prepare the context, raise page tag and active click tags.
Don't call with Single Page Applications.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
p_xtpage |
string |
<optional> |
Imposed page name, including chapters |
newpath |
string |
<optional> |
New path forcing tag to be recomputed and raised |
pageStatProductView(pRef, pName, catRef, catName)
Product impression
Parameters:
Name | Type | Description |
---|---|---|
pRef |
string | Product Reference |
pName |
string | Product Name |
catRef |
string | Category Reference |
catName |
string | Category Name |
parseFloat2(str) → {float}
Parse to float rounded 2
Parameters:
Name | Type | Description |
---|---|---|
str |
string | number as string. |
Corresponding number rounded 2 if the string was really a number.
parseFloatI18n(str) → {float}
Retrieve a number from a string containing a number in international format and possibly other characters.
Parameters:
Name | Type | Description |
---|---|---|
str |
string | String to parse (must contain a number). |
Real number contained in the string, 0 if no number found.
raiseCustomClickTag(lname, type, node, eopt) → {boolean}
Allows controlling an event tag before it is raised (and possibly prevent it, or modify its properties).
Mapped to CStatApp.raiseClickTag
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
lname |
string | Click tag name. |
|
type |
string | Click tag type ('N', 'S', 'T', 'A', 'IS') |
|
node |
object | The node from which click tag is raised |
|
e |
object |
<optional> |
Current event |
true to continue event processing, false otherwise
redoCustomMarker()
Force new marker injection
Call stat_link.reInit, stat_download.reInit, possibly stat_search.reInitResults, and then recall doCustomMarker.
setAsyncScript(ss)
Add asynchronous script inclusion in DOM
Parameters:
Name | Type | Description |
---|---|---|
ss |
string | Script path (relative or absolute) |
setCustomDownloadHook() → {boolean}
Entry point before applying the hook catching downloads made with a call to window.open.
By default: does nothing.
true If the customizer handles the hook, on just to prevent default handling. false or nothing lets the hook proceeds.
setCustomGA(ga)
Allows controlling specific GA parameters or to override any value previously computed by the configuration. Don’t use with Mirroring.
Mapped to CStatApp.setParamGA
Parameters:
Name | Type | Description |
---|---|---|
ga |
object | Google Analytics object |
setCustomXt(fp)
Allows controlling specific ATI parameters or to override any value previously computed by the configuration process.
Mapped to CStatApp.setParam
Parameters:
Name | Type | Description |
---|---|---|
fp |
string | Final path , as computed for Perimeter mapping (Initial or Customized or Remainder) |
setSyncScript(ss)
Add synchronous script inclusion in DOM
Parameters:
Name | Type | Description |
---|---|---|
ss |
string | Script path (relative or absolute) |
trimString(s) → {string}
Remove leading and trailing spaces from a string
Parameters:
Name | Type | Description |
---|---|---|
s |
string | The string where spaces must be removed |
String without leading and trailing spaces
updateXtPageName(tn, ln) → {string}
Change page name (leaf) into an ATI tag name (page view or click)
Parameters:
Name | Type | Description |
---|---|---|
tn |
string | ATI tag name (chapter1::chapter2...::pageName) to be updated |
ln |
string | New leaf name |
Updated ATI tag name