Solved

Hosting on GCP app engine

  • 14 October 2019
  • 4 replies
  • 296 views

Badge

After implementing Mixpanel in my application, I checked the auto generated distinct id in browser by calling mixpanel.get_distictid(). It is always same even if, after refresh. This is a normal behaviour. But this is happening only with my localhost application. When I host this application to GCP app engine, the same function started returning different distinct id whenever I refresh the page and hence different users under my Mixpanel analytics reports.



icon

Best answer by fredl 18 October 2019, 19:13

@Rakesh this is a bit weird and not normal. It sounds like it can be something custom you are implementing. Is there any testing you have done to check what is making this happen?

My first instinct is checking different browsers and see if it isolated only to one browser. Another would be how you are calling identify, are you only calling it when a user logs into your app?

I also found this article on tracking across hosted sub domains, it focuses more on Heroku but it can be helpful for you as well.



View original

4 replies

Badge

I am facing the same issue. I checked my website on incognito and yes it is not showing that error. But it is also not showing the auto distinct id cookie in Application > Cookies > Your Website. This cookie ensures that you always get the same distinct id even after page refresh. Whenever I refresh the page and check using function mixpanel.get_distinct_id() it gives me a different distinct id. I changed the Mixpanel config and add 'secure_cookie': true, but still the same.


Userlevel 1
Badge

@Rakesh this is a bit weird and not normal. It sounds like it can be something custom you are implementing. Is there any testing you have done to check what is making this happen?

My first instinct is checking different browsers and see if it isolated only to one browser. Another would be how you are calling identify, are you only calling it when a user logs into your app?

I also found this article on tracking across hosted sub domains, it focuses more on Heroku but it can be helpful for you as well.


Badge

Thanks @fredl, Yes problem is same as mentioned in above document for Heroku. I am using GCP app engine which gives domain appdomain.com, which is also a public suffix listed in https://publicsuffix.org/list/effective_tld_names.dat. We can't set cross domain cookie for these domains. So each time I load the page it was generating a new distinct ID. Now I am testing with my custom domain in same app engine and everything working fine.


Userlevel 1
Badge

Makes sense, happy I was able to provide some help!


Reply


Mixpanel