This post is supposed to give you a basic knowledge of what Google Analytics has to provide you with and how you can implement the same in your app.

Google Analytics is a free tool that provides statistics for your blog or app. How many people accessed your app, how many liked a particular feature, which browser was the favorite (I like this the most, this gives you a proof that WOHOOO!!! NO MORE HANDLING IE BUGS 😉 hopefully 😀 ), did people like your new feature, did anyone actually did what you wanted them to do , eg. Actually access the payment page and click on the pay button in your e-commerce website. All this analysis can be done by reading the data on Google Analytics website once you have integrated analytics in your app.



  1. Create a new Google Analytics account.
  2. Set up a property once you login. This provides you a unique trackingID for your app. You can make a selection on the type of app you have (web/mobile).


This is what you get:



Yes, it is as simple as that. You just have to paste this in your code and google is tracking your site already.

Before we look into anything else, here are few terminologies, we must be aware of:


The above code snippet by default handles all page views of your website. Default title of your page is sent unless explicitly specified.




Once the property is created, we can start seeing the reports by clicking on Reporting in the top menu.

The menu on the left has various options that shows the site data. For example, the diagram shows several options for you to be able to see your data in different categories.


The data that we get from these can further be filtered. For example, browser data can further be used to learn about the different versions of each browser by clicking on the browser name in the result.

Other options include OS, screen resolution, etc. We can also see data filtered from one date to another.

The above are some very intuitive reporting categories which one can learn as and when we have some metric.


Event Tracking

Event tracking allows you to measure how users interact with the content of your website.For example, there may be cases a button is so important that we are interested in how many people clicked that very important button.

All you have to do is send the eventName to google something like this:

ga(‘send’, ‘event’, category, action, *label, *value)

eg., ga(‘send’, ‘event’, ‘button’, ‘click’, ‘nav buttons’, 4);


  • button is the category
  • click is the action
  • nav buttons is the label
  • 4 is the value

*Label and Value are not always required.

You will be able to see your data in reports based on whatever type you send category, label, action as mentioned above.


Google generally takes time to reflect the data, so you may immediately not be able to see the data. But the left menu has an alternative for this. There is a “Real time” option available that shows you the live data, not all types of data, but we can still start analyzing right away.


You can send custom dimension as well which you can used as a secondary filter in your reports. For example, you want to differentiate between the page accesses by the site admin and normal users. You can set a userType as custom dimension and once you see your pageviews or events, you can further filter it based on the “userType” as secondary filter.

ga(‘set’, ‘dimension5’, ‘custom data’);


More about dimensions:



Goals are used to track conversions in Google Analytics. If for example, on your e-commerce site, you know the user has successfully used your website when he lands on your “thank you payment done” page, that is what your goal is. For that to happen:

  1. He visits your home page.
  2. Signs up/logs in
  3. Views the catalogue. Adds an item to cart.
  4. Does the payment from the payment page.
  5. And then lands on the “THANK YOU” page maybe.

Now that is how you set goals for your website.

Go to admin page from the top menu. Select goals.


This is how you create a new goal.


You can select the type of your goal based on:

  1. Destination – Does it end when a particular page is hit.
  2. Duration – When certain time is spent on your website or an event is triggered, etc.

There are several other options provided to you when you create your goal.

In the next step, several other fields need to filled, like you destination page in case of a destination goal type, etc. You can then select if you want to create a funnel (Funnels are discussed later in the article) and mention the intermediate stages in your funnel.


You can also verify your goal and check how the goal would have converted based on your data from the past 7 days.

You can now track your goal in the “Conversions” link within the main Google Analytics interface.



While this landing on the “THANK YOU” works 99% of the time, but even if someone hits your “THANK YOU” page randomly, you might be thinking a goal conversion is happening.

There is another method which allows you not have that extra page and hence avoid the fake conversion. A virtual page view may help in these cases. This is how you setup a virtual page view:

ga (‘send’, ‘pageView’, {‘page’: “virtualPageUrl”, ‘title’: “A virtual page” });

This may be helpful when you want to consider an event (not an actual pageview) as one of your goal conversion step.

All you have to do, send a ‘pageview’ along with a fake url/ string when the event triggers and use the same “virtual url” when setting up your goal.

When you create a goal, conversion is never 100% obviously. You need to know what is not letting the conversion to happen. For example, which page is the user not continuing after, which is the last event/virtual page user is trigerring and then dropping off.

This is where funnels come into picture. You can visualize the funnel associated with a goal, know where is the user dropping off, and never returning back and hence modify your app to improve customer experience and try for a 100% conversion.


Funnels help us see this process (or processes) easily, by giving us a visual representation of the conversion data between each step. This allows us to:

  • Determine what steps are causing customer confusion or trouble.
  • Figure out what language or copy might be altering our customer’s emotional behavior during checkout or sign up.
  • To be aware of bugs, browser issues and other technical nuisances.

Virtual page views are an important feature because funnel can be created only with page views not events, so in a case where an event plays an important role in your goal, it would be better to send a virtual pageview and specify it in your goal for funneling to happen correctly.

This video explains certain more points about goals and funnels:



This was just an introduction to what Google Analytics has to provide. There are an ample number of features that Google Analytics has to offer. As and when you start implementing, you will come across more and more usecases in which you can visualize your data in Google Analytics and take decisions for your app.