iPhone Application Tracking through Google Analytics

Few days ago I’ve started writing blog post series for tracking mobile applications through google analytics. To start with i’ve written blog post on Android Application Tracking through Google Analytics. Now i’m going to explain iPhone application tracking through google analytics in simple steps.

iPhone Application Tracking through Google Analytics in just 3 Steps

Step 1 – First you’ll have to download Google Analytics SDK for iPhone, you can download it from here, then extract files and drag all the files from the library folder into your applications XCODE Project.

These files are GANTracker.h, libGoogleAnalytics.a and libGoogleAnalytics_NoThumb.a and also include CFNetwork framework in your project and link against libsqlite3.0.dylib.

Step 2 – You’ll have to setup new web property in google analytics, most likely fake profile but with full URL like http://myapp.mywebsite.com, then note down UA number of your tracking code and looks like UA-xxxxx-yy.

Step 3 – Implementing google analytics in iPhone application, you can track below activities as per your iPhone application,

  • Page View Level
  • Event Level
  • Custom Variable
  • Ecommerce Tracking

For Instance, We’ve implemented page view level and event tracking of google analytics for Fondly Yours iPhone app. It has 2 different categories i.e. Camera and Photo Library. We’ve implemented page view level tracking for different ca as with reference to below image.

Post card page of Fondly Yours

Let’s get started with Google Analytics iPhone Apps Tracking

Before starting implementing google analytics code, you’ll have to add below code to import the Google Analytics framework.

               #import "GANTracker.h"

Now you’ll have to initialize the tracker and make sure that you have the UA number handy. Add the following code into applicationDidFinishLaunching method.

[[GANTracker sharedTracker] startTrackerWithAccountID:@"UA-xxxxx-yy"
                dispatchPeriod:kGANDispatchPeriodSec//10
               delegate:nil];

Make sure that you replace sample UA number with your UA Number that you got while signing up for google analytics. The dispatchPeriod variable tells the tracker how often to report back to Google. Google suggests using 10 seconds in their example so we’ll also use the same.

Page view level implementation

With the help of page view level implementation for an application, you can have idea about unique page views / visitors of your application’s pages for setting section or help section.

For page view level information you’ll have to implement below standard code to across all the tabs or classes or pages of your application, as like we implement google analytics for website.

NSError *error;
if (![[GANTracker sharedTracker] trackPageview:@"/app_launched"
withError:&error]) {
// Handle error here
}

Make sure that you’ve include above code anywhere in your app where you want to track page view.

Note that the “app_launched” is essentially our page name similar to index.html or aboutus.php. Include the GANTrack.h file and change the page name for each new location.

Event tracking implementation

Through event tracking implementation helps you to get idea about which actions i.e. play, pause or stop taken in iphone application.

For Instance, we’ve implemented event tracking to track details of which color theme chosen in Fondly Yours App i.e. red color or white color or blue color or share greetings or application via Facebook or Twitter with reference to below image.

Color Theme Selection of Fondly Yours

For event tracking implementation, you’ll have to add below code across the classes or functions of buttons.

NSError *error;
	if (![[GANTracker sharedTracker]
                  trackEvent:@"my_category"
                  action:@"my_action"
                  label:@"my_label"
                  value:-1
         withError:&error]) {
	// Handle error here
}

Tracking Tabs / Pages / Classes of Application

If you want to track different sections / tabs of your application, then you should use trackPageview function over the sections. You can see the below example,

NSError *error;
if (![[GANTracker sharedTracker] trackPageview:@"/help" 

// for tracking help section
       withError:&error]) {

 // Handle error here
}

Google Analytics Reports for iPhone Applications

After google analytics implementation for iPhone application successfully, you can view the analytics report for your application in your google analytics account. You can see the Top content Section report that includes bounce rate and unique page views for the iPhone application in below image.

Google Analytics Top Content Report for iPhone Application

You can view page level performance of your iphone application in google analytics with detailed information like bounce rate, unique page views, avg. time on site etc in below image.

Google Analytics Page level performance Report for iPhone Application

You can view click event data of buttons in top event section, which shows number of unique events and total events in below image.

Google Analytics Event Performance Report of iPhone Application

In next series of mobile apps tracking blog post, I’ll be covering Blackberry Application Tracking through Google Analytics. Stay tuned here for more updates on Google Analytics Implementation for mobile applications.

Feel free to share your suggestion and feedback in comment section.

Looking for  a Mobile App Analytics Consultant? Get in touch with us

[Image Courtesy by SilverTouch Technologies]
The following two tabs change content below.
Dipali
Dipali Thakkar is working as Technical Associate at Tatvic. She has more than 4 years of experience in SEO, PPC and Social Media. Google Plus Profile:
,
Previous Post
Asynchronous code enhancement for Outbound Link Tracking Google Analytics
Next Post
Ruling the 3 seconds rule for improving usability of your website

No results found.

1 Comment. Leave new

  • hey thanks for the detailed post Dipali.
    One question: do we have a URL builder for iOS?

    (android has one: http://code.google.com/apis/analytics/docs/mobile/android.html#android-market-tracking)

    Reply

Leave a Reply

Your email address will not be published.

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed

Menu