Google Analytics integration
On the Overview of your site in Google Analytics you see the account number (also known as a Tracking ID or Urchin ID) you need to use for this site (UA-xxxxxx-xx). If you register subdomains, they will automatically get a different Tracking ID, which you can specify in the Metadata of the (child) Publication. When you press the Edit button on the specific site, you can see its profile. On the profile page you will find teh Google Analytics Profile ID, which you need to use as the Site ID. This will be used to directly you to the correct profile in case you have multiple websites registered in Google Analytics.
This eXtension comes with full source as a Microsoft Visual Studio solution which you can directly compile and deploy (you can use the free Microsoft Visual Studio Express edition). The package also contains a pre build extension which you can install using the following instructions (build for SDL Tridion 2011 Hotfix Rollup 1):
Copy the files from the GoogleAnalytics (Editor).zip to a directory on your SDL Tridion CMS server, this will be your extension location (prefered location will be directly under the ..\WebUI\Editors directory).
Set up the extension location as a virtual directory in IIS.
a) In the IIS console, browse to the SDL Tridion 2011 website
b) Under the ..\WebUI\Editors directory add a new Virtual Directory, pointing to your extension location on disk (you have to do this also if the location you chose in step 1 is directly under the ..\WebUI\Editors directly as shown in the screenshot below)
Add the Tridion.GoogleAnalytics.Editor.dll to the ..\WebUI\bin directory and the Tridion.GoogleAnalytics.Editor.Strings.resx to the ..\WebUI\App_GlobalResources directory.
Configure extension in the GUI. To do this, find the System.config file under <Tridion_home>\web\WebUI\WebRoot\Configuration
a) Make a backup of the file first so you can always revert to the way it was with no extensions configured
b) Locate the <editors> element and add a new editor like so:
<installpath>C:\Program Files (x86)\Tridion\web\WebUI\Editors\GoogleAnalytics</installpath>
The editor element has 3 important elements:
I) installpath The exact location of where you copied the extension
II) configuration the relative location of the extension configuration file
III) vdir The name of the virtual directory as its set up in IIS
Next step is to add the Publication Metadata to every Publication you want the analytics data for. An example Metadate Schema is provided in the zip file (Google Analytics Publication Metadata.xsd). If you already have a Publication Metadata Schema you can just add two fields to it (XML names: uaid and siteid, for details see the example Schema).
After adding this you can fill in the needed data as directed above.
Then to get a new Google Analytics tracking code Template Building Block, you need to use the Tridion.GoogleAnalytics.Templating.dll, you can either upload this yourself in a Assembly Template Building Block, use the TcmUploadAssembly tool (as described in our documentation) or just rebuild the Template project from Visual Studio, it has a post build step to upload and create the Template Building Blocks for you (be sure to set the correct Folder ID in the post build step).
As described this extension comes with full source code and can therefore also be used as an example of how to integrate analytics data of other vendors in a similair way.