Web Analytics Overview
Web analytics lets you track and watch key measures for your website easily. It is different from product analytics because it's simpler and more direct, making it great for marketers, web site maintainers, or anyone familiar with tools like Google Analytics.
With Web Analytics and Statsig Dashboards you can easily gather insights such as number of visitors, views, sessions, how long sessions last, error rates, usage journey, and more.
Getting Started
Follow these simple steps to get started with Web Analytics.
Install Statsig script on your website
<script src="https://cdn.jsdelivr.net/npm/@statsig/js-client@3/build/statsig-js-client+session-replay+web-analytics.min.js?apikey=[YOUR_CLIENT_KEY]"></script>
Get YOUR_CLIENT_KEY from Project Settings -> Keys & Environments. Reveal the Client API Key, copy, and paste it over the [YOUR-API-KEY] in the snippet above
Release your changes
Once your changes are live, you'll start to see the events flowing in your metrics page: https://console.statsig.com/metrics/events
Event Capture
Out of the box, autocapture includes:
- Click events with click target info, current page url
auto_capture::click
- Page View Events with page url and query string values
auto_capture::page_view
- Page view duration, page scroll depth
auto_capture::page_view_end
- Form Submission Events
auto_capture::form_submit
- Page Performance data
auto_capture::performance
For more in-depth breakdown of auto capture event data, refer to Using Autocapture
For single page apps, or for more complex scenarios, look up how to log events using Javascript.
You can also disable a subset of these events from the Statsig console under Project Settings > Auto Capture
Exploring using Metrics Explorer
In Metrics Explorer, you can dig deeper and explore your events by using complex filters and dimensions. You can then explore your analysis to your dashboard.
More information on using Metrics Explorer like Funnels and Retention is here.
You can see some example autocapture event details here.
Advanced Setup
If you need to add additional configurations, metadata about the user, or want to access the full StatsigClient
to check feature gates and experiments or log events, you can used the advanced setup. The script tag above will automatically initialize the SDK, but if you remove your SDK key you can manually configure your integration.