Giter Site home page Giter Site logo

bneasygoogleanalytics's Introduction

BNEasyGoogleAnalytics

[CI Status](https://travis-ci.org/Ben Nicholas/BNEasyGoogleAnalytics) Version License Platform

An improved interface to Google Analytics

Introduction

Google's Analytics products are wonderful, but the iOS SDK doesn't have a very native feeling Objective C api. This library intends to create a much more enjoyable interface to that same trusted functionality underneath.

Setup

CocoaPods is the only distrobution method supported, but if you need to use it otherwise, the code shouldn't be too hard to integrate manually. Otherwise, add this line to your podfile and you should be all set:

pod 'BNEasyGoogleAnalytics'

Once you've got the code in place, getting tracking in place is as easy as calling one method in your app delegate's didFinishLaunching method, as described below:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Initialize Google Analytics tracking
    [BNEasyGoogleAnalyticsTracker startWithTrackingId:@"<#Tracking ID#>"];

    ...The rest of your customizations...
}

Don't forget to fill in your tracking ID as provided by Google. This should be placed towards the top of the didFinishLaunching method, as any other operation using the tracker requires this initial setup before being called.

Usage

Where needed, get the shared tracker and track whatever has just happened. For example, a common use case is tracking a screen hit when viewWillAppear is called.

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    
    [[BNEasyGoogleAnalyticsTracker sharedTracker] trackScreenNamed:@"My Screen"];
}

There is currently also support for tracking custom events, exceptions, social interactions and timings. For now, reference the tests to see how to use these methods.

Contribution

Development and issues are tracked here on Github. Pull requests are welcomed.

Contribution Guidelines

  • Please use spaces when indenting, 4 at a time.
  • Test whatever seems reasonable when adding functionality.
  • Pull requests should be developed on a feature branch.
  • Add yourself to the contributors list if this if your first contribution to the project.

Credits

BNEasyGoogleAnalytics is brought to you by Brand Networks, Inc. and the contributors listed below.

Contributors

License

BNEasyGoogleAnalytics is available under the apache 2 license.

bneasygoogleanalytics's People

Contributors

bmnick avatar

Watchers

 avatar  avatar

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.