sales pixelconversion trackingyoutube attributionexplainer

What Is a Sales Pixel and How Does It Work for YouTubers?

RevData Team
•February 19, 2025•
7 min read

A sales pixel is a small piece of JavaScript code placed on your post-purchase thank-you page that fires silently when a buyer lands there, sending a conversion signal to your tracking system that connects the sale back to the specific YouTube video that drove it. Without a sales pixel, you know YouTube sends buyers — but you don't know which videos are responsible.

What Is a Pixel?

In web tracking terminology, a "pixel" originally referred to a 1x1 transparent image embedded in a webpage. When the page loaded, the image was requested from a tracking server, which logged the page load as a "hit." Modern tracking pixels are JavaScript scripts rather than actual image files, but the name stuck.

You've encountered tracking pixels many times. Facebook's Meta Pixel, Google's conversion tracking tag, and LinkedIn's insight tag all work on the same principle: a small code snippet on a webpage fires when that page loads, sending data back to the tracking platform. Advertisers use these pixels to measure which ads drove purchases.

A sales pixel for YouTube works the same way, but instead of tracking ad clicks, it tracks YouTube video clicks — connecting the click on a description link in a specific video to a subsequent purchase on your sales platform.

How a YouTube Sales Pixel Works (Step by Step)

  1. Viewer clicks a tracked link in a YouTube video description
  2. The tracking system creates a unique session ID and logs: which video, when, what device, what country
  3. The session ID is stored as a cookie or URL parameter and travels with the visitor as they browse your site
  4. The viewer reaches your sales page, considers your offer, and decides to purchase
  5. They complete checkout and land on your thank-you page
  6. The sales pixel on the thank-you page reads the session ID and sends it to the tracking system along with a conversion event
  7. The tracking system matches the session ID to the original video click
  8. Result: the sale is attributed to the specific YouTube video that initiated the journey

This entire process happens silently in under 100 milliseconds. The buyer sees nothing unusual. The tracking happens invisibly in the background.

What the RevData Pixel Looks Like

The RevData sales pixel is a single short JavaScript block:

<script>
(function() {
  var s = new URLSearchParams(window.location.search).get('rd_sid')
    || localStorage.getItem('rd_sid');
  if (s) {
    new Image().src = 'https://getrevdata.com/px/YOUR_CODE?rd_sid=' + encodeURIComponent(s);
  }
})();
</script>

This code checks two places for the session ID: first as a URL parameter (rd_sid in the page URL), then in localStorage (where it was stored when the tracked link was first clicked). If it finds a session ID, it sends it to RevData's server as a tiny image request — this is the "conversion event." RevData then matches this to the original click record and attributes the sale to the video.

Why the Pixel Goes on the Thank-You Page Specifically

The thank-you page or order confirmation page is the only page that buyers land on after completing a purchase. Non-buyers never reach this page. This makes it the perfect, precise location for a sales pixel — it fires once per purchase, only for actual buyers.

Common mistakes creators make with pixel placement:

  • Putting it on the sales page: Fires for every visitor including non-buyers — produces false "conversions"
  • Putting it on the checkout page: Same problem — fires before purchase is confirmed
  • Putting it on a general site page: No connection to purchase events
  • Forgetting to add it: The most common issue — link tracking works, but no conversion signal ever fires

The Pixel vs. Webhook: Two Ways to Track Conversions

For creators who can't add custom code to their thank-you page (some platform restrictions apply), there's an alternative: server-side webhook attribution. When a purchase is confirmed, your course platform sends a webhook (an automated server notification) to RevData with the buyer's session ID. RevData logs the conversion server-side rather than client-side.

This approach is more technically complex but works on platforms that don't allow custom HTML on confirmation pages. The pixel approach is simpler and works for the vast majority of course platforms — it should be the first option to try.

What Data the Pixel Collects

The RevData pixel collects only the information needed for attribution:

  • The session ID (connects the conversion to the original video click)
  • The page URL it fired on (confirms it fired on the right page)
  • A timestamp

It does not collect personally identifiable information, payment details, or any data outside of your own sales funnel. It's functionally limited to your own domain and your own buyer journey — this limits both privacy concerns and regulatory scope compared to third-party advertising pixels.

Frequently Asked Questions

Ready to see which videos make you money?

RevData tracks Revenue Per View for every video in your YouTube catalog.

Compare RevData vs YouTube Analytics, Hyros, and Retention Rabbit →

Related Articles