YouTube provides rather extensive analytics on their own, but if you set up Google Analytics for your YouTube channel, you can learn even more information about your subscribers.
I’ll walk you through the steps to integrate Google Analytics with your YouTube channel. In this guide, you’ll learn:
- basic setup to start tracking your YouTube channel in Google Analytics
- further configuration you’ll want to set up to get the most out of your data
- the reports & data that you’ll now have access to, and why it matters
Google Analytics Data on your YouTube Channel
Before I show you how to set things up, it’s important for you to understand why you’re doing this. YouTube’s Analytics already provide you with a lot of information about your videos. And truthfully, you’ll get much more specific data from YouTube than you will Google Analytics. Here’s a quick breakdown of the different types of data that each platform provide.
YouTube Analytics provides…
- individual video engagement metrics (views, watch time, likes, shares)
- playlist engagement metrics
- revenue data (channel-wide, per video, different ad types, etc.)
- subscriber metrics (new subscribers over time, subscriber demographics, etc.)
- video comparisons (view performance metrics of 2 videos side-by-side)
- annotations, cards & end screen metrics
Google Analytics provides…
- data about your channel’s main page (
youtube.com/[yourchannelname]
)- how people arrived on your YouTube channel (i.e. Acquisition)
- are they new or returning visitors
- what parts of your channel they are viewing (all videos, playlists, discussion, search)
- where your visitors are located (country, region, state, city, etc.)
Basically, setting up Google Analytics for your YouTube channel is like treating your main channel page as if it were a website, and then tracking that website with Google Analytics.
With that being said, a comprehensive analytics solution would include both YouTube Analytics & Google Analytics.
01 Setup a Google Analytics Account
Obviously, the first step is to set up a Google Analytics account. I suspect most of you already have one, but if not, here’s a video on how to do that.
02 Create a New Web Property
Each website (or domain name) that you track in Google Analytics should have its own “property.” So you’d have one “account” for your company, but if your company operates 3 different sites, each site would get its own “property.”
- Login to analytics.google.com
- Click “Admin” at the bottom of the left-hand navigation
- Click the dropdown menu under “Property”
- Choose “Create new property”
Fill in the corresponding information…
For “Website Name,” I recommend something like “{Your Channel Name} YouTube Channel,” so you can easily tell it apart from other websites you are tracking.
For “Website URL,” enter your YouTube channel’s URL (https://www.youtube.com/{yourchannelurl}
). Change the prefix to https, but just enter www.youtube.com/{yourchannelname}
in the box.
Choose the appropriate category & time zone that make sense for you.
After clicking the “Get Tracking ID” button, you should land on the Tracking Code page. It will look like this.
Copy your Tracking ID. It will start with “UA-” and look something like this: UA-12345678-2
It’s important to make sure you use the tracking ID that you just set up, specifically for your YouTube channel. If you make a mistake and include the tracking ID for one of your other websites, you’ll have some messy data to comb through next time you look at your website’s reports. Not the end of the world, but please be careful.
03 Add Tracking ID to YouTube
Now head over to your YouTube channel. Make sure you’re logged into the channel that you want to add Google Analytics to.
- Click the icon in the top-right corner of the screen to open up a menu
- Click the “Creator Studio” button
Now go to the “Channel” settings in the left navigation. Then click on “Advanced” to access the advanced settings.
Scroll down to the bottom until you see a field for “Google Analytics property tracking ID.” This is where you’ll paste the Google Analytics Property ID that you copied in the previous step. When you’re done, just click “Save.”
04 Check Tracking is Installed Properly
There are two ways to check that you have installed Google Analytics on your YouTube channel properly.
1. Send test traffic
From the Tracking Info > Tracking Code page in the admin area, there is a button at the top labeled “Send test traffic.” Click this button to send a test visitor to your page and see if Google Analytics recognizes it. If they do, you’ll see the result printed on the page, like this:
2. Check the source code of your YouTube channel
If you’re a little more tech savvy, or would like to check another way…
Navigate to your YouTube channel’s main page, www.youtube.com/{yourchannelurl}
Right click anywhere on the page (but not on a video), and choose “View Page Source.”
Then do a Find (CTRL or CMD + F) and search for analytics.js. You should find code that looks like this:
<script async src="https://www.google-analytics.com/analytics.js" name="ga-analytics"></script>
<script>
window.ga=window.ga||function(){(
ga.q=ga.q||[]).push(arguments)};
ga('set', 'page', window.location.pathname);
ga.l= new Date;ga('set', 'forceSSL', true);
ga('create', "YT-12345678-2", 'auto');
ga('send', 'pageview');
</script>
The YT-12345678-2
part of that code should correspond to your Tracking ID. The numbers should be exactly the same, but your Tracking ID will start with UA instead of YT. Everything is good to go as long as the numbers after YT-
match up.
Technically, that is all you need to do to set up Google Analytics for your YouTube channel. However, I highly recommend the following Google Analytics configurations to make sure your data remains accurate.
It could take 24-48 hours for data to appear in Google Analytics, so please be patient if you don’t see anything right away.
05 Google Analytics Property Settings for YouTube Channel
Navigate back to the admin area of Google Analytics.
- Choose your YouTube Channel Property
- Click “Property Settings”
- Scroll down to “Enable Demographics and Interests Reports,” and toggle that to ON
- Right under that is “Use enhanced link attribution.” Toggle that ON as well.
06 Google Analytics View Settings for YouTube Channel
Now it’s time to make a few modifications to the Views. Views represent different ways to look at the data on one of your Properties. It is a best practice when setting up any Google Analytics Property to create at least 2 views:
- 1 master view with raw, unfiltered data
- 1 filtered view to remove spam & other inaccurate data
The master view always contains a complete, untouched view of your entire dataset. You can always refer back to it if you need to.
The filtered view is what you’ll actually use to view your reports. This view ensures only the correct data is included, and can make some modifications on how you want to track certain things about your Property.
Rename your default View
By default, Google Analytics named your View “All Website Data.” I like to rename this to “YouTube Channel – raw,” indicating that it’s the raw, untouched data.
Create a second View
This is the view we’ll use for reporting purposes.
From your “YouTube Channel – raw” View, click the “Copy View” button in the top-right.
Rename this view “YouTube Channel – custom” or “YouTube Channel – reporting.” Just make sure you know what it means.
Reporting View Settings
Now let’s adjust a few settings.
- Check the box under Bot Filtering to Exclude all hits from known bots and spiders
- Scroll down to Site Search Settings
- Toggle Site Search to ON
- And for Query parameter, enter
query
into the box - Click Save when you’re finished
07 Create a Filter for YouTube Channel Only
The final thing I recommend is to add a filter to your reporting view. Make sure you’re on your reporting view and not your raw view.
The reason to use a filter is just in case your tracking code (meaning, your specific Property ID code) ends up on someone else’s page—either by accident, typo or spammers use it to try and mess with your data—this filter will prevent any data from being reported.
- Click on Filters in the left navigation
- Click the Add Filter button
Filter Name: Include Traffic Only – from YouTube.com domains
Filter Type: Custom, Include
Filter Field: Hostname
Filter Pattern: m\.youtube\.com$|www\.youtube\.com$|youtube\.com$
Essentially, the filter says: Before we send any data to Google Analytics, check the domain name of the page. If it starts with m.youtube.com, youtube.com or www.youtube.com, then go ahead and report it. If not, then don’t report it.
I included both the www and non-www versions, just in case YouTube ever decides to change things up. And the m.youtube.com part is for people viewing your channel in a mobile browser (this does not include channel views on the YouTube iPhone or Android apps).
And now you’ve set up Google Analytics for your YouTube channel in the most thorough way possible.
If you have any questions, or additional setup tips that I missed, please let me know in the comments.
08 Google Analytics Reports for your YouTube Channel
It’s been almost two weeks since I set this up myself, so I have some initial data. Let’s take a look at some reports you can use to gather additional information about your YouTube channel visitors.
08a Acquisition: How are my visitors finding me?
You might be interested to see how your visitors are getting to your YouTube Channel. Google Analytics refers to this as Acquisition, and places visitors in a handful of different buckets including, but not limited to:
- Direct – directly typing in your channel’s URL in a browser
- Organic Search – via search engines like Google, Bing or Yahoo
- Referral – via other websites that link to your YouTube channel
- Email – via email marketing or other newsletters
- Social – via social media networks like Facebook, Twitter, Instagram, etc.
- Navigate to Acquisition > All Traffic > Channels
- Clicking on “Organic Search” will show a breakdown of specific search engines
- Clicking on “Referral” will show a breakdown of specific websites sending traffic to your page
You can also go to Source/Medium to quickly see specific search engines & referral websites all in one place. Mine is pretty bare at the moment because no one has found me through another website yet. “analytics_test” and “analytics.google.com” are both my own traffic.
08b Real-Time Traffic
Who is visiting your YouTube channel right now?! YouTube Analytics does offer some real-time data about your videos, however it’s fairly basic. Most of the data is on a 1-2 day delay. But Google Analytic’s real-time data will show you how many people are on your channel pages right this second, how they got there, and which pages they’re browsing. On one hand, you get more in-depth data, but on the other, you get it for far fewer pages.
Remember, this just relates to your channel pages (home, videos, playlists, discussion, about, etc.), not video watch pages, but it could still be helpful.
- Navigate to Real-Time > Overview
- You can drill-down further by clicking on any of the links on this page
- Locations will show you where the visitors are located geographically
- Traffic Sources will show you how the visitors arrived at your channel
08c Pages: Which pages on your channel are people viewing?
The Google Analytics tracking script fires on a handful of pages, not just your main channel landing page. It also tracks visitors on the following pages:
- All Videos
youtube.com/{yourchannel}/videos
- Playlists
/playlists
- Channels
/channels
- Discussion
/discussion
- About
/about
- Search
/search
It could be helpful to see if visitors are interested in these other areas of your channel, and if so, perhaps you pay a little more attention in regards to optimizing them.
- Navigate to Behavior > Site Content > All Pages
- Use the search/filter box to find & consolidate certain pages
Search Data
I suspect very few people are using your channel’s specific search feature. Most probably use the main YouTube search bar at the top of the page. But this report is also where you can see if people are searching for videos on your channel specifically. These will all start with /search
and typically have a few query parameters appended to the URL.
The user’s search terms are the ones immediately following ?query=
.
Duplicate & Mysterious Pages
In the screenshot above, you’ll notice some strange URLs. The ones with the asterisk (*) by them are all actually the same page. YouTube has several URLs that all pull up your main channel page. There are some filters you could create to combine these, but I’m choosing to leave them alone for now.
I can’t explain /user/adampayne75
and /user/jigsawAcademy
. If you have any ideas, I’d love to hear them.
Other Uses
You can also see how people are using the sort feature on your all videos page by searching for the following query parameters:
- sort=p means they sorted by “Most Popular”
- sort=da means they sorted by “Date Added (oldest)”
- sort=dd means they sorted by “Date Added (newest)”
Once you start to receive a substantial amount of traffic, it might be worth taking a look through the Pages report.
08d New vs. Returning Visitors
YouTube Analytics provides some useful data on how subscribers vs. non-subscribers interact with your videos. However, Google Analytics can help fill the gap because they can distinguish between someone who has visited your channel before vs. someone who hasn’t (regardless of whether they have subscribed or not).
Example: You might notice you’re getting a high number of returning visitors to your channel, and a disproportionately low number of new subscribers. Perhaps you try creating a channel trailer video that encourages folks to subscribe. You also might want to encourage people to subscribe at the end of your videos.
- Navigate to Audience > Behavior > New vs Returning
08e Frequency of Visitors (aka: Loyalty)
This report goes into a little more detail than new vs. returning visitors. It will show you how many total sessions occurred where it was the person’s first time visiting. Then, how many total sessions occurred where it was the person’s 2nd time visiting. Then, sessions for a person’s 3rd time on your page. Et cetera.
This helps you understand if you have loyal fans, or if a majority of the traffic on your channel is comprised of first-time visitors who never return.
08f More Detailed Geographic Info
YouTube Analytics provides a fair amount of geographical data, but they don’t go into as much detail as Google Analytics. For example, in most YouTube Analytics reports, you can drill-down to see U.S. state info, but that’s as local as it gets. And for other countries, the geo data stops at the country level.
Google Analytics goes deeper. You can see which cities and metro areas are viewing your YouTube channel.
If you run a small, local business in California, it will be of no surprise that 95% of your video views come from people in California. YouTube can tell you that. But if you want to see how San Francisco differs from Los Angeles, you can see that in this report.
- Navigate to Audience > Geo > Location
- It will default to the Country view
- Clicking on a country will show you the State/Region level
- Clicking on a State/Region will show you City level
08g Browser Information
YouTube provides device information (desktop vs mobile vs tablet), as well as operating system (Windows vs Mac), but they don’t provide any stats on which browser people are using. Google Analytics fills that void.
- Navigate to Audience > Technology > Browser & OS
- Clicking on a browser will show you the specific version number
08h Benchmarking Data
This is probably one of the least useful pieces of data, but it could help someone, so I’ll include it. This report shows you how your data stacks up against similar websites of the same size, in the same industry. Keep in mind you’ll be comparing your YouTube channel page(s) against other actual websites, so it’s not really a fair comparison. But it could give you a nice ego boost if you’re outperforming a majority of real websites in your industry :-)
- Navigate to Audience > Benchmarking > Channels
- This shows how you compare to others in your industry, in terms of your traffic sources
Examples: Is your Referral number in the green? That means you’re doing a great job of getting other sites to link to your channel. If your Email number is in the green, it could mean your email newsletter is getting a lot of clicks to your channel; more so than other websites are receiving through their email marketing efforts.
Shout out to Klipfolio for providing some ideas on which reports to explore.
In summary, I hope you learned a few things about how to use Google Analytics & YouTube together to create a more complete data profile about visitors to your YouTube Channel. Did I leave out any reports? Do you still have questions? Please let me know in the comments.
JD / #
This is a super helpful article, thanks so much for posting.
In testing “Site Search” for my YouTube property, I am finding that only about 1 out of every 25+ searches (/search?query=) is recognized and listed in GA (under Site Search/Search Terms, and Site Content/All Pages). The view has Site Search on and the query parameter listed as “query”.
I’ve tried searches while logged in, logged out, and tried multiple users in geographically diverse locations, but no real luck. (The /search page visits appear to be recorded fine.)
Is there anything else obvious I should check to figure out why it’s not picking up most of our channel’s searches (while picking up a random very few)?
The channel has low traffic and is set for high precision accuracy, so (if I understand correctly) sampling should not be an issue. (GA indicates “This report is based on 100% of sessions.”)
Dave Warfel (Author) / #
Thanks for the feedback, JD. Glad it was helpful.
I’m still trying to figure out how Google is collecting data on search myself. I think I’m experiencing something very similar.
When I go to Site Search, I see ZERO searches. No data at all. That’s why I put that note in there that says Google is not tracking searches this way.
Under Site Content > All Pages, when I filter for the word “search,” I see a handful of pageviews. However, most of them are for
/user/wpsmackdown/search
, and do not have any query attached to them. I’m not sure how that’s possible. I don’t know how one gets to the/search
page without typing in a query.I have 16 pageviews to my search page with no query. And only 1 pageview to the search page that does include a query. Unfortunately, I can’t explain that.
If I figure it out, I’ll update this article and make a note in the comments.
JD / #
Hi Dave, good stuff.
Sounds like it may even thornier, seeing that there is a mismatched 1 Site Content>All Pages entry vs. 0 Site Search>Search Terms entries.
So far here the once-in-a-blue-moon query entries recorded in Site Content>All Pages have a correct corresponding search term entry in Site Search>Search Terms, but it’s not a ton of data yet.
I’m gonna keep trying to identify if a particular combination of actions is consistently triggering the (infrequent) data points, or if I also get to the point where there are mismatched entries.
Good luck on your side.
Dave Warfel (Author) / #
Interesting that you’re getting data in Site Search > Search Terms. I’m both jealous and curious :-)
If you come upon any enlightening discoveries, and you can remember to come back and share, I’d very much appreciate it. I’ll update the article and give you a shout out.
Thanks JD!
COFL / #
“As of May 2017, the mobile version of YouTube does not implement the Google Analytics code, so you will only see data from desktop visitors.”
Thank you. This is the first place I’ve seen this mentioned. We have a YouTube page and our videos are viewed primarily (80+%) using the YouTube app on phones.
Curious where you found out that mobile devices wouldn’t work, and if they have a timetable for changing that.
Thanks
Dave Warfel (Author) / #
Good question. First off, let me be clear about what I mean when I say “the mobile version of YouTube.” I’m referring only to the mobile WEB version located at m.youtube.com (not the YouTube app).
Also, the data that you get from adding Google Analytics to your YouTube channel is only for visits to your actual channel page (www.youtube.com/user/yourchannel). It will not report on any data about video views. All of your actual video analytics will be reported in YouTube Analytics (https://www.youtube.com/analytics).
The way I found out that Google Analytics data wasn’t being reported for mobile devices was two-fold:
However, now I do see a few visits categorized as coming from “mobile,” although 90% are still from desktop. And when I try to view the mobile device info, it says “(not set).” This likely means it’s an obscure device that Google doesn’t know about.
Let me know if you have any further questions.
Kelly Simba / #
Hi, Thanks for all your help. I wanted to know how i can track the videos viewed on GA and not only the channel
Dave Warfel (Author) / #
Hi Kelly — If you use GTM (Google Tag Manager), there is built-in tracking. You just have to go through the Tag Manager options to locate it.
If you’re not using GTM, here’s an article which might help. It’s a little outdated but could still do the job. Lunametrics are one of the best companies when it comes to Google Analytics tips & tricks, so I trust their code.
Rachael / #
Any chance you could explain why a mobile user wouldn’t show up on the real time data charts?
Thank you
Dave Warfel (Author) / #
Hi Rachael — Yes, because the Google Analytics code only gets added to the desktop version of youtube.com. When someone uses the mobile app, YouTube does not place the Google Analytics code within the app, so there’s no way to track YouTube app users. I believe the same thing applies even for YouTube’s mobile version (m.youtube.com).
It’s just the way YouTube has decided to implement the Google Analytics integration. I don’t believe there’s anything we can do about it. But the stats you get in YouTube Studio are WAY better than anything you’ll get from this GA integration.
Mathala / #
The tracking code is set up correctly (I verified the source code as well) but GA is tracking only internal traffic to my youtube channel. Anyone who visits the page externally, is not getting tracked. Even real time is not showing it. The property view is default “All Website Data”. What might be the problem?
Dave Warfel (Author) / #
Mathala — What do you mean by “Internal” traffic? Are you referring to yourself when you visit your YouTube page?
If “External” traffic refers to when others when your page, are you positive that others are actually viewing it?
Keep in mind, this only tracks your main youtube.com/username homepage. It will not track any of your individual video pages.
Mathala / #
myself when i visit the page from same computer or when i try “test traffic” it is working (this is what i meant as internal). Same link when i try from my team mate’s computer, it is not tracking (i meant as external). No filter is added and default view is “All Website Data”
Dave Warfel (Author) / #
Can you post the exact URL of the page you are viewing from your teammate’s computer? And what type of computer does he/she have? Is it a desktop, laptop, tablet, mobile, etc.?
Mathala / #
https://www.youtube.com/channel/UCO_qVjyCCorGLTN-ZAZnn9g
For my testing purpose, my team mate viewed the page from desktop and is not getting tracked in GA. If I click on the same link, its tracking fine. Only for my internal traffic it is working!
Dave Warfel (Author) / #
Not sure why your teammate is not being tracked. I see the tracking code on the page. I would ask your teammate to view the source code of that page, and look for this:
analyticsId":"YT-126445028-1"
If that code is present, it means tracking should be working properly. If not… sorry, but I have no idea why. As long as he’s on desktop and viewing the exact URL you listed (not a mobile version), then tracking should be working.
Julie Sharma / #
I had a YouTube Channel successfully getting data up until about a week ago. Now it’s no longer registering any visits to any part of the channel (playlists, about, etc.). In trying to resolve this, I’ve tried so many different configurations (different versions of the YouTube Channel URL, different accounts/properties) that I don’t know what was originally in Google Analytics, but do you have any ideas why Analytics would have stopped capturing visits? Does the version of the URL I use (www.youtube.com/user/{channelname} vs http://www.youtube.com/{channelname} vs http://www.youtube.com/user/{channelid} vs http://www.youtube.com/{channelid} vs http://www.youtube.com/c/{customurl} ) matter?
More on my setup
-YouTube Channel is from a @gmail.com account
-Google Analytics was/is set up in @___.edu account (prior to last week, it was registering visits set up this way)
-The correct analyticsId shows up in the view source (channel https://www.youtube.com/user/DoITTraining)
Dave Warfel (Author) / #
Julie, thanks for providing all this info. Right now, I don’t know why data would’ve stopped.
I’ll have some time tomorrow to take a look at this for you and see if I can figure something out as to what’s going on.
Julie Sharma / #
I fixed the issue. Here’s what I did:
1) I used the Google Tag Assistant extension recordings function to record what was triggering on the Channel and followed its recommendation:
a) For error “Missing HTTP Response to remove the Tracking ID, save the page, and then re-add the tracking ID.
b) I also learned that I had Google Analytics blocking enabled in Chrome (I had tested in other browsers and incognito previously, so this wasn’t the only issue)
If anyone else is having issues, check out the Google Tag Assistant
Dave Warfel (Author) / #
Julie, thanks for checking back in and providing your solution. Much appreciated!
I just got my computer back from a repair, and Apple wiped the hard drive (unexpectedly), so I’m transferring a bunch of data/settings back over now. That’s why I wasn’t able to take a look. But I’m really glad you got it resolved, and hopefully help others in the future whom have the same issue.
Enjoy the rest of your week :-)
Liquid Ocelot / #
I followed the guide but i cannot see any data in real time analytics, under page view source i can see the tracking id as i sent a tracking code and some how i see “One Active User” how much time would it take to give me real time analytics on my google analytics pls help i just did all the procedure according to guide please help me.
Dave Warfel (Author) / #
If you yourself are viewing your YouTube channel page, and you see “One Active User” in the real-time analytics, that makes sense. That one user is you.
Keep in mind, this only works for your channel homepage, and NOT all your video pages. I would check back now and look at ALL of your data, not just the real-time report, and see if you have a handful of users. If so, then it’s working.