This is a mirror of official site: http://jasper-net.blogspot.com/

Tracking Ad Clicks with the Microsoft Silverlight Analytics Framework on the Windows Phone

| Tuesday, September 21, 2010
Along with the release of the Windows Phone Developer Tools and the Microsoft Silverlight Analytics Framework 1.46 today, Microsoft also released the Mobile Advertising SDK for Windows Phone.  The SDK consists of a custom control AdControl that you add to your Silverlight application on the phone.  Because the AdControl exposes an AdEngaged event whenever the user clicks on an ad, it is very easy to make the Analytics Framework work with the control.  I plan on adding another assembly to the next build of the Analytics Framework to support this.  Here is the code that is necessary for it if you don’t want to wait.

To use this code:

Add the AdControl to your application as described in the SDK
Add the HandleadControl.cs code to your project
Add a TrackAction behavior to the AdControl and select the AdEngaged event
Now the AdControl.AdUnitId will be tracked in the AnalyticsEvent.ActionValue

HandleAdControl.cs

namespace Microsoft.WebAnalytics.Advertising
{
   using System;
   using System.ComponentModel.Composition;
   using Microsoft.Advertising.Mobile.UI;
   using Microsoft.WebAnalytics;
   using Microsoft.WebAnalytics.Contracts;

Read more: Synergist

Posted via email from .NET Info

0 comments: