Giter VIP home page Giter VIP logo

galonga / xamarin-forms-analytics-wrapper Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 409 KB

Library which warps Google Analytics tracking to Xamarin.Forms (Android / iOS). Package also available on Nuget.

Home Page: https://galonga.de/xamarin-forms-analytics-wrapper/

License: MIT License

C# 97.84% Shell 0.50% F# 1.66%
analytics xamarin google-analytics xamarin-forms xamarin-android xamarin-ios xamarin-library xamarin-components

xamarin-forms-analytics-wrapper's Introduction

xamarin-forms-analytics-wrapper

What is this?

xamarin-forms-analytics-wrapper is a library which warps Google Analytics tracking to Xamarin.Forms.

I'm very eager about your feedback, so do not hesitate to create an issue or feel free to improve my code via a contribution.

Setup and Usage

  1. Install the package via nuget into your PCL and platform specific projects.
  2. Get your Analytics-Id (iOS AppDelegate.cs, Android: MainActivity.cs)
  3. Add the registration call to your platform specific main class (see sample).

Example Android implementation of the Init call:

protected override void OnCreate(Bundle bundle)
{
	base.OnCreate(bundle);
	Forms.Init(this, bundle);
	var gaService = AnalyticsService.GetGASInstance();
	gaService.Init("UA-12345675-1", this, 3);
	gaService.OptOut = false;
}

Example iOS implementation of the Init call:

public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions)
{
    Forms.Init();
    var gaService = AnalyticsService.GetGASInstance();
    gaService.Init("UA-12345675-2", 3);
    gaService.OptOut = false;
}

More examples on my blog.

FAKE options / Tasks

Execute bin/fake <taskname> to run a task or bin/fake --<optionname> for fake cli options. First run bin/fake install.

Available tasks:

* Restore
  Clean solution and afterwards restore all packages

* Build
  Build all projects of solution

Create Nuget Package

Add changes to xamarin-forms-analytics-wrapper.nuspec file and create package with following command:

nuget pack -Verbosity detailed -Prop Configuration=Release -Version 0.x.x

xamarin-forms-analytics-wrapper's People

Contributors

galonga avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

repoforks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.