• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

KSemenenko/GoogleAnalyticsForXamarinForms: Google Analytics Plugin for Xamarin F ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

KSemenenko/GoogleAnalyticsForXamarinForms

开源软件地址(OpenSource Url):

https://github.com/KSemenenko/GoogleAnalyticsForXamarinForms

开源编程语言(OpenSource Language):

C# 100.0%

开源软件介绍(OpenSource Introduction):

Google Analytics Plugin for Xamarin and Windows

This project is a cross platform library for Xamarin Forms, which enables a handy use of Google Analytics in your applications.
I've decided that there should be a broad-based library with no connection to native libraries Google in Xamarin (too long to install).

Should you have any comments or suggestions, please let me know. Let's make it an easy-to-use tool for our projects.

Additional thanks to the project that inspired me:

Available at NuGet.

https://www.nuget.org/packages/ksemenenko.GoogleAnalytics/

Build status

Build status Build status

Platform Supported Version
Xamarin.iOS Yes iOS 6+
Xamarin.iOS Unified Yes iOS 6+
Xamarin.Android Yes API 10+
Windows Phone 8 Yes 8.0+
Windows Phone 8.1 Yes 8.1+
Windows Store Yes 8.1+
Windows 10 UWP Yes 10+
Xamarin.Mac Partial

Example use:

Init:

GoogleAnalytics.Current.Config.TrackingId = "UA-11111111-1";
GoogleAnalytics.Current.Config.AppId = "AppID";
GoogleAnalytics.Current.Config.AppName = "TEST";
GoogleAnalytics.Current.Config.AppVersion = "1.0.0.0";
//GoogleAnalytics.Current.Config.Debug = true;
//For tracking install and starts app, you can change default event properties:
//GoogleAnalytics.Current.Config.ServiceCategoryName = "App";
//GoogleAnalytics.Current.Config.InstallMessage = "Install";
//GoogleAnalytics.Current.Config.StartMessage = "Start";
//GoogleAnalytics.Current.Config.AppInstallerId = "someID"; // for custom installer id
GoogleAnalytics.Current.InitTracker();
           
//Track view
GoogleAnalytics.Current.Tracker.SendView("MainPage");

Track:

GoogleAnalytics.Current.Tracker.SendView("MainPage");
GoogleAnalytics.Current.Tracker.SendEvent("Category", "Action", "Label", 1);
GoogleAnalytics.Current.Tracker.SendEvent("Category", "Action");

Other way:

var trackerManager = new TrackerManager(new PlatformInfoProvider()
{
    ScreenResolution = new Dimensions(1920, 1080),
    UserAgent = "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko",
    UserLanguage = "en-us",
    ViewPortResolution = new Dimensions(1920, 1080)
});

tracker = trackerManager.GetTracker("UA-11111111-1"); 
tracker.AppName = "My app";
tracker.AppVersion = "1.0.0.0";

// Log something to Google Analytics
tracker.SendView("MainPage");



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap