Tracking YouTube Video Plays As Affiliate Conversions

Becky Doles

With YouTube firmly entrenched as the second largest search engine, it’s definitely become a driving force in the world of performance marketing. In-video advertising, with links to landing pages, is one obvious method for converting YouTube views to purchases. For more organic conversions, including an affiliate tracking link in the video description provides great data about clicks and conversions coming from a page on YouTube.

While those are both great examples of conversions originating on YouTube. You can also tracking views of YouTube videos as a conversion event on your website.

Why would you want to track YouTube views as a conversion?

On 14 March 2012, YouTube changed the algorithm for the way they rank videos on YouTube. In the past, ranking was skewed toward videos that got more clicks to initiate playback. This created the temptation for video creators to put evocative images in video thumbnails, to draw the eye and encourage clicking. Now the YouTube algorithm is being skewed more toward great content – or at least content people watch.

First and foremost, this change means that you need to create videos people want to watch. Duh!

There are many reasons to track YouTube views as affiliate conversions, but I will cite two specific scenarios that translate directly to additional revenue and then walk you through how to track YouTube views using HasOffers.

Using Affiliates to Drive Video Engagement Score

YouTube is a great platform for customer acquisition. I get thousands of visits daily to multiple web properties from people who click on the links I place at the beginning of the video description. Part of the reason I get those clicks is because my videos rank well in YouTube search.

By providing incentive to affiliates to drive qualified views to a video embedded on your website, you can drive up the overall engagement score for the video, which will cause the video to perform better in YouTube search over time.

More importantly, you need to make sure you get enough engagement with your videos so that they can rank effectively. From what I can tell, ranking still benefits from getting as many people as possible to watch a video in the first 24-48 hours after the video goes live. One way to do this is to encourage affiliates to drive traffic to a page where you embed the YouTube video.

Keep in mind that you only want to pay out for people who watch the video. Just clicking play is nearly valueless. I’ll get to the specifics of tracking after I point out a second reason to track video plays.

Qualifying Leads with Video Views

I have personally tested sales scenarios where prospects who view a video on the landing page are more likely to become customers than those who don’t. In other words, a video viewer is a higher quality customer.

For one recurring revenue product I worked with, customers who watched a video on the offer page before joining stayed an average of three months longer than those who signed up without watching. Overall the group of people who watched the video represented a lower churn rate than the group who signed up without ever clicking play.

My hypothesis is that the people who watched the video had a better understanding of what they were signing up for, but I don’t have any actual proof of this being the case.

How do you track YouTube views?

Keep in mind this method gives you no data about the people watching your video on YouTube. It only tells you about people watching from your landing page.

When you embed the video from YouTube on your landing page, be sure you check the box to Use old embed code (see screenshot below). This is vital because the new iFrame code YouTube defaults to can’t be tracked with this method.

YouTube Use Old Embed Code

You then need to ad some JavaScript telling your conversion pixel to display once the video completes. The code below will do the trick.

var playedOnce = false;

function onYouTubePlayerReady(playerid) {
	player = document.getElementById("ytvideo");
	player.addEventListener("onStateChange", "youtubeEvent");
function youtubeEvent(state) {
	if(state == 1) {
		if(!playedOnce) {
			// Video started... Unique/first play
			playedOnce = true;
		// Play pressed again
	if(state == 0) {
		// Video ended

If you want to credit a conversion anytime someone clicks play, see the HasOffers support page.

You also need to add the conversion pixel to your page. To do this, you either need to create a YouTube campaign in your HasOffers account or you can create a new Offer Goal for your YouTube play. Set the conversion tracking protocol as HTTP iFrame pixel. Code like the following should go before the tag on your page. This code tells the conversion pixel to display in a div on your page called ho-pixels. If you already use jquery, you can leave out the first line.

<script type="text/javascript" src=""></script>
<script type="text/javascript">
var displayOnce = false;
function displayConversionPixel(){
	// display HasOffers conversion tracking pixel
	if(!displayOnce) {
		$('#ho-pixels').append('<iframe src="http://YourTrackingLinkGoesHere" scrolling="no" frameborder="0" width="1" height="1"></iframe>');
		displayOnce = true;

Some where before the tag, include the div that will display the conversion pixel. This div should look like:

<div id="ho-pixels"></div>


Once you have the code in place, you can verify it’s working by testing a click to the page and clicking play on the video. When the video finishes playback, the conversion pixel will load and you’ll have a completed event.

What are some of the clever examples you’ve seen for rewarding affiliates for video views?

Becky Doles

Becky is the Senior Content Marketing Manager at TUNE. Before TUNE, she led a variety of marketing and communications projects at San Francisco startups. Becky received her bachelor's degree in English from Wake Forest University. After living nearly a decade in San Francisco and Seattle, she has returned to her home of Charleston, SC, where you can find her enjoying the sun and salt water with her family.

2 responses to “Tracking YouTube Video Plays As Affiliate Conversions”

  1. […] to track Youtube plays as conversions from hasOffers. Google wants people to use Adwords to push video: How every business can play big […]

  2. Joe G. says:

    What about embeds that use the new code? I want to have our affiliates get ppv (paid-per-view), Is it possible to use the same javascript to track with the new embed code? Would this tracking also work in Google Analytics for custom variables?

Leave a Reply