AutoTrack - Automated Event Tracking
AFS Analytics offers an option to automatically track the interactions between visitors and the pages of a website. This feature, named AutoTrack, is undoubtedly a major asset of this web analytics solution.
What events are tracked by the Autotrack option?
The
Sending a page view can also be triggered by the
Autotrack automatically detects the characteristics of an event, but specifying attributes via
Introduction to "DataSets"
HTML5 enables the association of an HTML element with data by using the
The syntax of a
<element data-category = "value"> ... </ element>
In our example, the
Purpose of DataSets
The purpose of datasets is the simplification of the storage of data in HTML documents, especially in the elements. Thanks to the
The different modes of the AutoTrack option
The
The "off" mode
In this state, the "Autotrack" option is completely deactivated. There is no automatic capture of events.The "dataset" mode
In this mode, only those elements with definedThe "on" mode
In this mode, all events are tracked, even if noAutoTrack sub-settings.
AFS Analytics allows you to disable some features of AutoTrack. This is useful if you do not want to track certain events or items.
Note: These settings must be made after specifying the main mode of
To set a sub-setting, we add a dot to "autotrack" followed by the sub-setting name .
aa ('set','autotrack.subsetting',[state]);
//Track only outbound click
aa ('set','autotrack','off');
aa ('set','autotrack.outboundclick','on');
//but not into the "iframe"
aa ('set','autotrack.iframe','off');
//first setting
aa ('set','autotrack','on');
//disable inside clicks (second setting)
aa ('set','autotrack.insideclick','off');
//disable iframe tracking (last setting)
aa ('set','autotrack.iframe','off');
"Video" setting
Change the video tracking mode.
aa('set',"autotrack.video","off");
//same thing with a object
aa('set',"autotrack",{"video”:"off"});
"Download" setting
Change the tracking mode of downloads.
aa('set',"autotrack.download","off");
"Outboundclick" setting
Change the tracking mode of "Exit clicks"
aa('set',"autotrack.outboundclick","off");
"Insideclick" setting
Change the tracking mode for clicks targeted to a site page.
aa('set',"autotrack.insideclick","off");
"Iframe" setting
Change the tracking mode of "iframe" elements.
aa('set',"autotrack.iframe","off");
"Div" setting
Change the tracking mode for "div" elements.
aa('set',"autotrack.div","off");
"Button" setting
Change the tracking mode for "button" elements.
aa('set',"autotrack.button","off");
Example of the setting of several options with a single line of code:
aa('set',"autotrack","dataset");
aa('set',"autotrack",{"insideclick":"on","iframe":"off"});
Setting the datasets attributes for the Autotrack option
The syntax of a
data-[datasetprefix]-[name of the field to be filled in]='field value'
Data-aa-category = 'click'
The different "dataset" fields available:
The "hitType" field (optional)
This field specifies the type of hit. It can accept two values:
This field specifies the title of the event.
This field indicates the category of the event:
This field specifies the action. For example, for a click:
This field specifies the type of the event. Not to be confused with
This field specifies the destination of the event.
The "callback" fieldThis field specifies a callback function.
The "params" fieldThis field specifies a string to be passed to the return function.
List of examples of using the AutoTrack feature
Tracking clicks with autotrack and datasets
<a href="https://www.mysite.com" data-aa-hitType="event" data-aa-category="click" data-aa-label="mygreatclick" >my great click</a>
Note: AFS Analytics will automatically detect the Tracking the downloads with autotrack and the datasets
<a href="http://monsite.com/monfichier.pdf" data-aa-hitType="event" data-aa-category="download" data-aa-label="mon super fichier pdf" data-aa-callback="mycallback" data-aa-params="{message:'test'}" >monfichier.pdf</a>
Tracking the playback of a YouTube video with Autotrack and dataset.
The
<iframe src="https://www.youtube.com/embed/cnBtRh08ShQ?rel=0" frameborder="0" data-aa-category='video' data-aa-action='play' data-aa-label='AFS Analytics vidéo'></iframe>
Conclusion
Used wisely, the AutoTrack feature allows you to track all the interactions between the visitors and the website pages without any line of code.
By AFS Analytics, Wednesday, May 17, 2017