Skip to content

Conversation

AnkitSegment
Copy link
Contributor

A summary of your pull request, including the what change you're making and why.

In Amplitude, I’ve updated the session plugin by setting hidden to false, allowing users to configure the session time and enable or disable allowSessionTracking. With this change, users can now also track session start and session end events.

Testing

Screenshot 2025-07-08 at 10 48 52 PM

Screenshot 2025-07-09 at 10 28 42 AM Screenshot 2025-07-09 at 10 28 52 AM

Include any additional information about the testing you have completed to
ensure your changes behave as expected. For a speedy review, please check
any of the tasks you completed below during your testing.

  • Added unit tests for new functionality
  • Tested end-to-end using the local server
  • [If destination is already live] Tested for backward compatibility of destination. Note: New required fields are a breaking change.
  • [Segmenters] Tested in the staging environment
  • [Segmenters] [If applicable for this change] Tested for regression with Hadron.

Copy link

codecov bot commented Jul 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.55%. Comparing base (0451a3d) to head (6d56ae7).
Report is 99 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3056      +/-   ##
==========================================
+ Coverage   78.07%   79.55%   +1.47%     
==========================================
  Files        1064     1125      +61     
  Lines       19612    20873    +1261     
  Branches     3767     4023     +256     
==========================================
+ Hits        15313    16606    +1293     
- Misses       3015     3572     +557     
+ Partials     1284      695     -589     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@@ -32,14 +52,53 @@ const action: BrowserActionDefinition<Settings, {}, Payload> = {
title: 'Session Plugin',
description: 'Generates a Session ID and attaches it to every Amplitude browser based event.',
platform: 'web',
hidden: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add any documentation and ask our customers not to disable this?

@joe-ayoub-segment joe-ayoub-segment self-assigned this Jul 18, 2025
default: false,
required: false,
description:
'Generate session start and session end events. This is useful for tracking user sessions. NOTE: This will generate a Segment track() event which will also get send to all Destinations connected to the JS Source'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'Generate session start and session end events. This is useful for tracking user sessions. NOTE: This will generate a Segment track() event which will also get send to all Destinations connected to the JS Source'
'Generate session start and session end track() events. These events will be sent to the Javascript Source and will be forwarded on to any connected Destinations.'

@@ -102,6 +102,14 @@ const destination: DestinationDefinition<Settings> = {
}
],
default: 'north_america'
},
trackSession: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this referenced? I don't see it referenced anywhere in this PR.

Copy link
Contributor

@joe-ayoub-segment joe-ayoub-segment left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @AnkitSegment this mostly looks good to me.
Please see inline comments.

I didn't understand why a new Setting field was added to the Cloud Mode Destination. Can you explain please?

@joe-ayoub-segment
Copy link
Contributor

I've asked some people with AJS knowledge to take a look at this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants