Question

distinct_id changes on every refresh

  • 24 November 2020
  • 2 replies
  • 100 views

Hey there,

I’m testing Mixpanel because we are looking for a solid analytics tool for something pretty simple.

We just need to be able to calculate a CTR for each page or campaigns. (number of unique users who click the button on the page / number of unique users who land on the page)

So far it’s looking good because I can see events showing up in real time in the Live View.

But quickly I ran into a big issue : I can not track unique users. Every time I refresh the page, the `distinct_id` changes. (see screenshot below, I refreshed the page 4 times in the same browser, each time a different id is generated)

 


2 replies

I fixed my problem using cookie_domain. I still think it’s strange but it works now.

mixpanel.init("<TOKEN>", {batch_requests: true, cookie_domain: window.location.host});

 

Userlevel 6
Badge +3

@Hugod Thanks for following up! It helps other users running into the same issues. Reach back out if anything else pops up!

Reply


Mixpanel