九幽数据统计是统计和分析数据来源,用户使用,先申请账号
[http://www.windows.sc](http://www.windows.sc/)
[![](https://box.kancloud.cn/2016-04-08_570763710b71f.png)](https://github.com/lindexi/lindexi_gd/blob/master/%E5%8D%9A%E5%AE%A2/image/201611220331168.png)
创建应用
[![](https://box.kancloud.cn/2016-04-08_57076371217b6.png)](https://github.com/lindexi/lindexi_gd/blob/master/%E5%8D%9A%E5%AE%A2/image/201611220345291.png)
图片要72*72
记密钥
[![](https://box.kancloud.cn/2016-04-08_5707637136446.png)](https://github.com/lindexi/lindexi_gd/blob/master/%E5%8D%9A%E5%AE%A2/image/201611220348976.png)
在项目Nuget
[![](https://box.kancloud.cn/2016-04-08_57076371528d2.png)](https://github.com/lindexi/lindexi_gd/blob/master/%E5%8D%9A%E5%AE%A2/image/201611220373361.png)
[![](https://box.kancloud.cn/2016-04-08_5707637171362.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://box.kancloud.cn/2016-04-08_5707637194596.png)](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 应用通信