SlideShare una empresa de Scribd logo
1 de 14
MOBILE GOOGLE
ANALYTICS
A Quickstart for Android




                           Prepared by: Michael Angelo M. Rivera
                           Date: October 25, 2012
What it does?

• The number of active users are using their applications.
• From where in the world the application is being used.
• Adoption and usage of specific features.
• In-app purchases and transactions.
• And many other useful metrics...
How to get it?

• Download the Google Analytics library for Android in
 resource website (Google it).

       OR

• Update use the Android SDK Manager to get the Google
 Analytics SDK.
  • - Check the android-sdk/extras/google /*
Sign up for an account
• Sign up for Google Analytics if you don't already have an
 account.

• Create a new UA, also known as a Web property ID.
 Once you are signed into Google Analytics you will see a
 drop down list in the top right corner. Select "Create new
 account" and follow the steps provided. Google
 documentation suggests "using a fake but descriptive
 website URL (e.g. http://mymobapp.mywebsite.com)".
 Whatever you choose is entirely up to you.

• Write the UA or go back to your profile page to access it.
Add the GA library file

• In Eclipse right click on your project (control + click for
 OSX) and select Properties. Choose Java Build Path and
 then select the Libraries tab. Then you will need to select
 the Add External JARs button and navigate to where you
 saved the library on your computer.
Add permissions

• Add the following permissions to your
 AndroidManifest.xml file.

      android.permission.INTERNET
      android.permission.ACCESS_NETWORK_STATE
How to use it ?
• Obtain tracker instance and start in manual mode, usually
 done in onCreate(Bundle savedInstanceState)

mAnalyticsTracker = GoogleAnalyticsTracker.getInstance();
mAnalyticsTracker.start("insert_UA", this);

*If you start the tracker in manual mode you will need to
call dispatch() to fire off the tracking events. This call is not
required if you passed a time interval to the start call.

       mAnalyticsTracker.dispatch();
How to use it ?
• You can also start the tracker with a dispatch interval by
 specifying a seconds parameter. The following code will
 dispatch request every 60s.

       mAnalyticsTracker.start("insert_UA", 60, this);



*insert_UA - is your web property ID from your profile that
you created.
How to use it ?
• The Google documentation suggests using
 trackPageView as the best way to track which areas of
 your application are being viewed by users.

      Say we want to track when the users view the help
screen, we simply pass HelpScreen.

      mAnalyticsTracker.trackPageView("/HelpScreen");

*The string value passed to trackPageView is entirely up to
you.
How to use it ?
• Tracking click events:


public void sayHelloButtonPressed(View v) {
  welcomeView.setText("Welcome, user!");
  tracker.trackEvent("FirstActivity", "sayHello", "", -1);
}

The trackEvent ,takes four parameters: the event’s
category, an action, a label, and a value. In the Google
Analytics interface events are grouped by categories, and
additionally may contain per-event labels
How to use it ?
• Finally, remember to stop the tracker when you no longer
 need it's services.

      mAnalyticsTracker.stop();

*usually called in your onDestroy()
Quick overview for iOS
• Drag GANTracker.h and libGoogleAnalytics.a from the
    SDK’s library directory into your project.
•   Add the CFNetwork framework and link against
    libsqlite3.0.dylib.
•   Initialize the tracker. Since we want to start tracking
    impressions and events immediately, the most logical
    place to put this initialization is in our application’s
    AppDelegate. Be sure to import GANTracker.h in your
    implementation file
•   Same thing trackPageView and or trackEvents
•   Stop the tracker in your dealloc method:

(No sample codes since, I’m not an iOS dev, so I guess you’ll understand anyway)
Lastly check the Dashboard
• Log in to Google Analytics website and see what is
 happening.
Done!
• For more info visit:


Android -
https://developers.google.com/analytics/devguides/collection/android/

IOS - https://developers.google.com/analytics/devguides/collection/ios/


General –
https://developers.google.com/mobile/articles/analytics_end_to_end

Más contenido relacionado

Destacado

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Mobile Analytics Android

  • 1. MOBILE GOOGLE ANALYTICS A Quickstart for Android Prepared by: Michael Angelo M. Rivera Date: October 25, 2012
  • 2. What it does? • The number of active users are using their applications. • From where in the world the application is being used. • Adoption and usage of specific features. • In-app purchases and transactions. • And many other useful metrics...
  • 3. How to get it? • Download the Google Analytics library for Android in resource website (Google it). OR • Update use the Android SDK Manager to get the Google Analytics SDK. • - Check the android-sdk/extras/google /*
  • 4. Sign up for an account • Sign up for Google Analytics if you don't already have an account. • Create a new UA, also known as a Web property ID. Once you are signed into Google Analytics you will see a drop down list in the top right corner. Select "Create new account" and follow the steps provided. Google documentation suggests "using a fake but descriptive website URL (e.g. http://mymobapp.mywebsite.com)". Whatever you choose is entirely up to you. • Write the UA or go back to your profile page to access it.
  • 5. Add the GA library file • In Eclipse right click on your project (control + click for OSX) and select Properties. Choose Java Build Path and then select the Libraries tab. Then you will need to select the Add External JARs button and navigate to where you saved the library on your computer.
  • 6. Add permissions • Add the following permissions to your AndroidManifest.xml file. android.permission.INTERNET android.permission.ACCESS_NETWORK_STATE
  • 7. How to use it ? • Obtain tracker instance and start in manual mode, usually done in onCreate(Bundle savedInstanceState) mAnalyticsTracker = GoogleAnalyticsTracker.getInstance(); mAnalyticsTracker.start("insert_UA", this); *If you start the tracker in manual mode you will need to call dispatch() to fire off the tracking events. This call is not required if you passed a time interval to the start call. mAnalyticsTracker.dispatch();
  • 8. How to use it ? • You can also start the tracker with a dispatch interval by specifying a seconds parameter. The following code will dispatch request every 60s. mAnalyticsTracker.start("insert_UA", 60, this); *insert_UA - is your web property ID from your profile that you created.
  • 9. How to use it ? • The Google documentation suggests using trackPageView as the best way to track which areas of your application are being viewed by users. Say we want to track when the users view the help screen, we simply pass HelpScreen. mAnalyticsTracker.trackPageView("/HelpScreen"); *The string value passed to trackPageView is entirely up to you.
  • 10. How to use it ? • Tracking click events: public void sayHelloButtonPressed(View v) { welcomeView.setText("Welcome, user!"); tracker.trackEvent("FirstActivity", "sayHello", "", -1); } The trackEvent ,takes four parameters: the event’s category, an action, a label, and a value. In the Google Analytics interface events are grouped by categories, and additionally may contain per-event labels
  • 11. How to use it ? • Finally, remember to stop the tracker when you no longer need it's services. mAnalyticsTracker.stop(); *usually called in your onDestroy()
  • 12. Quick overview for iOS • Drag GANTracker.h and libGoogleAnalytics.a from the SDK’s library directory into your project. • Add the CFNetwork framework and link against libsqlite3.0.dylib. • Initialize the tracker. Since we want to start tracking impressions and events immediately, the most logical place to put this initialization is in our application’s AppDelegate. Be sure to import GANTracker.h in your implementation file • Same thing trackPageView and or trackEvents • Stop the tracker in your dealloc method: (No sample codes since, I’m not an iOS dev, so I guess you’ll understand anyway)
  • 13. Lastly check the Dashboard • Log in to Google Analytics website and see what is happening.
  • 14. Done! • For more info visit: Android - https://developers.google.com/analytics/devguides/collection/android/ IOS - https://developers.google.com/analytics/devguides/collection/ios/ General – https://developers.google.com/mobile/articles/analytics_end_to_end