Collecting Analytics

Now that our site is up and running, we need to start collecting metrics to understand how it is being used. Metrics are key to operating a web application.

Google Analytics has many facets; the main three are as follows:

  1. Acquisition, which measures how visitors arrive at your website
  2. Behavior, which measures how visitors interact with your website
  3. Conversions, which measures how visitors completed various goals on your website

Here's a look at the Behavior | Overview from my website TheJavaScriptPromise.com:

Google Analytics Behavior Overview

TheJavaScriptPromise.com is a simple one page HTML site, so the metrics are quite simple. Let's go over the various metrics on the screen:

  1. Pageviews show the number of visitors
  2. Unique Pageviews show the number of unique visitors
  3. Avg. Time on Page shows the amount of time each user spent on the site
  4. Bounce Rate shows that users left the site without navigating to a subpage or interacting with the site in any manner, such as clicking on a link or button with a custom event
  5. % Exit indicates how often users leave the site after viewing a particular or set of pages

At high-level, in 2017, the site had about 1,090 unique visitors and on an average, each visitor spent about 2.5 minutes or 157 seconds on the site. Given that this is just a one page site, bounce rate and % exit metrics do not apply in any meaningful manner. Later, we will use these numbers to calculate the Cost Per User.

In addition to page views, Google Analytics can also capture specific events, such as clicking on a button that triggers a server request. These events can then be viewed on the Events | Overview page, as shown:

Google Analytics Events Overview

It is possible to capture metrics on the server side as well, but this will give requests-over-time statistics. You will need additional code and state management to track the behavior of a particular user, so you can calculate users-over-time statistics. By implementing such tracking on the client side with Google Analytics, you gain a far more detailed understanding where the user came from, what they did, if they succeeded or not and when they left your app without adding unnecessary code complexity and infrastructure load to your backend.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.4.181