Difference between revisions of "YouTube Video Tracking"

From Market Ruler Help
Jump to: navigation, search
m
Line 30: Line 30:
 
== Using alternate names for actions ==
 
== 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.
+
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.
  
 
  <nowiki><script type="text/javascript">
 
  <nowiki><script type="text/javascript">
Line 41: Line 41:
 
</script></nowiki>
 
</script></nowiki>
  
The above code will map each action on the left to the new action on the right.  
+
The above code will map each action on the left to the new action on the right. So when the play button is recorded, the action "yt-play" will record with ConversionRuler.
  
 
== See also ==
 
== See also ==
Line 47: Line 47:
 
* [[Install the tracking snippet]]
 
* [[Install the tracking snippet]]
 
* [[Can ConversionRuler track Flash advertisements?]]
 
* [[Can ConversionRuler track Flash advertisements?]]
 +
* [[Named Actions]]
  
 
[[Category:ConversionRuler Installation]]
 
[[Category:ConversionRuler Installation]]

Revision as of 21:37, 19 August 2013

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. So when the play button is recorded, the action "yt-play" will record with ConversionRuler.

See also