-
Notifications
You must be signed in to change notification settings - Fork 0
Pages
Before starting implementation of the Page plugin, please make sure you have initialised the AT Internet JavaScript Tracker and selected the plugin from within the Tag Composer interface.
The JavaScript plugin Page the measurement of pages on your site.
The Tracker has a “.set()” method enabling the definition of page tag values. This method takes an object as a parameter whose properties are as follows:
- name: Page name/label.
- chapter1: First chapter level.
- chapter2: Second chapter level.
- chapter3: Third chapter level.
- level2: Level 2.
- customObject: Custom parameters.
If the “name” parameter is empty (
name: '') and “chapter1”, “chapter2” and “chapter3” parameters are not defined, the page URL will be used as the page name in your reports.
If the parameters “chapter1”, “chapter2” or “chapter3” are empty, they will be empty as well in the analysis*.
* Since version 5.5.0, a new option (ignoreEmptyChapterValue) allows you to choose if empty chapters must be taken into account (false) or not (true).
= 5.5.0
Sending page hits is done in this case via the “tag.dispatch()” method.
- Tagging a page:
var tag = new ATInternet.Tracker.Tag();
tag.page.set({
name:'pageName'
});
tag.dispatch();- Tagging a page with a level 2:
var tag = new ATInternet.Tracker.Tag();
tag.page.set({
name:'pageName',
level2:'123'
});
tag.dispatch();- Tagging a page with chapters:
var tag = new ATInternet.Tracker.Tag();
tag.page.set({
name:'pageName',
chapter1:'chap1',
chapter2:'chap2',
chapter3:'chap3'
});
tag.dispatch();- Tagging a page with the addition of a custom object:
var tag = new ATInternet.Tracker.Tag();
tag.page.set({
name:'pageName',
customObject: {
param1: 'val1',
param2: 'val2'
}
});
tag.dispatch();- Tagging an empty chapter :
var tag = new ATInternet.Tracker.Tag();
tag.page.set({
name:'pageName',
chapter1:'chapter1',
chapter2:''
});
tag.dispatch();This will give in the hit: “chapter1::::pageName”, and will create an empty second level chapter in your analysis.
The Tracker also has a “page.send()” method that’s useful for sending hits from time to time, outside of page loads. This method can be called on an action or on an event of your choice.
Additional optional parameters are then available :
- elem : Tagged DOM element.
- event : JavaScript event (prevent event propagation) – since v5.7.0.
- callback : Function to execute – since v5.7.0.
Data in a page context defined during a call to the “page.set()” method are ignored by the method “page.send()”.
- Complete tagging:
var tag = new ATInternet.Tracker.Tag();
tag.page.send({
name:'pageName',
chapter1:'chap1',
chapter2:'chap2',
chapter3:'chap3',
level2:'123',
customObject: {
param1: 'val1',
param2: 'val2'
},
event: anEvent,
callback: function(){}
});In this case, there is no use in calling the method “tag.dispatch()”.
In order to tag a page on a click, you can use the “page.send()” method:
<a href="/mypage.html" onclick="return tag.page.send({elem:this, name:'Page', chapter1: 'mychapter', level2: '2'})">Link</a>The page name that passes through our server via http protocol (web standard) is subject to a few rules, allowing us to achieve a significant level of compatibility with browsers.
The rules are:
- No accented characters,
- No spaces (spaces should be replaced by underscores, “_”),
- No characters other than numbers and letters (no commas, ‘+’, quotation marks or apostrophes).
The authorised characters are:
- The letters abcdefghijklmnopqrstuvwxyz in big or small letters
- The numbers 1234567890
- Periods/dots .
- Slashes /
- Dash –
- Underscores _
- Tildes ~
You can encode the value if needed
The “customObject” parameter allows for the aggregation of all parameters you wish to measure: please see the entry “Custom object” for more details.
Last update: 17/05/2019
-
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