Issues with Windows Phone 7 (WP7) while using Analytics

Sep 23, 2010 at 5:21 PM
Edited Sep 24, 2010 at 7:19 PM

I am searching for answers to issues I encountered while using MSAF for WP7. I hope this helps others developing on WP7 as well.

Issue 1ChangeRejectedException was unhandled

I am trying to use Google Analytics for my WP7 (Windows Phone 7) application.

I tried to use simple analytics for button clicks and listbox selectionchanged using the demo by Michael Scherotter in .

It compiles fine but when I try to run my app, I get this error (full paste below):

The composition remains unchanged. The changes were rejected because of the following error(s): The composition produced a single composition error. The root cause is provided below. 
Review the CompositionException.Errors property for more detailed information.

1) No valid exports were found that match the constraint '((exportDefinition.ContractName = "Log") 
&& (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") 
&& "System.Void(Microsoft.WebAnalytics.AnalyticsEvent)".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))', invalid exports may have been rejected.

Resulting in: Cannot set import 'Microsoft.WebAnalytics.Behaviors.TrackForm.Log (ContractName="Log")' on part 'Microsoft.WebAnalytics.Behaviors.TrackForm'.
Element: Microsoft.WebAnalytics.Behaviors.TrackForm.Log (ContractName="Log") -->  Microsoft.WebAnalytics.Behaviors.TrackForm


I am using the Version 1.4.6 Installer of MSAF:

Visual Studio 2010 and the latest released WP7 SDK:

Can someone help resolve this issue ?


Sep 24, 2010 at 5:19 PM

Follow the instructions in the help topic "How to add Tracking to Windows Phone Application"  There is a link to the help file in the Start Menu...Microsoft Silverlight Analytics Framework...Documentation

Sep 24, 2010 at 7:16 PM
Edited Sep 24, 2010 at 7:31 PM

Here's more I encountered after the above got fixed:

[Thanks for your reply. The documentation you referred to got rid of the problem. I will know if this was successful in about 24 hrs as the Google Analytic site says]

Issue 2: Interface 'Microsoft.WebAnalytics.Contracts.ITrackerMetadata' is not a valid MetadataView

I added a form tracker as suggested in the livemeeting video mentioned earlier. Gives me the following error message.

Is it because form tracking is exclusive to silverlight vs WP7 ? If not, how do I fix this ?

Interface 'Microsoft.WebAnalytics.Contracts.ITrackerMetadata' is not a valid MetadataView; MetadataViews do not support non-public interfaces, 
and interfaces that contain members that are not properties.

My xaml has:

         <Custom:EventTrigger EventName="Click" SourceName="SearchBtn2">
         <Microsoft_WebAnalytics_Behaviors:TrackForm Category="MSLocationSearch"/>

Issue 3: System.NullReferenceException was unhandled on using the Pulse Analytic while leaving the page

My xaml has:

<Microsoft_WebAnalytics_Behaviors:Pulse Interval="10"/>

When I hit the back button to quit the page, I get a NullReferenceException with the following stack trace:

System.NullReferenceException was unhandled
       at System.Windows.Interactivity.Interaction.GetBehaviors(DependencyObject obj)
       at Microsoft.WebAnalytics.Behaviors.Pulse.<OnAttached>b__0(Object sender, RoutedEventArgs args)
       at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
       at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)

What am I missing ?


While reading the documentation for WP7 I noticed:

1. In 10.a: Add the Microsoft.WebAnaltyics.Controls.WP7 assembly to the project. There was no such assembly. I added Microsoft.WebAnaltyics.Controls.dll and that worked fine.

2. Same in 11.a for the toolkit - there is no .WP7 that I could find while adding reference in vs2010. I think it should be: Microsoft.WebAnaltyics.Toolkit.dll

3. "You should now have a Windows Phone application that tracks the screen changed events with CurrentScreenChanged events for each screen change.". Can you explain if this is automatic or we need to subscribe that event ?





Sep 24, 2010 at 9:52 PM
Edited Sep 24, 2010 at 11:33 PM

[Deleted and waiting for answers]