My team and I are trying to integrate Segment into our site in a way that's compatible with Mixpanel. We are tracking page views with Segment's clientside Javascript library and user events with their backend Python library. Mixpanel requires that, when a user signs up, we make an alias() call from the frontend before we can make an identify() call. We're having trouble figuring out where this alias() call should be made from.
Our application is fairly complicated, with sign up forms in multiple places (some are in React, some are in Django). We also do not have any kind of "welcome" landing page that the user is redirected to after they make an account. Right now they're just redirected to the home page, which is how we would prefer to keep it. But this redirect doesn't allow us to conditionally make the Javascript alias() call from the home page after sign up. We could add a query to the redirect url with some boolean property that triggers the call, but we're considering that as a last resort.
My question is: if we aren't using a "welcome" page, where should we make this alias() call from?
Thank you.