We're sorry, but anonymous users are not allowed to create a new post.
Please Login or Register a new account.
Artboard 2 Q&A Artboard 2 copy 2Ideas Artboard 2 copyHelp Center
  • Log In
  • Home
  • Data Management

We've been hard at work — check out our latest product updates.

question
avatar image
dimitriosl asked · Jun 05 at 01:38 PM

Merging two different sessions, from different browsers

Hello,


I would like to hear your advice on a use-case that has been troubling me.

We have two different flows. In the first one, the user navigates through our subdomains (website, blog, more). That works, everything is smooth.

Now we also introduced a different flow. We have a desktop app, which redirects to the blog. Since this electron app opens in a complete different 'browser', there is no connection by cookies. What I did was to extract the distinct id and pass it along in the URL.

(Please notice that all of the above are being done with anonymous users.)

Here's the issue. Someone lands in the blog - if the URL has the id key i mentioned before, I call `mixpanel.identify(some-id)`. Now I have grouped all the desktop app actions, along with whatever happens next.

Unfortunately, I'll be missing anything that happened before. For example the initial navigation in the website (navigation events, referrer, etc). What I've done is to use the desktop app's session, as opposed to the one from the cookies.

What I would like to happen, is to merge everything in a single timeline.


How should I approach this?


---


I was thinking of something like


mixpanel.init(config.mixpanelToken, {
  loaded: function(mixpanel) {
    var params = new URLSearchParams(window.location.search);
    var idFromParams = params.get("someId");
    var idFromSession = mixpanel.get_distinct_id();

    if (idFromParams) {
      mixpanel.alias(idFromSession, idFromParams);
      mixpanel.identify(idFromParams);
    }
}
identity_managementidentifytrack
Comment

People who like this

0 Show 0
5 |600 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 8 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.

1 Answer
avatar image
fredl answered · Jun 11 at 05:07 PM

Hi @dimitriosl, it looks like you have the right idea to alias the anonymous users from your desktop app and pass it through to identify on the web version.

I am not sure what library you are using on your desktop but I thought I share their API documentation to help with Identity management in the case that you are doing a hybrid implementation (server-side and client-side libraries). They have sections on identity management and they also have this helpful article on hybrid server-side implementations.


Comment

People who like this

0 Show 0 · Share
5 |600 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 8 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.


question details

1 Person is following this question.

avatar image
Answers Answers and Comments

Related Questions

Alias and Identify in a (React) Native App 1 Answer

$user_id is 'undefined' after implementing alias to track registration funnel 1 Answer

Alias kinda working 3 Answers

Alias and identify on different apps but with same GTM/mixpanel snippet 1 Answer

alias after the fact? 3 Answers

Features
  • Engagement
  • Retention
  • Funnels
  • People
  • Automatic Insights
  • Mobile A/B Testing
  • Messages
  • Infrastructure
  • Platform
  • JQL
Solutions
  • Enterprise
  • SaaS
  • Financial Services
  • Consumer Tech
  • Media & Entertainment
  • Telecommunications
  • Retail & E-commerce
  • Product
  • Marketing
  • Analytics
  • Professional Services
Resources
  • Help Center
  • Mixpanel Blog
  • Case Studies
  • Reports
  • Product Updates
  • Events & Webinars
  • Pricing
  • Partners
  • Trends
  • API & Developers
  • Live Webinars
Company
  • About us
  • Careers
  • Legal
  • Contact us
Follow

  • Anonymous
  • Log In
  • Create
  • Ask a question
  • Post an idea
  • Spaces
  • Planning and Implementation Spec
  • Data Management
  • Sending data to Mixpanel
  • Building Analysis Reports
  • Messages
  • Pulling data out of Mixpanel
  • Ideas
  • Tell us how you approach Analytic Strategies
  • Tell us how you use Mixpanel
  • Project Admin
  • Questions about our Community Platform
  • Explore
  • Topics
  • Questions
  • Ideas
  • Users
  • Badges