We all know the benefits of Google analytic's for the websites specially when it comes to strategic business planning. The popularity of Google analytic's in web technologies are wide but in the current era of mobile technologies it is got more important for businesses to understand and track the user activities from the mobile app. As now a day's mobile apps are the preferred choice than using a website. By understanding the current trend for the mobile apps many businesses adopted to become mobile first and successfully stared delivering their services over mobile apps.
Mobile apps provide deeper insights than the websites. Every business is encouraged to adopt Google analytic's for understanding their customers and getting useful information for the business.
Following are the common practices we follow in the mobile apps using Google Analytic's:
1. Screen Views :
Screen views is the standard means of measuring total number of active users on the particular screen of the app.
Setting up screen views:
// Get tracker. Tracker t = ((AnalyticsSampleApp) getActivity().getApplication()).getTracker( TrackerName.APP_TRACKER); // Set screen name. t.setScreenName(screenName); // Send a screen view. t.send(new HitBuilders.ScreenViewBuilder().build());
2. Events tracking :
In Analytics, events are designed to track user interaction to that doesn’t map to screenviews, like hitting buy in a e-commerce app. This maps very well to app usage — Any form of interaction, from hitting certain buttons to adding/removing products from the cart, can be tracked using Events.
Setting up events:
// Get tracker. Tracker t = ((AnalyticsSampleApp) getActivity().getApplication()).getTracker( TrackerName.APP_TRACKER); // Build and send an Event. t.send(new HitBuilders.EventBuilder() .setCategory(getString(categoryId)) .setAction(getString(actionId)) .setLabel(getString(labelId)) .build());
3. Sessions Management :
We can track a particular session for the user activity. Lets take an example of e-commerce application where analytics can determine how much time is user spending in a jeans section or particular product category which gives us an insight of user interest in the products.
Setting up automatic session:
tracking.xml
<resources>
<integer name="ga_sessionTimeout">300</integer>
</resources>
Setting up manual session:
// Get tracker. Tracker t = ((AnalyticsSampleApp) getActivity().getApplication()).getTracker( TrackerName.APP_TRACKER); // Set screen name. t.setScreenName(screenName); // Start a new session with the hit. t.send(new HitBuilders.ScreenViewBuilder() .setNewSession() .build());
4. Social interactions :
It becomes much easier to track social activities of the user with Google analytics. This might help to understand interests of the user.
Setting up social interactions:
// Get tracker. Tracker t = ((AnalyticsSampleApp) getActivity().getApplication()).getTracker( TrackerName.APP_TRACKER); // Build and send social interaction. t.send(new HitBuilders.SocialBuilder() .setNetwork(getSocialNetwork()) .setAction(getSocialAction()) .setTarget(getSocialTarget()) .build());
5. User tracking :
When user is known to the app analytics should know id representing that user with all the Google analytics activities such as screenviews, events, e-commerce transactions, etc.. using the user id field.
Setting up User tracking:
public void onUserSignIn(User user) { Tracker t = GoogleAnalytics.getInstance(context).newTracker("UA-XXXX-Y"); // You only need to set User ID on a tracker once. By setting it on the tracker, the ID will be // sent with all subsequent hits. t.set("&uid", user.getId()); // This hit will be sent with the User ID value and be visible in User-ID-enabled views (profiles). t.send(new HitBuilders.EventBuilder().setCategory("UX").setAction("User Sign In").build()); }
6. User Timings :
This is useful tracking user and its app using timings and manage traffic accordingly. User timing could help great in panning offers sell strategy in context with e-commerce business.
Setting up User timings tracking:
// Get tracker. Tracker t = ((AnalyticsSampleApp) getActivity().getApplication()).getTracker( TrackerName.APP_TRACKER); // Build and send timing. t.send(new HitBuilders.TimingBuilder() .setCategory(getTimingCategory()) .setValue(getTimingInterval()) .setVariable(getTimingName()) .setLabel(getTimingLabel()) .build());
There are may more great features analytics has which definitely helps to take your business strategies to the next level.