How to Track YouTube Videos in Google Analytics?

Sharing is caring!

Google Analytics is a free tool that can help you track the success of your website. Not only can you track how many people are visiting your site, but you can also find out where they are coming from and what they are doing while they’re there. 

In this blog post, we’ll show you how to track YouTube videos using Google Analytics. This will give you a better understanding of how people are finding and watching your videos and it can help you improve your video marketing strategy.

Let’s get started!

What is Google Analytics and what does it track for YouTube videos?

Google Analytics is a web analytics service offered by Google that tracks and reports website traffic, currently as a platform inside the Google Marketing Platform brand. Google launched the service in November 2005 after acquiring Urchin.

Google Analytics is now the most widely used web analytics service on the Internet. 10-15% of all websites use it to some extent, including many Fortune 500 companies and popular websites like TechCrunch, The Guardian, Huffington Post and Mashable.

Google Analytics can track various engagement metrics for YouTube videos, including:

  • Video views: How many times your video was watched
  • Play rate: How often your video was played relative to other videos on your channel
  • Average view duration: How long have viewers watched your video on average
  • Audience retention: How much of your video people watched on average

All of these metrics can be useful in understanding how engaging your video is and whether people are watching it all the way through. You can also use them to compare the engagement of different videos on your channel.

How to enable tracking for your YouTube videos in Google Analytics?

There are two ways to track your YouTube videos in Google Analytics:

1. Use the Google Analytics Tracking Code on your website

2. Use the _gaq global object

Use the Google Analytics Tracking Code on your website

To track your YouTube videos, you’ll need to add the Google Analytics Tracking Code to your website. You can find this code in your Google Analytics account under Admin > Tracking Info > Tracking Code.

Once you have the code, add it to the <head> section of your website’s HTML:

<script>

(function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[‘_gaq’]=i[‘_gaq’]||function(){

(i[‘_gaq’].q=i[‘_gaq’].q||[]).push(arguments)},i[‘_gaq’].l=1*new Date();a=s.createElement(o),

m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)

})(window,document,’script’,’//www.google-analytics.com/analytics.js’,’ga’);

ga(‘create’, ‘UA-XXXXXXX-Y’, ‘yourdomain.com’); // Replace with your own Tracking ID

ga(‘require’, ‘display features’);

ga(‘send’, ‘pageview’);

</script>

Replace UA-XXXXXXX-Y with your Tracking ID and yourdomain.com with the domain of your website.

If you’re using a content management system (CMS) such as WordPress, you can install a Google Analytics plugin to add the tracking code to your website automatically.

Use the _gaq global object

If you’re not using a website, or if you don’t have access to your website’s code, you can still track your YouTube videos in Google Analytics by using the _gaq global object.

To do this, create a file named ga.js and add the following code:

var _gaq = _gaq || [];

_gaq.push([‘_setAccount’, ‘UA-XXXXXXX-Y’]); // Replace with your own Tracking ID

_gaq.push([‘_trackPageview’]);

(function() {

var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;

ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;

var s = document.getElementsByTagName(‘script’)s ; s.parentNode.insertBefore(ga, s);

})();

Replace UA-XXXXXXX-Y with your Tracking ID. Then upload ga.js to your server and include it in the HTML of your YouTube video pages:

<script src=”/path/to/ga.js”></script>

When a user views a page that contains the ga.js file, Google Analytics collects the data and sends it to your Google Analytics account.

You can find more information about the _gaq global object in the Google Analytics Help Center.

There you have it! Two ways to track your YouTube videos in Google Analytics. Choose the method that works best for you and start tracking your video views today.

How to view the data that is tracked for your YouTube videos in Google Analytics?

To view the data that is tracked for your YouTube videos in Google Analytics, go to Behavior > Events > Top Events. You should see an event labeled “YouTube Video” with a category of “Videos” and an action of “Play.”

Clicking on this event will show you all of the data that is being tracked for your YouTube videos, including:

  • The number of times each video has been played
  • The average amount of time each video has been played for
  • The average percentage of the video that was watched
  • The number of unique viewers for each video

This data can be very useful in understanding how engaging your video is and whether people are watching it all the way through. It can also help you determine which videos are most popular so that you can create more content like them.

So there you have it! Two ways to track your YouTube videos in Google Analytics. Choose the method that works best for you and start tracking your video views today.

Also Read: What is the Google Ads exam and what is it for?

What can you do with the data that is tracked for your YouTube videos in Google Analytics?

There are several things that you can do with the data that is tracked for your YouTube videos in Google Analytics. Here are a few ideas:

  1. Use the data to understand how engaging your video is and whether people are watching it all the way through.
  2. Use the data to determine which videos are most popular so that you can create more content like them.
  3. Use the data to understand where your viewers are coming from so that you can target your marketing efforts more effectively.
  4. Use the data to understand what time of day people are most likely to watch your videos so that you can schedule your releases accordingly.
  5. Use the data to understand which devices people are using to watch your videos so that you can optimize your videos for those devices.
  6. Use the data to understand which countries your viewers are coming from so that you can target your marketing efforts more effectively.
  7. Use the data to understand what types of videos people are most likely to watch so that you can create more content like it.
  8. Use the data to understand what keywords people are using to find your videos so that you can optimize your titles and descriptions accordingly.
  9. Use the data to understand which channels people are most likely to watch your videos on so that you can create more content for those channels.
  10. Use the data to understand which social media platforms people are most likely to share your videos on so that you can promote your videos more effectively on those platforms.

This is just a small sampling of the things that you can do with the data that is tracked for your YouTube videos in Google Analytics. The possibilities are only limited by your imagination. So get out there and start tracking your YouTube videos today!

Wrap up

Tracking YouTube videos in Google Analytics is essential for understanding how users interact with your content. By tracking data such as play rate, watch time and drop-off point, you can get valuable insights into what’s working and what isn’t.

Luckily, setting up tracking is a relatively simple process. With just a few steps, you can start collecting data on your YouTube videos and using it to improve your marketing strategy. With this data at your fingertips, you can fine-tune your video marketing strategy for maximum ROI.

Sharing is caring!

Scroll to Top