Getting custom variables to work with Google Analytics

May 11, 2011 at 11:19 PM

I’ve been playing with the Framework and I tried to add a Google Analytics to a Siliverlight Navigation Application. Quite straightforward:

  1. Create a new Navigation application in VS
  2. Open MainPage.xaml in Blend
  3. Drop the GoogleAnalytics behahior in LayoutRoot and set Web Property ID
  4. Drop Track Action on ContentFrame

Works like a charm.

Now I would like to set some page scope custom variables. According to documentation:

“Page scope custom variables will correspond to the Custom Properties collection of the TrackAction associated with a specific object on the page (like a button).”

So I defined a custom property in Blend by clicking on “…” next to Custom Properties (Collection).

I ran the application, inspecting the requests with Fiddler, and noticed that the custom properties were missing.

Here is what the Get request looks like:


 Here is my Xaml:

           		<i:EventTrigger EventName="Navigated">
            					<mwad:PropertyValue PropertyName="MyVariable" Value="MyValue"/>

How do I get custom variables to work?

May 11, 2011 at 11:20 PM

As a sidenote, I've downloaded the Framework's source code to try and investigate the problem, but it does not appear to contain the source for Google.WebAnalytics.dll

Is the source for that DLL available somewhere?



May 12, 2011 at 6:58 PM

Looked at Google.WebAnalytics with Reflector - looks like there is a bug in AppendCommonParameters() method called from BuildUrl():

it only appends custom variables if the event type is not PageView. This looks plain wrong because Google Analytics supports page scope custom variables.

Am I understanding the issue correctly? If yes, is there a chance to get a bugfix for this?



Oct 13, 2011 at 7:37 PM


Have you ever got the CustomProperties work ? Please let me know. I'm having the same issue.


Oct 20, 2011 at 6:02 PM

I have not had a chance to look at this again.

I have filed a bug on it, though:


Jan 5, 2016 at 7:07 AM