YouTube Video Tracking

From Market Ruler Help
Revision as of 21:28, 19 August 2013 by Admin (talk | contribs)
Jump to: navigation, search

Tracking YouTube videos is now handled seamlessly with an add-on library from ConversionRuler.

Requirements

Tracking YouTube Videos requires the following:

  • Your site must use the jQuery library on the pages in question
  • ConversionRuler currently supports tracking of iframe YouTube videos only (this is the modern version)
  • To track old-style YouTube videos, employ the technique for tracking Flash

How to implement

  1. Install ConversionRuler Tracking normally on your site.
  2. If jQuery is already being used, add the following script after jQuery is loaded:
    <script type="text/javascript" src="http://www.conversionruler.com/bin/youtube.js"></script>
  3. Edit your sites actions to add the following actions:
    • "play" - When a video is played by the user
    • "pause" - When a video is paused by the user
    • "seek" - When a video is seeked by the user
    • "end" - When a video reaches the end
  4. YouTube videos will now be tracked using the named actions as described below

How actions are tracked

Actions are tracked with the following parameters:

  • First text field: Full URL of video
  • Second text field: ID of video (e.g. UJ53Js0YKZM)
  • Third text field: Seconds offset in the video where the action occurred

Using alternate names for actions

In case you wish to use an alternate naming or numbering scheme for your actions in ConversionRuler, the script allows you to map the default names to new ones. To do so, create a global variable in JavaScript to map the names from the defaults to your chosen names. The variable used for this is called cr_youtube_actions, e.g.

<script type="text/javascript">
var cr_youtube_actions = {
  "play": "yt-play",
  "pause": "yt-pause",
  "seek": "yt-seek",
  "end": "yt-end"
};
</script>

The above code will map each action on the left to the new action on the right.

See also