Skip to content

Instantly share code, notes, and snippets.

@calvinfo
Last active December 14, 2015 16:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save calvinfo/5117821 to your computer and use it in GitHub Desktop.
Save calvinfo/5117821 to your computer and use it in GitHub Desktop.
analytics.ready(function() {
if ($("#mixpanel_distinct_id").length > 0) {
var interval = setInterval(function () {
if (window.mixpanel.get_distinct_id) {
$("#mixpanel_distinct_id").val(window.mixpanel.get_distinct_id());
clearInterval(interval);
}
}, 300);
}
});
@goldan
Copy link

goldan commented Jan 30, 2014

A very helpful code, thank you!

@dwenaus
Copy link

dwenaus commented Jun 26, 2014

and for those not using segment.io you can use jQuery. change first line to:
$(document).ready(function () {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment