Google Translate

Sunday, July 04, 2010

HTML5 media tracking - proof-of-concept with Google Analytics

HTML5 introduces new video and audio tags to allow you to embed multimedia content in your website. These content -- collectively called "media" -- can be played natively within HTML5-compatible web browsers, i.e. without any plug-ins, like Flash. Apple has been making a lot of noise about HTML5's capabilities, and some folks are warming up to the idea.

If you're a marketer or just interested in knowing how well your website is being used, then you'd also want to know whether your website visitors are using your HTML5-based videos or audio files.

To achieve web analytics tracking for HTML5 media, I've written a script that, for now, sends tracking information to Google Analytics. Take a look at my HTML5 media tracking proof-of-concept here. While crude, it works well in showcasing my tracking code's capabilities.

I've tested my proof-of-concept in Firefox, Safari, Chrome and Opera on my Mac. All of these browsers send the tracking information successfully.

I'm currently working on fine-tuning the code and adding Omniture tracking as well. As with most of my programming work, this HTML5 media tracking is open source under the GNU Public Licence version 3, so anyone can use and modify it.

Try out my HTML5 media tracking proof-of-concept and let me know your comments about it!