-
Notifications
You must be signed in to change notification settings - Fork 0
Operating principle 8b888c
After initialising the Tracker, tagging is done via the “setter” tag (tag.<functionality>.set()) described in the different pages of this documentation.
Example for page tagging
var tag = new ATInternet.Tracker.Tag();
tag.page.set({
name:'pageName'
});Once the desired tagging has been achieved, the sending of information is done via the dispatch() method.
tag.dispatch();This example, when taken with the preceding example, will send a “pageName” page hit.
This method is designed to be used during loading of the page or measured element. This method triggers the sending of tags accumulated via “setter”, and also optimises the number of hits to send based on the number of “setter” detected.
Exemple
var tag = new ATInternet.Tracker.Tag();
tag.<functionality1>.set(...);
tag.<functionality2>.add(...);
tag.<functionality3>.set(...);
tag.dispatch();In the case of measuring an element triggering a redirection, we strongly advise you to use tagging via the
send()method, following the recommendations found in the tagging guides for the feature you wish to measure.
This method is the same as the dispatch() method, but adds automatic redirect management.
It takes an object as a parameter whose properties are as follows:
| Property | Description |
|---|---|
| elem | Tagged DOM element |
| event | (optional) JavaScript event (prevent event propagation) |
| callback | (optional) Function to execute |
It is strongly advised to limit this type of tagging to cases where there are no other alternatives, as this type of tagging will systematically slow down the redirect in question (based on the Automatic click management timeout configuration).
If measurement involves a single functionality, please verify that this functionality possesses a send() method and follow the corresponding tagging documentation. This option is preferable, as this method is not solely based on the automatic click management timeout, but rather on the download of the measurement pixel, which will, in the majority of cases, take much less time than the configured timeout duration (500ms by default).
Example using the clicked element
<a href="http://www.site.com" onclick="return customFunction(this);">Link</a>
<script type="text/javascript">
window.tag = new ATInternet.Tracker.Tag();
function callback() {console.log('executed');}
function customFunction(clickedElement){
tag.<functionality1>.set(...);
tag.<functionality2>.add(...);
tag.<functionality3>.set(...);
return tag.dispatchRedirect({
elem : clickedElement,
callback: callback
});
}
</script>
Example using manually provided redirect data
<a href="javascript:void(0);" onclick="return customFunction();">Link</a>
<script type="text/javascript">
window.tag = new ATInternet.Tracker.Tag();
function customFunction(){
tag.<functionality1>.set(...);
tag.<functionality2>.add(...);
tag.<functionality3>.set(...);
return tag.dispatchRedirect({
elem : {
href : 'http://www.site.com',
target : '_self'
}
});
}
</script>Example on a form
<form action="http://www.site.com" type="GET" onsubmit="return customFunction(this);">
...
</form>
<script type="text/javascript">
window.tag = new ATInternet.Tracker.Tag();
function customFunction(clickedForm){
tag.<functionality1>.set(...);
tag.<functionality2>.add(...);
tag.<functionality3>.set(...);
return tag.dispatchRedirect({
elem : clickedForm
});
}
</script>Example using JQuery
<a href="http://www.site.com" id="link">Link</a>
<script type="text/javascript">
window.tag = new ATInternet.Tracker.Tag();
$("#link").on( "click", function(event) {
tag.<functionality1>.set(...);
tag.<functionality2>.add(...);
tag.<functionality3>.set(...);
tag.dispatchRedirect({
elem: this,
event: event
});
});
</script>
It is possible to send hits in a sporadic and direct manner via the method tag.<functionality>.send(). This method is useful, notably when sending hits on specific actions or events (ex: click on a link).
var tag = new ATInternet.Tracker.Tag();
tag.page.send({name:'pageName'});Last update: 30/01/2018
-
Data API
- Data flow
- Advice optimizations data flow
- Error codes data flow
- Faq data flow
- General information data flow
- Technical information data flow
- Reporting API v3
- Getting started
- Methods
- Parameters
- Technical information
- REST API
- Campaigns
- Custom variables
- Getting started rest
- Methods rest
- Response structure parameters rest
- Fixed periods
- Parameters compatibility
- Relative periods
- Structure of the response
- “code” parameter
- “columns” parameter
- “evo” parameter
- “filter” parameter
- “include” parameter
- “lng” parameter
- “max-results” parameter
- “page-num” parameter
- “period” parameter
- “period” parameter: “H” v. “He” & “MN” v. “MNe”
- “retention” parameter
- “segmentdesc” parameter
- “segment” parameter
- “sep” parameter
- “sort” parameter
- “space” parameter
- Technical specifications rest
- Data flow
-
Data collection
- Android
- Advanced features
- Campaigns
- Changelog
- Content
- Ecommerce
- Getting started
- Users
- Apple
- Advanced features
- Campaigns
- Changelog
- Content
- Ecommerce
- Getting started
- Users
- General
- Cddc renew staging process
- Changelog
- Craft your hit
- Encoded parameters
- Server side cookie management
- Supported taggings
- Tagging deletion
- Utilisation of dispatch sdks
- JavaScript
- Advanced features
- Campaigns
- Changelog
- Content
- Ecommerce
- Getting started
- Partners javascript
- Users
- Piano Analytics
- Event tagging piano analytics
- Getting started piano analytics
- Piano analytics tagging
- Feeding piano analytics with as2 tagging
- Tagging custom properties sdk
- Android