34
Knowing is Understanding A road trip through Google analytics for Windows Phone

Knowing is Understanding: A road trip through Google analytics for Windows Phone

Embed Size (px)

DESCRIPTION

In this presentation you are taken on an intruductory roadtrip on Google Analytics for Windows Phone.

Citation preview

Page 1: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Knowing is Understanding

A road trip through Google analytics for Windows Phone

Page 2: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Who is

Tom Janssens

Page 3: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Who is?

• Name: Tom Janssens

• Independent consultant• Starting indie game developer

• www: http://www.blugri.com• Facebook:

http://www.facebook.com/blugri• Twitter: @blugri

Page 4: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Google Analytics

Account Setup

Page 5: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Google Analytics – Account setup

• Accounts• Web Properties• Profiles• Filters

• Advanced Segments• Dashboards

Page 6: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Google Analytics – Account structure

Username / Login

Account

Web property

Profile 1

Filter

Profile 2

Filter

Filter

Web property

Profile 1

Filter

Account

Web property

Profile 1

Filter

Profile 2

Filter

Filter

Page 7: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Google Analytics – Accounts

• You can only start 20 accounts• Given access to unlimited accounts

!!! No more than one client / account !!!

Page 8: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Google Analytics – Web Properties

• An account can have only 50 properties

• Web Property = tracking code

!!! Web property is in a single account !!!

Page 9: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Google Analytics – Profiles and Filters

• Limited to 50 profiles (over all properties)

• Filters incoming data• Filters executed in order of definition• Always keep a profile with all raw data

!!! Filters do not work on Custom Variables !!!

Page 10: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Google Analytics – Advanced Segments

• Isolate and analyse your analytics data

• Default or Custom Advanced Segments

Page 11: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Google Analytics – Dashboards

• Sticky to login• Configuration sharing• Widgets added via filters• Export and Email

Page 12: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Google Analytics – Dashboards

Page 13: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Google Analytics – Multiple apps

• Use advances segments• Or filter on e.g.

– Page title

Page 14: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Google Analytics – Going live

• Go to marketplace• Search “sudoku”• Search this icon

• Download and start!

• Or scan QR-code

Page 15: Knowing is Understanding: A road trip through Google analytics for Windows Phone

For Windows Phone

Microsoft Silverlight Analytics Framework

Page 16: Knowing is Understanding: A road trip through Google analytics for Windows Phone

MSAF

• Web analytics Framework• Supports

– Silverlight, WPF and Windows Phone– Offline scenarios– Pageview and event tracking– …

• Extensible• Get it from http://msaf.codeplex.com/

Page 17: Knowing is Understanding: A road trip through Google analytics for Windows Phone

MSAF

Page 18: Knowing is Understanding: A road trip through Google analytics for Windows Phone

The code

C#

Page 19: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Adding it to your application

<Application.ApplicationLifetimeObjects> <!--Required object that handles lifetime events for the application--> <shell:PhoneApplicationService Launching="Application_Launching" Closing="Application_Closing" Activated="Application_Activated" Deactivated="Application_Deactivated"/>

<Analytics:AnalyticsService x:Name="analyticsService" WebPropertyId="UA-12345678-9" AutomaticPageTrackingEnabled="True" /> </Application.ApplicationLifetimeObjects>

• Add the code to your App.xaml

Page 20: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Adding it to your application

<pre class="brush: csharp;">public partial class App : Application { private AnalyticsTracker _tracker; public AnalyticsTracker Tracker { get { if (_tracker == null) { AnalyticsService service = null; foreach (var obj in this.ApplicationLifetimeObjects) { if (typeof(AnalyticsService).Equals(obj.GetType())) { service = obj as AnalyticsService; break; } } _tracker = new AnalyticsTracker(service); } return _tracker; } } }

• And to App.xaml.cs

Page 21: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Application properties

• Google Analytics: 5 custom variables

Key 1: ProductID

Key 2: User defined

Key 3: User defined

Key 4: User defined

Key 5: User defined

public class AnalyticsService : IApplicationService{ private readonly IApplicationService _innerService; private readonly GoogleAnalytics _googleAnalytics;

public AnalyticsService() { _googleAnalytics = new GoogleAnalytics(); _googleAnalytics.CustomVariables.Add( new PropertyValue

{ PropertyName = "Device ID",

Value = AnalyticsProperties.DeviceId }); ... }}

Page 22: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Reading the manifest public class PhoneHelper { const string AppManifestName = "WMAppManifest.xml"; const string AppNodeName = "App";

public static string GetAppAttribute(string attributeName) { try { var settings = new XmlReaderSettings { XmlResolver = new XmlXapResolver() };

using (var rdr = XmlReader.Create(AppManifestName, settings)) { rdr.ReadToDescendant(AppNodeName); if (!rdr.IsStartElement()) { throw new FormatException(AppManifestName + " is missing " + AppNodeName); } return rdr.GetAttribute(attributeName); } } catch (Exception) { return ""; } } }

Copy fromhttp://coding4fun.codeplex.com/

Page 23: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Pageview Trackingpublic class AnalyticsService : IApplicationService{ private readonly IApplicationService _innerService; private readonly GoogleAnalytics _googleAnalytics;

public AnalyticsService() { _googleAnalytics = new GoogleAnalytics(); _googleAnalytics.CustomVariables.Add( new PropertyValue

{ PropertyName = "Device ID",

Value = AnalyticsProperties.DeviceId }); ... _innerService = new WebAnalyticsService { IsPageTrackingEnabled = true, Services = { _googleAnalytics, } }; }}

Page 24: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Pageview Tracking

• Basic tracking– For apps with many pages– Shows in analytics as pagename.xaml?

p1=v1• Realtime analytics

Page 25: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Event Trackingpublic class AnalyticsTracker{ private AnalyticsService _service;

public AnalyticsTracker(AnalyticsService service) { CompositionInitializer.SatisfyImports(this);

_service = service; }

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

public void Track(string category, string name, string actionValue) { Log(new AnalyticsEvent { Category = category, Name = name, ObjectName = actionValue }); }}

Page 26: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Event Trackingused for pageviewspublic void TrackPageView(string pageViewName){ // Avoid double tracking if (_service != null && !_service.AutomaticPageTrackingEnabled) { Log(new AnalyticsEvent { ActionValue = pageViewName, HitType = Microsoft.WebAnalytics.Data.HitType.PageView, Name = "CurrentScreenChanged", NavigationState = pageViewName, ObjectType = pageViewName, AppName = Analytics.AnalyticsProperties.ApplicationTitle }); } }}

Use page name for application filtering

Give your pagetracking a user-friendly name

Page 27: Knowing is Understanding: A road trip through Google analytics for Windows Phone

References

• Google.WebAnalytics• Microsoft.WebAnalytics• Microsoft.WebAnalytics.Behaviors• Microsoft.WebAnalytics.Navigation• Microsoft.SilverlightMediaFramework.Comp

atibility.Phone– Replaces:

• System.ComponentModel.Composition• System.ComponentModel.Composition.Initialization

• System.Windows.Interactivity

Page 28: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Tracking options

Useful tracks

Page 29: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Useful trackings

• Reviews and Sharing– Event Tracking– Get insights where to place your share /

review buttons

Page 30: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Useful trackings

• Version Tracking– Updates vs new downloads– Sticky users vs user growth– Store current version in isolated storage

Page 31: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Useful trackingsstring installedVersion = AppSettingsAndStatistics.Instance.ApplicationVersion;string currentVersion = Analytics.AnalyticsProperties.ApplicationVersion;

if (installedVersion == null){ AppSettingsAndStatistics.Instance.ApplicationVersion = currentVersion;

((Sudoku.App)App.Current).Tracker.Track("Installation”, "New", string.Format("new version: {0}”, Analytics.AnalyticsProperties.ApplicationVersion));}else if (!installedVersion.Equals(currentVersion)) { AppSettingsAndStatistics.Instance.ApplicationVersion = currentVersion;

((Sudoku.App)App.Current).Tracker.Track("Installation", "Update", string.Format("old version: {0} - new version: {1}", installedVersion, currentVersion));}

Page 32: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Useful trackings

• Application events– Game modes

• Game controls• Levels played / Difficulty

– Use of Hints, Tips, …– Advertising

• Providers• Number of ads displayed, clicked

– …

Page 33: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Resources

Links

Page 34: Knowing is Understanding: A road trip through Google analytics for Windows Phone

Links

• https://www.google.com/ads/agencyedge/

• http://msaf.codeplex.com/

• http://www.windowsphonegeek.com/news/analyze-the-use-of-a-wp7-app-with-google-analytics-and-microsoft-silverlight-analytics-framework-msaf