Skip to content

Allow disabling session events for the AmplitudeSessionPlugin #1109

@frzkn

Description

@frzkn

Summary

The AmplitudeSessionPlugin currently emits session_start and session_end track events in addition to enriching all events with session_id.

According to Amplitude's documentation, the session_id property is the primary
mechanism for session tracking
, while the start/end events are optional. Amplitude staff has
confirmed
that sessions work correctly without these events.

For high-volume applications, these events can represent a big chunk of total Segment API calls. I'd like the ability to disable the event emission while retaining session_id enrichment.

Proposed Solution

Add a disableSessionEvents configuration option:

interface AmplitudeSessionPluginConfig {
  /**
   * When true, suppresses 'session_start' and 'session_end' track events.
   * The session_id will still be attached to all events via integrations.
   *
   * @default false
   */
  disableSessionEvents?: boolean;
}

// Usage
segmentClient.add({
  plugin: new AmplitudeSessionPlugin({ disableSessionEvents: true })
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions