Description
Standard tag
Tracker initialisation is done via the instantiation of a new ATInternet.Tracker.Tag object:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title>My Page</title> <script type="text/javascript" src="http://www.site.com/smarttag.js"></script> <script type="text/javascript" src="http://www.site.com/at-smarttag-viewability.js"></script> </head> <body> <script type="text/javascript"> var tag = new ATInternet.Tracker.Tag(); // your tag </script> ... </body> </html> |
Asynchronous tag
You can load our JavaScript library asynchronously. However, this requires an adaptation in your tagging. Check out the Asynchronous tag for an overview of the functionality .
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
<script type="text/javascript"> window.ATInternet = { onTrackerLoad:function(){ window.tag = new window.ATInternet.Tracker.Tag(); var _callback = function () { // your tag }; // This code loads the plugin code to track media and call the '_callback' function after loading. ATInternet.Utils.loadScript({url: 'http://www.site.com/at-smarttag-viewability.js'}, _callback); } }; (function(){ var at=document.createElement('script'); at.type='text/javascript'; at.async=true; at.src='http://www.site.com/smarttag.js'; (document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]||document.getElementsByTagName('script')[0].parentNode).insertBefore(at,null); })(); </script> |
Plugin configuration
You can set the global view percentage through the Tracker configuration, thanks to the property viewabilityPercent:
1 2 3 4 5 6 7 8 |
var config = { site: 123456, // ..., viewabilityPercent: 50 }; var tag = new ATInternet.Tracker.Tag(config); |
Viewable elements tagging
In order to inform the plugin that an element viewability must be tracked, you need to insert an attribute data-atview-id, containing the ID/name that will be retrieved in your data. Please don’t use any special characters, this could lead to wrong measurement.
1 2 3 4 5 |
<div data-atview-id="My-viewable-div"> <!-- ... --> </div> |
Element’s level percentage
In order to set a specific viewability percentage to an element, you can add the attribute data-atview-percent to it, containing the numeric value of the percentage.
1 2 3 4 5 |
<div data-atview-id="My-viewable-div" data-atview-percent="70"> <!-- ... --> </div> |
Reviews
There are no reviews yet.