I think I discovered a bug in the SL4 version of the GoogleAnalytics when running OoB.
Symptom: Running the GA in offline mode will not fire events off to the server (confirmed by Fiddler).
I eventually decided to disassemble the GoogleAnalytics dll -- source was not included :( and think I found the problem...
In the method: Uri BuildUrl(AnalyticsEvent logEvent)
there is a line of code near the beginning:
if (logEvent.DocumentUri.Scheme == "https")
unfortunately, the first time this procedure is hit, logEvent.DocumentUri is null. this causes an exception.
Normally, I am creating my own AnalyticsEvent objects so I can set this to Application.Current.Host.Source but the very first AnalyticsEvent that shows up comes from Microsoft.WebAnalytics!Microsoft.WebAnalytics.WebAnalyticsService.Started() and the document
uri is not set because of the following line of code in the constructor of DataCollector:
if (HtmlPage.IsEnabled) ****** this is false in OoB apps
this.documentUri = HtmlPage.Document.DocumentUri;
this.referrer = HtmlPage.Document.GetProperty("referrer") as string;
Note: the SL3 version of the GA dll does not appear to require the documentUri but really, it seems like the better fix might actually reside in DataCollector.
Let me know if there are any Qs,