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.
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.
Tools in this note
- YouTube
- Stripe
Names and marks belong to their owners. Showing one does not mean they endorse us.
On this page
- The idea in one picture
- Step 1: one link for each video
- Step 2: save the id when they land
- Step 3: hand the id to checkout
- Step 4: read it back
- The full test, in ten minutes
- A full example, from upload to payout
- Match the sales you would have lost
- Edge cases you will meet
- What to look at each week
- What can go wrong
- When not to use Totems
- Sources
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.
Video
Link in the description
/price
Click
Link service adds an id
?tm=c_8Kq2
Your page
Script saves it, with consent
v_51Xa
Checkout
Passed on the link
client_reference_id
Payment
Read it back
v_51Xa
Step 1: one link for each video
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
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.
<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.
https://buy.stripe.com/YOUR_LINK?client_reference_id=v_51XaTwo 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
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.
| Check | How | Pass if |
|---|---|---|
| The link works | Click it from a phone | You land on the right page |
| Tags survive | Look at the address after all redirects | The tags are still there |
| The id is saved | Say yes to cookies, look in browser storage | One random id |
| No means no | Say no in a new window | No id saved |
| The form has it | Send a test form | The hidden field is filled |
| Checkout has it | Look at the Stripe address | client_reference_id is there |
| Payment has it | Open the test event | The 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.
| Video | Description link | Pinned 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
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.
| Sale | What we had | Joined by | Trust |
|---|---|---|---|
| 1 | Same browser all the way | Visitor id | High |
| 2 | Same browser all the way | Visitor id | High |
| 3 | Form on a phone, paid on a laptop | Email used in both | High |
| 4 | Same browser, 23 days later | Visitor id | High |
| 5 | Paid from a link in a chat | Nothing | Unknown |
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.
- Clicks by video. Any link at zero is broken or missing.
- Forms by video. Many clicks and no forms means the page is wrong for that audience.
- Calls and sales by video.
- The Unknown share. If it jumps, a page has lost its script.
- 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.exampletowww.studio.exampleand 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.