Property | Type | Description | |
---|---|---|---|
Add | void | ||
AddUserAgent | void | ||
ApplicationOnResuming | void | ||
ApplicationOnSuspending | void | ||
DebugRequest | void | ||
FrameNavigated | void | ||
GetScreenName | string | ||
HookEvents | void | ||
IsInternetAvailable | bool | ||
LoadSessionState | Task |
||
PreprocessHttpRequest | void | ||
RejoinPayload | Task |
||
SaveSessionState | System.Threading.Tasks.Task | ||
StartRequesterAsync | System.Threading.Tasks.Task | ||
SuspendRequesterAsync | System.Threading.Tasks.Task | ||
TrackFrameNavigate | void | ||
UnhookEvents | void |
Method | Description | |
---|---|---|
Attach ( |
Attach to the root frame, hook into the navigation event and track initial page appview. Call this just before Window.Current.Activate() in your App.OnLaunched method.
|
|
SetOptOut ( bool optOut ) : void |
Opt the user in or out of analytics for this application install. This option persists automatically. You should call this only when the user changes their decision. |
|
StartAsync ( MeasurementConfiguration configuration, IActivatedEventArgs launchArgs, TimeSpan uploadInterval = null ) : System.Threading.Tasks.Task |
Initialize CSharpAnalytics by restoring the session state and starting the background sender and tracking the application lifecycle start event.
|
Method | Description | |
---|---|---|
Add ( Uri uri ) : void |
Send the Uri request to the current background requester safely.
|
|
AddUserAgent ( ICollection |
Figure out the user agent and add it to the header collection.
|
|
ApplicationOnResuming ( object sender, object o ) : void |
Handle application resuming from suspend without shutdown.
|
|
ApplicationOnSuspending ( object sender, |
Handle application suspending.
|
|
DebugRequest ( |
Send the HttpRequestMessage with the protocol debugger for examination.
|
|
FrameNavigated ( object sender, |
Receive navigation events to translate them into analytics page views. Implement IAnalyticsPageView if your pages look up content so you can track better detail from the end of your LoadState method. |
|
GetScreenName ( |
Determine the screen name of a page to track.
|
|
HookEvents ( ) : void |
Hook into various events to automatically track suspend, resume, page navigation, social sharing etc.
|
|
IsInternetAvailable ( ) : bool |
Determine if the Internet is available at this point in time.
|
|
LoadSessionState ( ) : Task |
Load the session state from storage if it exists, null if it does not.
|
|
PreprocessHttpRequest ( |
Pre-process the HttpRequestMessage before it is sent. This includes adding the user agent for tracking and for debug builds writing out the debug information to the console log. Because user agent is not persisted unsent URIs that are saved and then sent after an upgrade will have the new user agent string not the actual one that generated them. |
|
RejoinPayload ( |
Rejoin the POST body payload with the Uri parameter if necessary so it can be sent to the protocol debugger.
|
|
SaveSessionState ( |
Save the session state to preserve state between application launches.
|
|
StartRequesterAsync ( ) : System.Threading.Tasks.Task |
Start the requester with any unsent URIs from the last application run.
|
|
SuspendRequesterAsync ( ) : System.Threading.Tasks.Task |
Suspend the requester and preserve any unsent URIs.
|
|
TrackFrameNavigate ( |
Track an app view if it does not track itself.
|
|
UnhookEvents ( ) : void |
Unhook events that were wired up in HookEvents. Not actually used in AutoMeasurement but here to show you what to do if you wanted to. |
public static Attach ( |
||
frame | ||
return | void |
public static SetOptOut ( bool optOut ) : void | ||
optOut | bool | True if the user is opting out, false if they are opting back in. |
return | void |
public static StartAsync ( MeasurementConfiguration configuration, IActivatedEventArgs launchArgs, TimeSpan uploadInterval = null ) : System.Threading.Tasks.Task | ||
configuration | MeasurementConfiguration | Configuration to use, must at a minimum specify your Google Analytics ID and app name. |
launchArgs | IActivatedEventArgs | Launch arguments from your Application OnLaunched to determine how the app was launched. |
uploadInterval | TimeSpan | How often to upload to the server. Lower times = more traffic but realtime. Defaults to 5 seconds. |
return | System.Threading.Tasks.Task |