Difference between revisions of "YouTube Video Tracking"

From Market Ruler Help
Jump to: navigation, search
m
m
Line 11: Line 11:
 
== How to implement ==
 
== How to implement ==
  
# [[Install_the_tracking_snippet|Install ConversionRuler Tracking] normally on your site.
+
# [[Install_the_tracking_snippet|Install ConversionRuler Tracking]] normally on your site.
# If [[jQuery]] is already being used, add the following script after jQuery is loaded: <pre><nowiki><script type="text/javascript" src="http://www.conversionruler.com/bin/youtube.js"></script></nowiki></pre>
+
# If [[jQuery]] is already being used, add the following script after [[jQuery]] is loaded: <pre><nowiki><script type="text/javascript" src="http://www.conversionruler.com/bin/youtube.js"></script></nowiki></pre>
 
# Edit your sites actions to add the following actions:
 
# Edit your sites actions to add the following actions:
* "play" - When a video is played by the user
+
#* "play" - When a video is played by the user
* "pause" - When a video is paused by the user
+
#* "pause" - When a video is paused by the user
* "seek" - When a video is seeked by the user
+
#* "seek" - When a video is seeked by the user
* "end" -> When a video reaches the end
+
#* "end" - When a video reaches the end
 
# YouTube videos will now be tracked using the named actions as described below
 
# 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 <code>cr_youtube_actions</code>, e.g.
 +
 +
<nowiki><script type="text/javascript">
 +
var cr_youtube_actions = {
 +
  "play": "yt-play",
 +
  "pause": "yt-pause",
 +
  "seek": "yt-seek",
 +
  "end": "yt-end"
 +
};
 +
</script></nowiki>
 +
 +
The above code will map each action on the left to the new action on the right.
 +
 +
== See also ==
 +
 +
* [[Install ConversionRuler Tracking]]
 +
* [[Can ConversionRuler track Flash advertisements?]]
 +
 +
[[Category:ConversionRuler Installation]]

Revision as of 21:16, 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.

See also