How do I add segment.com identify and track?

  • 28 November 2014
  • 5 replies
  • 135 views

I’m trying to add mixpanel through segment, but not sure how to track events and identify users.


5 replies

Userlevel 3
Badge +1

Hi Reza - Segment’s API calls are relatively advanced, so I would definitely recommend reaching out to them directly, as they’ll have the most expertise when advising you how to format their code.

Once you have that though, you can add it into Unbounce quite easily via the custom Javascript panel on your page.

Hey Reza! Andy from Segment here.

If you are using Segment from the browser, make sure you add our JS snippet (instructions here):
https://segment.com/docs/libraries/analytics.js/quickstart/

Then, in order to ‘.identify()’ a user:

‘’‘
analytics.identify();
’’’

And to send a ‘.track()’ call:

‘’‘
analytics.track(“Did Something”);
’’’

These would map to Mixpanel’s ‘window.mixpanel.people.set’ and ‘window.mixpanel.track’.

More details here:
https://segment.com/docs/integrations/mixpanel/

If you have more questions, please email friends@segment.com

Thanks!
Andy

Thanks a bunch for chiming in, Andy! Super helpful.

Hii I am still trying to figure out how I can identify users with segment on my Unbounce landing page!? Where do I add the segment code on my Unbounce landing page in order to identify a user?
This is my LP: http://sales.bastie.cc/webinar-signup/
Thats my unbounce javascript editor: 

Nothing seems to work 😦 thanks guys!

Hmm that should work! I’m on your site (http://sales.bastie.cc/webinar-signup/) and it looks like our analytics.js is being loaded. I didn’t see any ‘.identify()’ calls being made, however. Is the above setup (the code you have in your screenshot) live currently on the site?

Please send us a note at friends@segment.com and we can dig into it for you!

Reply