Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Google AppEngine Analytics for Mobile Applications

branch: master
README.markdown

GAEMobileAnalytics is a mobile analytics app running on Google App Engine. It is still a work in progress.

There are 2 components available:

  • Server - coded in Python, runs on Google App Engine
  • Client - library available in Objective-C for iOS, and C# for Windows Phone 7

A demo can be found here.

Instruction for App Engine

  1. Get the source code here
  2. Register a new Google App Engine application here
  3. Use GoogleAppEngineLauncher to add this project as an existing application
  4. Open app.yaml and replace the application name with the one you just registered
  5. Open config.py and change gaemobileanalytics_api_key to any random characters you want. Make sure you keep this key private. Enter the same key in the client library
  6. Edit the following path if you do not want to use the default paths:
    • display_path
    • chart_path
    • chart_event_path
    • record_path
    • record_queue_path
    • record_event_path
    • record_event_queue_path
  7. Deploy and you should be ready for the client (iOS or WP7) integration

Instruction for iOS

A sample application is included in iOS/gaemobileanalytics.

To integrate GAEMobileAnalytics into your iOS application:

  1. Drag iOS/gaemobileanalytics/Classes/GAEMobileAnalytics.h and iOS/gaemobileanalytics/Classes/GAEMobileAnalytics.m into your XCode project
  2. Add #import "GAEMobileAnalytics.h" to your AppDelegate
  3. In your - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions method, add

    [[GAEMobileAnalytics defaultLogger] initWithApiKey: baseUrl: eventsUrl:];

    replace with gaemobileanalytics_api_key in config.py
    replace with hostname+record_path in config.py .e.g http://myapp.appspot.com/log
    replace with hostname+record_path in config.py .e.g http://myapp.appspot.com/log/event

  4. Use [[GAEMobileAnalytics defaultLogger] logEvent: parameters: discreet:] to log events

You can find more information about the instruction above in the sample application

Instruction for Windows Phone 7

Logger.OnApplicationStarted(...)

  • call this everytime the app is started
  • this method gives the bare minimum analytics:
    • number of sessions daily
    • number of downloads daily
    • distribution of phone models

Logger.LogEvent(string eventName, Dictionary parameters)

  • call this method to log event
  • group similar events with the same eventName
  • you can track multiple parameters
  • example : tracking facebook/twitter button with share/view option

    Dictionary parameters = new Dictionary();
    parameters.Add("title","twitter");
    parameters.Add("action", "share");
    Logger.LogEvent("BUTTON_CLICKED", parameters);
    OR
    Dictionary parameters = new Dictionary();
    parameters.Add("title","twitter");
    parameters.Add("action", "view");
    Logger.LogEvent("BUTTON_CLICKED", parameters);
    OR
    Dictionary parameters = new Dictionary();
    parameters.Add("title","facebook");
    parameters.Add("action", "share");
    Logger.LogEvent("BUTTON_CLICKED", parameters);

  • example : track failure of action by phone model Dictionary parameters = new Dictionary(); parameters.Add("phone",Info.DeviceName()); Logger.LogEvent("FAILED_TO_OBTAIN_DATA", parameters);

Dependencies

  • pytz

About me

I make apps for iPhone, iPad, Android, WP7 and Google App Engine. Follow me in Twitter

Something went wrong with that request. Please try again.