This example shows how to enable the Google Analytics Tracking feature using the XML playlist. Please note that you must set up a Google Analytics account and implement the tracking codes on each page that you want to track. We cover the basics of setting up the tracking codes in a webpage, but if you are not familiar with Google Analytics, you should expect to use the Google Help tools to learn more about their system and how it should be implemented (link to Google Analytics). This example utilizes the default MP3 Player with the playlist component, title text, all controls, and FlashVars are used to pass the path for the XML playlist.
- Set the "googleTracking" parameter to "true" in the XML - link to example.
- Add the <googleTracking> node to the XML. For example, if your XML nodes read:
the start events generated by the MP3 player will be logged as though they were pageviews of "/tracks/song1". The arguments must begin with a forward slash as shown. The event names may be organized into any directory style structure you wish, and actual pages with these filenames need not exist - link to example.
- The following Analytics tracking code must be placed in the <body> of your HTML code above the scripts used to embed the MP3 Player (note: you will need to substitute your account number for the x's):
_uacct = "xx-xxxxxxx-x";
- You can check your Google Analytics Top Content report 24-48 hours after the updated tracking code has been executed. You should be able to see the assigned pagenames in your report.
:: Click here to download example files