Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add new dimensions + fix README.md

  • Loading branch information...
commit 549125f2af3d7de94ffb47f7a0360b2fed52c698 1 parent 614d9bc
@Valve Valve authored
View
7 Igooana.sln
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
-VisualStudioVersion = 12.0.21005.1
+VisualStudioVersion = 12.0.30110.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Igooana", "Igooana\Igooana.csproj", "{9512F2FF-89BB-4C8E-80E4-5F20F16C2552}"
EndProject
@@ -9,6 +9,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Igooana.Tests", "Igooana.Te
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Igooana.Demo", "Igooana.Demo\Igooana.Demo.csproj", "{2A001670-18C5-4A48-9CFB-EEA1D5E7F3F6}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B3EAB7AD-46BF-4467-8F95-3F1EDBEB9F30}"
+ ProjectSection(SolutionItems) = preProject
+ README.md = README.md
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
View
28 Igooana/Dimensions/GoalConversions.cs
@@ -0,0 +1,28 @@
+namespace Igooana.Dimensions {
+ /// <summary>
+ /// Dimensions related to Goals
+ /// </summary>
+ public class GoalConversions {
+ internal GoalConversions() { }
+
+ /// <summary>
+ /// The page path or screen name that matched any destination type goal completion.
+ /// </summary>
+ public readonly Dimension GoalCompletionLocation = new Dimension("ga:goalCompletionLocation", "Goal Conversions", "The page path or screen name that matched any destination type goal completion.");
+
+ /// <summary>
+ /// The page path or screen name that matched any destination type goal, one step prior to the goal completion location.
+ /// </summary>
+ public readonly Dimension GoalPreviousStep1 = new Dimension("ga:goalPreviousStep1", "Goal Conversions", "The page path or screen name that matched any destination type goal, one step prior to the goal completion location.");
+
+ /// <summary>
+ /// The page path or screen name that matched any destination type goal, two steps prior to the goal completion location.
+ /// </summary>
+ public readonly Dimension GoalPreviousStep2 = new Dimension("ga:goalPreviousStep2", "Goal Conversions", "The page path or screen name that matched any destination type goal, two steps prior to the goal completion location.");
+
+ /// <summary>
+ /// The page path or screen name that matched any destination type goal, three steps prior to the goal completion location.
+ /// </summary>
+ public readonly Dimension GoalPreviousStep3 = new Dimension("ga:goalPreviousStep3", "Goal Conversions", "The page path or screen name that matched any destination type goal, three steps prior to the goal completion location.");
+ }
+}
View
1  Igooana/Igooana.csproj
@@ -45,6 +45,7 @@
<Compile Include="Auth.cs" />
<Compile Include="ConnectionException.cs" />
<Compile Include="Dimensions\GeoNetwork.cs" />
+ <Compile Include="Dimensions\GoalConversions.cs" />
<Compile Include="Dimensions\PageTracking.cs" />
<Compile Include="Dimensions\Time.cs" />
<Compile Include="Dimensions\TrafficSources.cs" />
View
3  Igooana/Metrics/GoalConversions.cs
@@ -1,4 +1,7 @@
namespace Igooana.Metrics {
+ /// <summary>
+ /// Metrics related to Goals
+ /// </summary>
public class GoalConversions {
internal GoalConversions() { }
View
26 README.md
@@ -14,12 +14,10 @@ Before you start, make sure you have your Google Analytics `clientId` and `clien
Using the api requires OAuth authentication with web browser. If you're using Xaml (WPF or Silverlight applications), the code might look like:
-```
-
+```xaml
<Grid>
<WebBrowser Name="Browser" Navigating="OnNavigating" />
</Grid>
-
```
Code behind:
@@ -61,8 +59,8 @@ try {
int profileId = GetProfileId(); // this might use Api.Management to get all your profiles.
var query = Query
.For(profileId, DateTime.Now.AddDays(-31), DateTime.Now)
- .WithMetrics(Metric.Visits + Metric.Pageviews)
- .WithDimensions(Dimension.Browser);
+ .WithMetrics(Metric.Session.Visits + Metric.PageTracking.Pageviews)
+ .WithDimensions(Dimension.PlatformOrDevice.Browser);
Result result = await api.Execute(query);
foreach(var row in result.Values){
Console.WriteLine("I had {0} visits with {1} pageviews on {2} browser",
@@ -83,8 +81,8 @@ Get only 10 rows
```C#
var query = Query
.For(profileId, DateTime.Now.AddDays(-31), DateTime.Now)
- .WithMetrics(Metric.Visits + Metric.Pageviews)
- .WithDimensions(Dimension.Browser)
+ .WithMetrics(Metric.Session.Visits + Metric.PageTracking.Pageviews)
+ .WithDimensions(Dimension.PlatformOrDevice.Browser);
.Take(10);
Result result = await api.Execute(query);
```
@@ -102,8 +100,8 @@ This example only returns items from 11 to 20, essentially allowing you to get t
```C#
var query = Query
.For(profileId, DateTime.Now.AddDays(-31), DateTime.Now)
- .WithMetrics(Metric.Visits + Metric.Pageviews)
- .WithDimensions(Dimension.Browser)
+ .WithMetrics(Metric.Session.Visits + Metric.PageTracking.Pageviews)
+ .WithDimensions(Dimension.PlatformOrDevice.Browser);
.Skip(10)
.Take(10);
Result result = await api.Execute(query);
@@ -125,10 +123,10 @@ An example of viewing top 10 countries by page views:
```C#
var query = Query
.For(profileId, DateTime.Now.AddDays(-31), DateTime.Now)
- .WithMetrics(Metric.Pageviews)
- .WithDimensions(Dimension.Country)
+ .WithMetrics(Metric.PageTracking.Pageviews)
+ .WithDimensions(Dimension.GeoNetwork.Country)
.Take(10)
- .OrderByDescending(Metric.Pageviews);
+ .OrderByDescending(Metric.PageTracking.Pageviews);
Result result = await api.Execute(query);
```
@@ -151,8 +149,8 @@ metrics you query. The properties have the correct CLR types, as with `Values`
int profileId = GetProfileId(); // this might use Api.Management to get all your profiles.
var query = Query
.For(profileId, DateTime.Now.AddDays(-31), DateTime.Now)
- .WithMetrics(Metric.Visits + Metric.Pageviews)
- .WithDimensions(Dimension.Browser);
+ .WithMetrics(Metric.Session.Visits + Metric.PageTracking.Pageviews)
+ .WithDimensions(Dimension.PlatformOrDevice.Browser);
Result result = await api.Execute(query);
Console.WriteLine("Total Visits: {0}, total page views: {1}",
result.Totals.Visits, result.Totals.Pageviews);
Please sign in to comment.
Something went wrong with that request. Please try again.