Issue
Online web users are not generating sessions in Amplitude. The analytics_session_id is missing from the browser's Local Storage, resulting in events not being grouped into sessions downstream. The Amplitude web plugin script appears to load successfully on the network, but no session ID is generated locally or appended to outgoing events.
Product
Segment
Environment
Segment Console
Cause
For the Amplitude (Actions) destination to automatically generate and track sessions on the web via Analytics.js 2.0, the Session Plugin mapping must be explicitly configured and enabled in the destination settings.
If this mapping is missing (for example, if only a "Log Event" mapping is configured), the plugin will remain dormant. Although the browser may download the plugin script successfully, it will not execute or create the analytics_session_id key in Local Storage without the specific Web action mapping instructing it to trigger.
Resolution
To resolve this and start generating sessions, you need to add the missing Session Plugin mapping to your destination:
- Navigate to your Amplitude (Actions) destination within the Segment Console.
- Go to the Mappings tab and click New Mapping.
- Under the Available Actions list, select Session Plugin.
- Leave the default Trigger conditions in place (this typically includes type = "track" or type = "identify" or type = "group" or type = "page" or type = "alias").
- Click Save and ensure the mapping is toggled to Enabled.
Once enabled, Analytics.js will trigger the plugin on your site, generate the analytics_session_id in your users' Local Storage, and automatically append it to your outgoing events.
Additional Information
- Destination Filters: If you have a Destination Filter configured to drop specific events (like Page or Identify calls) from reaching Amplitude, the Session Plugin will still process those events in the browser to accurately calculate session lengths before they are filtered out, provided the Session Plugin mapping's trigger conditions are broad enough to catch them.
- Consent Management Conflicts: If the issue persists after enabling the mapping, check your Consent Management configuration or the integrations object in your raw payloads. If the payload sets All: false or incorrectly sets the Amplitude integration name to session_id, the events will be blocked from reaching the plugin entirely.