COMMUNITY
  • Create
    • Ask a question
    • Post an idea
  • Spaces
    • Analytics Advice
    • Community Help
    • Debugging
    • Getting Started
    • Ideas
    • JQL
    • Topics
    • Questions
    • Ideas
    • Users
    • Badges
  • Log In
  • Home
  • Getting Started
question
avatar image
jpeck asked · Feb 08 at 11:00 PM

Where to call alias()?

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.

javascriptalias
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 · Write an Answer
avatar image
admin answered · Feb 09 at 03:56 AM · ACCEPTED ANSWER

Hi - here are a few ideas... maybe it can help you get on the right track:

1. As you mentioned, if the user is new, add something like `?registered=true` to the homepage. On the homepage, check for that param. If found, call alias() and remove the parameter so they don't refresh it and call it again.


If you really don't want to use a URL query string, you could achieve the same thing with localStorage or cookies.


2. Can you call alias before redirecting? You mentioned it's a single-page-app, so I imagine that once they register you can call alias() and then redirect them to your homepage.


3. Can you check the referring URL from the homepage to see if it was a registration page?

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.

Write an Answer
Hint: Notify or tag a user in this post by typing @username.

Up to 10 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

Integrate in backend, frontend, or both? (web-app) 3 Answers

Using Mixpanel with ReactJS 4 Answers

Proper way of using identify and alias 1 Answer

Is there a limit to how many times we can call "alias()"? 1 Answer

Difference between register and people.set? 1 Answer

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
  • Analytics Advice
  • Community Help
  • Debugging
  • Getting Started
  • Ideas
  • JQL
  • Explore
  • Topics
  • Questions
  • Ideas
  • Users
  • Badges