Increase revenue from Joomla Websites

Analytics for Joomla provides resources to optimize and get insights for Joomla websites without knowledge of HTML

Tracking Youtube videos with Google Analytics

Youtube Google Analytics

We love to share videos in our blogposts, like we did in our blogpost about Google Remarketing in Joomla websites. Unfortunately, we have never been able to be sure if you actually use the videos we share in our blogposts. This is important to us, because we want to be sure the videos have value to you, our reader. That's why we decided to look for a way to track our embedded Youtube videos in Google Analytics.

Videos from YouTube embedded on our own site

YouTube lets us embed videos on our own site (our own videos, or anyone else’s as long as they have enabled embedding).

YouTube uses a Flash player to display these videos on your Joomla site, and you have basically no access to get inside that Flash Player and recompile it with Google Analytics Flash tracking.

A while back Youtube opened up its API to users, which makes it possible to track their videos embedded on you website, without having to add tracking code inside the video. For tracking Youtube videos and embedding them at the same time, we have developed a simple Youtube plugin for Joomla 1.5 websites.

Here's an example of the plugin, to see it in action.

The Youtube content plugin will use event tracking to add data to your Google Analytics account. The library we use monitors the embedded video and triggers the following events interface for event tracking Google Analytics:

  • Cued (video ready)
  • Play
  • Paused
  • Ended
  • Fast-Forward
  • Rewind
  • View-Range (how much of the video was viewed)

Youtube event tracking

In addition, you can also distinct different videos being tracked, as well as the length of view of the video.

How do I use the plugin?

Here's how it works:

  • Step 1: Download the plugin.
  • Step 2: Install it.
  • Step 3: Enable (publish) it.
  • Step 4: Go to and find a video that you want to embed.
  • Step 5: Copy the URL for that video from your browser bar.
  • Step 6: Paste the URL into your content item. Repeat steps 4-6 for as many videos as you wish to embed.

Download the plugin

We have made this plugin available to download for free. Keep in mind that this plugin only tracks Youtube videos embedded on your website, not on your Youtube channel. It will only track videos if you added the normal Asynchronous Google Analytics tracking code to your website. You can add the general Google Analytics trackingcode with our Google Analytics plugin for Joomla.

Special Credits

The content plugin is a combination of several existing techniques, combined by Analytics for Joomla. The Youtube tracking script was developed by web analytics experts from Direct Performance. The Joomla plugin framework was developed by Joomla expert Cory Webb.

Share your comments