Basic getting started documentation?

Apr 24, 2010 at 9:45 PM

I'm having some trouble getting started, because all of the documentation centers around using the framework with Blend.

Let's say I'm using Google Analytics. Do I need to paste their JS code into my page? Or does the framework handle that?

If not, where do I enter my account info?

Let's say I want to track a simple event using code, rather than Blend. How do I do that?

Coordinator
Apr 24, 2010 at 10:10 PM
Edited Apr 24, 2010 at 10:10 PM

You don't need to use the JS code.

Take a look at the help file that comes with the framework - it has a number of how to pages.

I'd also recommend watching the Mix session at http://live.visitmix.com/MIX10/Sessions/CL24.

Michael

Apr 24, 2010 at 10:12 PM

The only example code I see in the help file is on how to make tracking services and behaviors. All of the examples in the help file (and in the video) for actually tracking things are shown using Blend.

It would be good to see a basic event tracking example using only code.

Coordinator
Apr 24, 2010 at 11:02 PM

Create a new Analytics Service Behavior using the template in Visual Studio - you can then see the code necessary to track events via code.

 

Apr 30, 2010 at 7:27 PM

Examples of firing the analytics events via code rather than blend would be very useful.

May 17, 2010 at 6:04 PM

Did you found any examples?

I have scenario where i download images from server. I would like to track which images has been downloaded, and i need to do it in code.

 

Coordinator
May 18, 2010 at 3:02 AM
 
namespace SilverlightApplication67
{
    using System;
    using System.ComponentModel.Composition;
    using Microsoft.WebAnalytics;

    public class TrackDownload 
    {
        [Import("Log")]
        public Action<AnalyticsEvent> Log { get; set; }

        public TrackDownload()
        {
            CompositionInitializer.SatisfyImports(this);
        }

        public void LogDownload(string url)
        {
            var logEvent = new AnalyticsEvent()
            {
                ActionValue = url,
                Name = "Downloaded",
                ObjectType = GetType().Name
            };

            this.Log(logEvent);
        }
    }
}

May 20, 2010 at 2:50 PM
Thanks