Mixpanel With Iframe

  • 3 July 2020
  • 1 reply

Hi Team,

I have a website(parent) where I am using Mixpanel.

I am tracking user session by Log In and Log Out events. I have a another website(child) which i am loading inside Iframe in parent website.

How can I maintain same session started in parent inside Iframe website ? Can anybody let me know the same with some examples or documentation if available ?

1 reply

Userlevel 5
Badge +3

@sreeramk -

So long as you use the same user ID, the tracking should remain consistent across the parent website and iframe. 
e.g. Consider the following:

  1. I do a login on site A, and then do events B - N on Site B and then log out on Site A again
  2. If I'm using the same ID, this should appear in Mixpanel as Login - B->N - Logout and the session should work as expected

Since this should be the default behavior, can you tell me more about any issues you might be experiencing? I’d love to help you get up and running!