九幽數據統計是統計和分析數據來源,用戶使用,先申請賬號
[http://www.windows.sc](http://www.windows.sc/)
[](https://github.com/lindexi/lindexi_gd/blob/master/%E5%8D%9A%E5%AE%A2/image/201611220331168.png)
創建應用
[](https://github.com/lindexi/lindexi_gd/blob/master/%E5%8D%9A%E5%AE%A2/image/201611220345291.png)
圖片要72*72
記密鑰
[](https://github.com/lindexi/lindexi_gd/blob/master/%E5%8D%9A%E5%AE%A2/image/201611220348976.png)
在項目Nuget
[](https://github.com/lindexi/lindexi_gd/blob/master/%E5%8D%9A%E5%AE%A2/image/201611220373361.png)
[](https://github.com/lindexi/lindexi_gd/blob/master/%E5%8D%9A%E5%AE%A2/image/20161122037747.png)
在App.xaml.cs
~~~
public App()
{
Microsoft.ApplicationInsights.WindowsAppInitializer.InitializeAsync(
Microsoft.ApplicationInsights.WindowsCollectors.Metadata |
Microsoft.ApplicationInsights.WindowsCollectors.Session);
this.InitializeComponent();
this.Suspending += OnSuspending;
this.Resuming += App_Resuming;
}
private void App_Resuming(object sender, object e)
{
track();
}
protected override void OnActivated(IActivatedEventArgs args)
{
base.OnActivated(args);
track();
}
private async void track()
{
await JYAnalyticsUniversal.JYAnalytics.StartTrackAsync("你的key");
}
~~~
在OnLaunched加
~~~
track();
~~~
在OnSuspending加
~~~
private async void OnSuspending(object sender, SuspendingEventArgs e)
{
var deferral = e.SuspendingOperation.GetDeferral();
//TODO: 保存應用程序狀態并停止任何后臺活動
await JYAnalyticsUniversal.JYAnalytics.EndTrackAsync(); //需注意此處代碼位置不可更改
deferral.Complete();
}
~~~
運行,等待九幽
頁面統計
~~~
protected override void OnNavigatedFrom(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
{
base.OnNavigatedFrom(e);
JYAnalytics.TrackPageEnd("main_page");
}
protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
{
base.OnNavigatedTo(e);
JYAnalytics.TrackPageStart("main_page");
}
~~~
統計次數
~~~
JYAnalytics.TrackEvent("StartTimes");
~~~
統計StartTimes次數
~~~
string eventId=“open";//當前統計的事件
string lable="打開blog.csdn.net/lindexi_gd";//描述當前id
JYAnalytics.TrackEvent(eventId,lable);
~~~
統計錯誤
~~~
string error=”“;
JYAnalytics.TrackError(error);
~~~
在Package.appxmanifest功能
Internet(客戶端服務器)使用
[](https://github.com/lindexi/lindexi_gd/blob/master/%E5%8D%9A%E5%AE%A2/image/201611220506879.png)
http://blog.csdn.net/lindexi_gd
- 前言
- UWP win10 app 新關鍵字x:Bing
- win10應用 UWP 使用MD5算法
- win10 UWP讀寫文件
- UWP appButtonBar樣式
- C# 6.0 $"Hello {csdn}"
- Win10 UWP xaml 延遲加載元素
- UWP xaml 圓形頭像
- UWP 繪制圖形
- win10 uwp 通知Toast
- win10 UWP 顯示地圖
- win10 uwp 參考
- win10 uwp clone
- win10 uwp 裝機必備應用 含源代碼
- RichEditBox 使用自定義菜單
- win10 UWP FlipView
- win10 UWP 獲取系統信息
- win10 UWP 申請微軟開發者
- win10 UWP button
- win10 UWP Markdown 含源代碼
- win10 UWP 應用設置
- win10 UWP 九幽數據分析
- win10 UWP 圓形等待
- win10 UWP 標題欄后退
- win10 UWP 單元測試
- win10 UWP 你寫我讀
- win10 UWP RSS閱讀器
- win10 UWP MessageDialog 和 ContentDialog
- win10 UWP Hmac
- win10 UWP GET Post
- Win10 UWP Intro to controls and events
- win10 UWP Controls by function
- win10 uwp App-to-app communication 應用通信