How to Setup Google Analytics for your YouTube Channel – An Integration Guide

Google Analytics YouTube Channel Integration Guide

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.”

Google Analytics Admin menu

  • Click the dropdown menu under “Property”
  • Choose “Create new property”

Create new property menu

Fill in the corresponding information…

Google Analytics New Property 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.

Google Analytics Tracking ID page

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

YouTube Creator Studio menu dropdown

Now go to the “Channel” settings in the left navigation. Then click on “Advanced” to access the advanced settings.

YouTube Channel, 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.”

YouTube Google Analytics tracking box

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:

Send test traffic button

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.”

View Page Source on YouTube Channel

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

NOTE: You can skip this step. Currently, this data is not being reported on. It won’t hurt to enable it, but you won’t see any data at this time.

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.

Google Analytics property settings turned on

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.

Copy View button in Google Analytics admin

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

Google Analytics site search settings for YouTube channel

NOTE: Currently, Google is not reporting search queries in this way, but I’ll show you another way to see if people are searching within your channel.

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.

Google Analytics YouTube Channel filter

  • 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).

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.

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.
Google Analytics YouTube Acquisition Report
An example acquisition report on my YouTube channel
  1. Navigate to Acquisition > All Traffic > Channels
  2. Clicking on “Organic Search” will show a breakdown of specific search engines
  3. 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.

Google Analytics YouTube Source/Medium Report

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.

Google Analytics YouTube Real Time Report
An example real-time report for your YouTube channel
  • 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

Google Analytics YouTube all pages report

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).

Google Analytics YouTube New vs. Returning Visitors Report
New vs. Returning Users compared

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

NOTE: Google sets a 2-year limit on the cookie that tracks visitors. So if they have visited your channel from the same browser, within a 2-year time period, and have not cleared their cookies, they will be considered a returning visitor.

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.

Google Analytics YouTube Frequency Report
Example frequency report to gauge fan loyalty

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.

Google Analytics YouTube Geo Report
Example analytics report for metro areas

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.

Google Analytics YouTube Browser Report
Example browser report
  • 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 :-)

Google Analytics YouTube Benchmarking Report

  • 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.

4 Commentson "How to Setup Google Analytics for your YouTube Channel – An Integration Guide"

  1. /

    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.”)

    → Reply
    1. (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.

  2. /

    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.

    → Reply
    1. (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!

What Are Your Thoughts?

All fields are required. Your email will not be published.

You can use standard <code> and <pre> tags to post code examples, or a service like codepen.io.