View on Github

This YouTube plugin allows you to measure YouTube players on your website tagged with AT Internet JavaScript SmartTag trackers from version 5.2.3. The plugin offers helpers enabling the quick implementation of YouTube players tracking.


Get started

  • Download our main library (smarttag.js) with this plugin (at-smarttag-youtube.js) and install it on your website.
  • Check out the documentation page for an overview of the SmartTag functionalities and code examples.


First of all, you must download our JavaScript library from Tag Composer.

Tag Composer allows you to configure your SmartTag:

  • Set up your tagging perimeter/scope (site, domain used to write cookies, etc.).
  • Select desired features via configurable plugins. Rich Media plugin is mandatory.

Once the library is set up, you can download it and insert it with this plugin into the source code of the HTML page to be tagged.



Standard tag

Tracker initialisation is done via the instantiation of a new ATInternet.Tracker.Tag object:

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 .


The different media present on the page are added to the Tracker, then user interaction information is sent. In order to track data, you have to define some media properties as objects when YouTube players are ready as follows :

  • id: ID of the media ; mandatory.
  • mediaType: Content type (“video”, “audio” or “vpost” for post-roll video measurement); mandatory.
  • playerId: Player ID (to be added when using several players).
  • mediaLevel2: Level 2 site in which the content is located.
  • mediaLabel: Name/label of content (use “::” if needed) or of a post-roll ad (do not use “::”); mandatory.
  • previousMedia: Name/label of content linked to a post-roll ad; mandatory when using “vpost” type.
  • refreshDuration: Refresh duration period (optional in seconds, but necessary for calculating detailed durations).
  • duration: Total duration of content in seconds (leave empty if L= “Live”). The duration must be inferior to 86400; mandatory when using a “clip”-type broadcast.
  • isEmbedded: On an external website ? (“true” or “false”)
  • broadcastMode: Broadcast (“live” or “clip”).
  • webdomain: URL in cases of external placements.Example :

Tagging with Flash YouTube player

Tagging with iFrame YouTube player

Tagging with asynchronous tag and iFrame YouTube player


There are no reviews yet.

Be the first to review “YouTube”

Your email address will not be published.

This field can't be Empty
This field can't be Empty
This field can't be Empty
This field can't be Empty