Skip to main content

How to track which YouTube video made a sale

Give each video its own link, carry one id to checkout, and read it back on the payment. A full test you can run with Stripe in test mode.

Written by
The Totems team
Published
Updated
Reading time
8 minutes

Short answer

Which YouTube video led to a sale?

Give every video its own link. When someone clicks, save one random id. Carry that id through your page, form and checkout, then store it on the payment. Open any sale, read the id, and you have the video. Sales with no id should be counted as Unknown, not guessed.

Who this is for. Creators and coaches who sell from their own site or a Stripe page, and want to know which video to make next.

On this page

YouTube knows who watched. Stripe knows who paid. Neither knows about the other. All the work is in carrying one small id from the first place to the second.

The idea in one picture

Follow the id, not the person. If the id reaches the payment, you know the video. If it stops anywhere, that sale becomes Unknown.

  1. Video

    Link in the description

    /price

  2. Click

    Link service adds an id

    ?tm=c_8Kq2

  3. Your page

    Script saves it, with consent

    v_51Xa

  4. Checkout

    Passed on the link

    client_reference_id

  5. Payment

    Read it back

    v_51Xa

Figure 1The id has to survive every step. Each box shows what must still be there.Made-up example

If ten videos share one link, you can only count all ten together. So make one link per video and place. Keep names short and the same shape every time.

The cheap version is a tagged address. Google Analytics says to always set source, medium and campaign, and it treats YouTube and youtube as two different values. So use small letters only.

https://studio.example/apply?utm_source=youtube&utm_medium=video&utm_campaign=price-a-project&utm_content=description

https://studio.example/apply
The page people land on
?utm_source=youtube
The site they came from
&utm_medium=video
The kind of post
&utm_campaign=price-a-project
The video, always in small letters
&utm_content=description
The place: description or pinned
Figure 2A tagged link for one video. The last tag says where in YouTube the link sits.Made-up example

Step 2: save the id when they land

Read the tags as soon as the page opens, before any redirect. If the visitor agrees to be tracked, keep a random id in a first-party cookie. If they say no, don't. Their visit just won't be joined.

Then put the same id into a hidden field on your form.

A hidden field, filled by your script
<input type="hidden" name="visitor_id" value="v_51Xa">

Step 3: hand the id to checkout

For a Stripe Payment Link, add the id to the address. Stripe sends it back in the checkout.session.completed event.

Payment Link with an id
https://buy.stripe.com/YOUR_LINK?client_reference_id=v_51Xa

Two things to know. First, UTM tags on a Payment Link only come back if the link redirects to your page after payment. They are not saved on the payment for you. Second, Stripe does not copy metadata from one object to another by itself, with a few named exceptions. If you need the id on the payment, set it on the payment too.

Step 4: read it back

Make a test payment. Open the event in Stripe and look for the field.

checkout.session.completed

amount_total
200000
currency
usd
client_reference_id
v_51Xa
payment_status
paid
livemode
false
Figure 3What you want to see on the finished checkout. The marked line is the whole point.Made-up example

Now look up v_51Xa in your own list. It belongs to a click on 18 November, from the link /price, in the description of one video. That video started this sale.

Views tell you who looked. An id tells you who paid.

The full test, in ten minutes

Run this once for your own setup. Do it in a private window, with Stripe in test mode.

CheckHowPass if
The link worksClick it from a phoneYou land on the right page
Tags surviveLook at the address after all redirectsThe tags are still there
The id is savedSay yes to cookies, look in browser storageOne random id
No means noSay no in a new windowNo id saved
The form has itSend a test formThe hidden field is filled
Checkout has itLook at the Stripe addressclient_reference_id is there
Payment has itOpen the test eventThe same id comes back

A full example, from upload to payout

Meet a made-up channel. It sells one $2,000 programme. In November it posts three videos. Each one gets a description link and a pinned link, so there are six links in all.

VideoDescription linkPinned link
Pricing a project/price/price-pin
Plan a week/week/week-pin
The $90 desk/desk/desk-pin

Over the month, 2,956 people click. 41 send the form. Twelve book a call. Five pay. Here is where the five came from.

Clicks

The $90 desk
1,406
Plan a week
908
Pricing a project
642

Sales

Pricing a project
3
Plan a week
1
Unknown
1
The $90 desk
0
Figure 4Clicks and sales point in opposite directions. One sale has no id, so it stays Unknown.Made-up example

The desk video got the most clicks and no sale. Pricing got the fewest clicks and three sales. That is a useful hint, and it is still only five buyers. The honest next step is to make one more pricing video. It is too early to delete the desk one.

Now split the pricing clicks by place. The description link had 590 and the pinned link had 52. Two of the three buyers used the description. So for this channel, the first lines of the description do the work.

Match the sales you would have lost

Out of five sales, three matched by id and one by email. The fifth did not match. This is how each one was joined.

SaleWhat we hadJoined byTrust
1Same browser all the wayVisitor idHigh
2Same browser all the wayVisitor idHigh
3Form on a phone, paid on a laptopEmail used in bothHigh
4Same browser, 23 days laterVisitor idHigh
5Paid from a link in a chatNothingUnknown

Sale 3 is why the form matters. The phone had the id. The laptop didn't. The email is the only bridge. If you give away a free guide for an email, you build that bridge early.

Sale 5 is why Unknown matters. A friend may have sent it. If you gave it to the top video anyway, the report would look better and be wrong.

Edge cases you will meet

  • They click two videos. Save both clicks. The credit rule decides later. First click asks what brought them in. Last click asks what came right before.
  • They click the same link five times. That is one interest, not five. We count clicks on one link within 30 minutes as one.
  • You click your own links. Use a private window and a test mode, or your own visits become your best audience.
  • A bot opens the link. Chat apps open links to draw a preview. A good link tool leaves those out.
  • They pay in parts. Keep the first payment's id on the whole plan. Otherwise the later payments look like new Unknown sales.
  • They ask for a refund. Take it off the same video. A video that brings refunds is not a winner.
  • The video is embedded on a blog. The click still comes from your link, so it still counts for the video. You just can't see the blog.

What to look at each week

Don't stare at it daily. Five sales a month can't speak every day. Once a week, write five lines.

  1. Clicks by video. Any link at zero is broken or missing.
  2. Forms by video. Many clicks and no forms means the page is wrong for that audience.
  3. Calls and sales by video.
  4. The Unknown share. If it jumps, a page has lost its script.
  5. One thing to try next week.

After three months you will have enough to see which kind of video starts sales. Write your rule down before you look, such as "I make more of any topic with five or more sales." Otherwise you will pick the story you like.

What can go wrong

  • A redirect eats the tags. Many sites send studio.example to www.studio.example and drop everything after the question mark.
  • They come back later. Someone watches on Monday, leaves, and types your address on Thursday. Without a saved id there is nothing to join.
  • They change device. They watch on a TV and buy on a laptop. Only a shared email can join those.
  • A wrong character. Put a space or a dot in the id and Stripe drops it without an error.

A worked example of reading it wrong: say two videos have 3 and 2 matched sales. That is not proof the first is better. With five sales, one lucky buyer changes the order. Wait for more before you pick a winner.

When not to use Totems

If you sell one product from one video, a single tagged link and a sheet are enough. If all your sales happen inside another platform's checkout that can't carry an id, no link tool can see them. And if your buyers never click, ask them "what made you get in touch?" It beats any script.

If you do want it done for you, $99 a month covers the links, the script and the matching. The Stripe connection is built and not yet tested with live accounts. We say so on the feature page.

Sources

  1. Stripe: Track a payment link (client_reference_id and UTM codes)Checked
  2. Stripe: Metadata limits and where it is copiedChecked
  3. YouTube Help: Sharing links with your audiencesChecked
  4. Google Analytics Help: URL builders and UTM valuesChecked
Read as MarkdownFound a mistake? Tell us: Rewritten with a full test, every field, and sources we checked.
Questions

More questions.

Can't find it? Ask us.

Can YouTube Studio tell me which video made a sale?

Not for a sale on your own site. YouTube knows about views on YouTube. Your payment tool knows about payments. You need an id that travels between them.

Do I need a different link for the pinned comment?

It helps. Use one link for the description and one for the pinned comment, both tied to the same video. Then you can see which place works.

Can I do this without any paid tool?

Yes. Use tagged links, a hidden form field and Stripe's client_reference_id. You do the joining by hand in a sheet. It works well up to about a few dozen sales a month.

Will this find sales from before I set it up?

No. You can bring in old payments, but the old clicks were never saved. Start the clock on the day you add the links.

Next note

No. 02

Why UTM tags alone can't tell you which post made money

UTM tags mark a click, not a person. Five common paths where they lose the sale, each one you can repeat yourself, and what to add.

Payments and StripeNo. 03

How to connect Stripe payments to your content

6 minute read

Put one link in your next post and follow it. 7 days free.

Start free trialView demo