I've been trying to get GoogleAnalytics to work but seem to be doing something wrong. I started off by following the documentation:
- Created new Silverlight Navigation project
- Added GoogleAnalytics to LayoutRoot (and set Web Property ID based on my Google Analytics account)
- Added TrackAction to the ContentFrame (set SourceName to be ContentFrame, although that should be the default as ContentFrame is parent. Also set EventName to Navigated)
Ran application with Fiddler running and didn't notice any calls to Google.
Think that I must had done something wrong I added a ConsoleAnalytics to the LayoutRoot and ran the application with the IE8 dev tools running. The Navigated events are raised correctly in the console.
Wondering where I could be going wrong I decided to create a class GoogleExt that inherits from GoogleAnalytics. I then attached an event handler to the base.Events.TrackEvent in the overrided OnAttached method. I then exchanged my GoogleExt for
the GoogleAnalytics in my application. Unfortunately when I ran the application the TrackEvent event isn't being raised. Note that if I do the same but inherit from ConsoleAnalytics the event gets raised.
For some reason I suspect my GoogleAnalytics instance (either GoogleAnalytics or my overridden GoogleExt) aren't being correctly attached - The OnAttached method does get called and returns without throwing an exception.
Any suggestions as to what I might be doing wrong?