Monday, May 17, 2010

Google Analytics for Silverlight

Google Analytics for Silverlight – There are multiple analytics framework available to integrate with your Silverlight application.

There is SilverlightAnalytics and then there is MSAF. MSAF – Microsoft Silverlight Analytics Framework seems to be more promising with more extensiblity and feature full and with the backing from Microsoft. It supports out-of-browsers, offline capability, A/B Testing and Support multiple analytics services simultaneously without impacting performance. MSAF can be used by designers in Microsoft Expression Blend to add tracking to applications without coding.

Getting started with MSAF –
1. Download and install MSAF
2. Create a new Silverlight Navigation Application.
3. It’s easier to start with, using Microsoft Expression Blend as you can do drag and drop.
4. But you can add the code manually also. In the MainPage.xaml, add the following to the LayoutRoot

<i:Interaction.Behaviors>
     <ga:GoogleAnalytics WebPropertyId="UA-xxxxxx-x" />
</i:Interaction.Behaviors>

5. WebPropertyID is the Id you get from Google when you sign up for Analytics
6. Add references to WebAnalytics, Behaviours, Navigation and also add necessary references in xaml file.

xmlns:navigation="clr- namespace:System.Windows.Controls; assembly=System.Windows.Controls.Navigation"
xmlns:uriMapper="clr- namespace:System.Windows.Navigation; assembly=System.Windows.Controls.Navigation"
mc:Ignorable="d" xmlns:i="clr- namespace:System.Windows.Interactivity; assembly=System.Windows.Interactivity"
xmlns:mwab="clr-namespace:Microsoft.WebAnalytics.Behaviors; assembly=Microsoft.WebAnalytics.Behaviors"
xmlns:ga="clr-namespace:Google.WebAnalytics; assembly=Google.WebAnalytics"

Read more: citytech

Posted via email from jasper22's posterous