Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

Analytics 2.0 session_id reset #666

Open
luigi7up opened this issue Feb 15, 2022 · 0 comments
Open

Analytics 2.0 session_id reset #666

luigi7up opened this issue Feb 15, 2022 · 0 comments

Comments

@luigi7up
Copy link

Hi everyone, I'm using Analytics 2.0 in my VUE js app that sends data to Amplitude Actions destination. I can see that the analytics 2.0 is managing the session_id unlike the Analyitics 1.0 which is a great out-of-a-box feature for those integrating with Amplitude.

Nevertheless, I want to manually reset the session_id as part of the user's logout() and I am unable to do so...

According the Segment docs this should be possible by providing an object integrations in the Track or Identify calls

window.analytics.identify(currentUser.id, {
        name: name,
        email: email,
        ab_test: ab_tests,
      },{
          integrations: {
            "Actions Amplitude": {
              session_id: 1644915970111
            },"Amplitude": {
              session_id: 1644915970111
            }
          }
      });

I tried passing both integrations.Actions Amplitude.session_id and integrations.Amplitude.session_id value manually to override the one that Analytics 2.0 sets manually, but it still doesn't send my custom value neither to Segment or Amplitude

Also, I tried calling window.analytics.reset() but it doesn't seem to affect the sesison_id

Could you please help me with the correct approach to achieving a new session_id each time a user logs in / logs out?

Thank you

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

No branches or pull requests

1 participant