[ Web Proxy ]
URL:
Viewing: https://amplitude.com/track/sessions [Back]  [Original]

How to Track Sessions on Your Website | Amplitude
Amplitude

How to Track Sessions

Start tracking sessions by installing a simple SDK on your website. With one line of code, you can easily track sessions and other important events and metrics in your product.

Track sessions on your frontend

Tracking sessions and other events and metrics in your product is crucial for understanding user behavior and web performance. This guide provides step-by-step instructions for tracking sessions on your website, no matter which framework or CMS you use.


Steps to track sessions

Step 1

Create an Amplitude account

Create account
Step 2

Install the browser SDK by putting the script between the <head> tags of your website.

<script src="https://cdn.amplitude.com/script/AMPLITUDE_API_KEY.js"></script>

<script>
  window.amplitude.init('AMPLITUDE_API_KEY', {
    fetchRemoteConfig: true,
    autocapture: true
  });
</script>
Get the script
Step 3

Validate that your website is passing data to Amplitude.

Step 4

Create a chart and add the data you would like to visualize.

Ready to track sessions with Amplitude?

Want to explore other tracking options?

Track other events and metrics

Events

Link clicks

Page views

Navigation clicks

File downloads

Session duration

Form submits

Button clicks

Metrics

Conversions

Average revenue per user

Retention rate

Feature usage

Daily active users

Monthly active users

Funnel drop-off

Conversion rate

Sessions

Cart abandonment

Churn rate

Weekly active users

Track sessions on your platform

Content management system (CMS)

Hubspot

Drupal

Typo3

Wix

Wordpress

Sanity

Squarespace

Magento

Webflow

Shopify

Frameworks and libraries

Next.js

Vue.js

Backbone.js

React

Angular

D3.js

Ember.js

Svelte

Javascript

Meteor.js

Frequently asked questions

What is Amplitude?

Amplitude is a leading digital analytics platform that helps companies unlock the power of their products. Amplitude guides companies every step of the way as they capture data they can trust, uncover clear insights about customer behavior, and take faster action. When teams understand how people are using their products, they can deliver better product experiences that drive growth.

What is web analytics?

Web analytics is a collection of tools that collect, measure, and analyze various metrics and user behavior on a website to offer insights into web performance, user engagement, user experience, and conversions. These insights help you understand how users interact with your site, which pages they visit, how long they stay, and what actions they take. Web analytics enables companies to improve web usability, content relevance, conversion rates, and overall user experiences to achieve business goals.

Amplitude helps you go further with web analytics, with access to Web Experimentation, Session Replay, audience management, campaign reporting, and data tables. Using our Digital Analytics Platform, you can unify insights across the entire customer journey and empower teams to drive growth.

Is Amplitude free?

Yes, Amplitude is free to get started, with no time limit and no credit card required. The free Starter plan includes 2 million events per month, plus out-of-the-box Analytics, Session Replay, limited Experimentation, Guides and Surveys, and AI Agents with MCP access, all at no cost.

What is a session?

A session represents a period of continuous activity by a user on a website or app, typically ending after 30 minutes of inactivity.

Get set up with one line of code

No need for tracking plans, engineering, or long hours to start gathering customer insights.


Web Proxy Viewer  |  New URL  |  Original Page