-
Notifications
You must be signed in to change notification settings - Fork 0
Tracker initialisation 3bcb27
Before starting, please download our JavaScript library, or push it onto our CDN, from within the Tag Composer interface.
This library enables you to:
- Set up your tagging perimeter/scope (site, domain used to write cookies, etc.).
- Select desired features via configurable plugins.
Once the library is set up, you must call it inside the <head> of your page.
<!-- Local file -->
<script src="smarttag.js"></script>
<!-- CDN file -->
<!-- File must be published on the TDN for this site within Tag Composer -->
<script src="//tag.aticdn.net/YOURSITEID/smarttag.js"></script>Tracker initialisation is done via JavaScript methods to be inserted.
<html>
<head lang="en">
<meta charset="UTF-8">
<title>My Page</title>
<script src="smarttag.js"></script>
</head>
<body>
...
<script type="text/javascript">
var tag = new ATInternet.Tracker.Tag();
</script>
</body>
</html>The constructor ATInternet.Tracker.Tag() can take two arguments, a first one intended for overload Tracker configuration and a second intended for add context values.
The file “smarttag.js” contains the default configuration defined during generation in Tag Composer. It’s possible to overload a part of the configuration by specifying the new settings during initialisation.
Example:
var tag = new ATInternet.Tracker.Tag({secure: true});Here, the “secure” setup variable was force-set to true.
List of basic setup variables that can be overloaded:
-
The
securevariable enables the sending of information in a secure manner, or not. Specify true in the case of an HTTPS protocol, and false for an HTTP protocol. -
The
disableCookievariable, if set to true, enables you to block the writing of tracker cookies (first and third). -
The
cookieDomainvariable enables you to specify the domain for the writing of cookies. In cases where this parameter is empty (cookieDomain: ''), the domain of the current page will be used. -
The
cookieSecurevariable, if set to true, enables you to add the option ‘secure’ for the writing of tracker cookies (first). Please be aware that ‘secure’ cookies will only work on HTTPS pages. -
The
ignoreEmptyChapterValuevariable, if set to true, enables you to ignore chapters without value.
= 5.5.0
Other setup variables exist, but require advanced knowledge of the Tracker (see Appendix).
Its also possible to force context values which will be added and shared between tags according to the type.
Example :
var tag = new ATInternet.Tracker.Tag({}, {'forcedCampaign': 'campaignValue'});Here, the campaign value defined in “forcedCampaign” will be added in page tags.
List of context variables that can be declared :
- The
forcedCampaignenables you to declare and force a campaign. - The
forcedReferervariable enables you to declare and force a referer.
Here is an example of a tag allowing you to measure a pageview with the label “Page Name”:
<script type="text/javascript">
var ATTag = new ATInternet.Tracker.Tag();
ATTag.page.send({name:'Page_Name'});
</script>Setup variables that can be overloaded:
| Name | Default value | Description | Version |
|---|---|---|---|
| secure | false | Force the sending of information in a secure manner (HTTPS) | < 5.19.0 |
| disableCookie | false | Enables you to block the writing of tracker cookies (first and third) | – |
| cookieDomain | TagComposer value | Domain for the writing of cookies. If this parameter is empty (cookieDomain: ''), the domain of the current page will be used |
– |
| cookieSecure | false | Add option ‘secure’ for the writing of tracker cookies (first) | >= 5.5.0 |
| ignoreEmptyChapterValue | true | Ignore chapters without value | >= 5.5.0 |
| site | TagComposer value | Site number | – |
| log | TagComposer value | Subdomain of the collector AT Internet. Deprecated since 5.13.0, see collectDomain | < 5.13.0 |
| logSSL | TagComposer value | subdomain of the secured (HTTPS) collector AT Internet. Deprecated since 5.13.0, see collectDomain | < 5.13.0 |
| domain | TagComposer value | Domain of URL hits. Deprecated since 5.13.0, see collectDomain | < 5.13.0 |
| pixelPath | /hit.xiti | Path toward the pixel file for hits | – |
| preview | false | Force the sending of page hits in cases of loads in preview mode on the Safari browser (true: measurement enabled, false: measurement disabled) | – |
| collectDomain | TagComposer value | Data collection domain | >= 5.13.0 |
| collectDomainSSL | TagComposer value | Secured data collection domain | >= 5.13.0 |
| sendHitWhenOptOut | TagComposer value | Allows sending anonymous hits when the user is in “OPT-OUT” mode (first party) | >= 5.14.0 |
| forceHttp | false | Force hits being sent over HTTP. Since 5.19.0, hits are automatically sent over HTTPS. Requires client side visitor ID (server-side cookies require HTTPS). | >= 5.19.0 |
| maxHitSize | 2000 | Maximum characters allowed per hit. Over that number, hit will be cut in multiple parts (multi-hits) | >= 5.19.0 |
| requestMethod | GET | HTTP method used to send hits. ‘GET’ or ‘POST’ | >= 5.19.0 |
| urlPropertyAuto | TagComposer value | If enabled, automatically add a property containing the URL of the page. | >= 5.27.0 |
| urlPropertyQueryString | TagComposer value | If enabled and urlPropertyAuto enabled, add the Querystring to the property containing the URL of the page | >= 5.27.0 |
| sameSiteStrict | false | If enabled, add the flag SameSite=Strict to client-side cookies |
>=5.28.2 |
Last update: 11/05/2021
-
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