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); } }