Last active
December 14, 2015 16:49
-
-
Save calvinfo/5117821 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
}); |
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
A very helpful code, thank you!