 Discoverability helps get customers to your site, but how can you measure their behaviors once they get there? Hi, I'm Sarah Clark, and I'm here to introduce you to Site Analytics. We want to know what users are doing on our site, which pages are popular, whether users follow the paths we expect, and if anything goes wrong. Analytics is all about collecting measurements of user activity on the site. Google Analytics is a service that collects, processes, and reports data about an application's use patterns and performance. Adding Google Analytics to a web application enables the collection of data like visitor traffic, user agent, the user's location, et cetera. This data is sent to Google Analytics servers where it is processed. The reports are available in the Google Analytics web interface and through a reporting API. Google Analytics is free and highly customizable. Integrating Google Analytics is simple. First, you must create a Google Analytics account. Each account has properties. These are JavaScript properties, but refer to individual applications or websites. Google Analytics then generates a tracking snippet for each property. This is a piece of JavaScript that you paste into your page. It sends data to Google Analytics back end. You can also use the Analytics library to create custom analytics, such as tracking specific user actions or tracking push notifications. I want to say a bit more about properties. An account has properties that represent individual collections of data. These properties have property IDs, also called tracking IDs, that identify them to Google Analytics. If an account represents a company, one property in that account might represent the company's website, while another property might represent the company's mobile app. If you only have one app, the simplest scenario is to create a single Google Analytics account and add a single property to that account. The analytics server will then generate a custom bit of JavaScript matching your account and property. This is the tracking snippet. This is the key part of the tracking snippet. The entire snippet needs to be pasted into every page you want to track. At a high level, when this script runs, it creates an async script tag that downloads analytics.js, the Analytics library, defines the GA function called the command queue, creates a tracker that gathers user data, and sends this data as a page view hit via HTTP request to Google Analytics. This data is analyzed and stored in your Analytics account. In addition to the data gathered by tracker creation, the page view event allows Google Analytics to infer what pages the user is visiting, how long they are visiting them, and in what order. For simpler applications, this is the only coding required. Note that you can replace analytics.js with analytics underscore debug.js for console debugging. Using this version will log detailed messages to the console for each hit sent. It also logs warnings and errors for your tracking code. The data is sent to Google Analytics back end where it is processed into reports. These reports are available through the Google Analytics dashboard. Here is the audience overview interface. Here you can see general information such as page view records, bounce rate, ratio of new and returning visitors, and other statistics. It's also possible to view analytics information in real time. This interface allows you to see hits as they occur on your site. I encourage you to take some time and explore. There's an extensive set of features in the dashboard. You should explore the standard reports and look at creating your own. Knowing how to use analytics effectively is a skill in itself. Fortunately, the Google Analytics Academy offers a free set of online courses. I encourage you to install analytics on some of your sites if you haven't already. Check out the free Analytics Academy courses as well. Then, once you're comfortable with analytics, come back, and I'll show you how to integrate analytics into a PWA. Thanks for watching, and I'll see you soon.