We are getting an Error 500 - Internal Server Error on Page Loads from a MixPanel /decide/ endpoint which uses "versions=1". Can someone explain what this decide endpoint does and if there's an issue with this endpoint throwing an Error 500?
This is the code snippet from MixPanels script that is initiating this call ->
c.J(document, "change", b, D, p); c.J(document, "click", b, D, p) }, Bb: {}, aa: function (a) {
if (!document || !document.body) {
console.log("document not ready yet, trying again in 500 milliseconds...");
var b = this; setTimeout(function () { b.aa(a) }, 500)
} else {
var d = a.c("token"); if (-1 < this.Gb.indexOf(d)) console.log('autotrack already initialized for token "' + d + '"'); else if (this.Gb.push(d), !this.ed(a)) {
var e = c.bind(function (b) { if (b && b.config && b.config.enable_collect_everything === p) { if (b.custom_properties) this.Bb = b.custom_properties; a.p("$web_event", c.extend({ $title: document.title }, this.Eb("pageview"))); this.Lc(a) } else a.__autotrack_enabled = D }, this); a.i(a.c("api_host") + "/decide/", {
verbose: p, version: "1",
lib: "web", token: d
}, a.ja(e))
}
}
}
Our current implementation uses the following ->
Script: https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js
- mixpanel.init("accountKey");
- mixpanel.identify("uniqueUserId");
- mixpanel.track("Page View", {"Environment" : "Test"});
On Page Load, 4 API calls are made to the MixPanel endpoints ->
1. Status 500 - Internal Server Error
GET https://api.mixpanel.com/decide/?verbose=1&version=1&lib=web&token={accountKey}&ip=1&_=1555423385005
Query Parameters:
- verbose=1
- version=1
- lib=web
- token=accountKey
- ip=1
- _=1555423385005
2. Status 200
GET https://api.mixpanel.com/track/?data={base64EncodedString}&ip=1&_=1555423385015
Query Parameters:
- data=base64EncodedString
- ip=1
- _=1555423385015
3. Status 200
GET https://api.mixpanel.com/decide/?verbose=1&version=3&lib=web&token={accountKey}&distinct_id={uniqueUserId}&ip=1&_=1555423385022
Query Parameters:
- verbose=1
- version=3
- lib=web
- token=accountKey
- distinct_id=uniqueUserId
- ip=1
- _=1555423385022
4. Status 200
GET https://api.mixpanel.com/track/?data={base64EncodedString}&ip=1&_=1555423385026
Query Parameters:
- data=base64EncodedString
- ip=1
- _=1555423385026
--
Thank you very much!
Best answer by stephanie