Solved

decide endpoint is throwing Error 500s on Page Load

  • 16 April 2019
  • 8 replies
  • 854 views

Badge

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!


icon

Best answer by stephanie 20 April 2019, 01:42

@ilike2breakthngs Following up, our engineering team has been able to push an update and it should now be working. Can you check if it is working for you? In the case you still see the 500 error, let us know!



View original

8 replies

Userlevel 6
Badge +4

Hey @ilike2breakthngs, the decide endpoint of a URL is responsible for providing checks to deliver in-apps and a/b test options to users. Since you provided the URL for web, it would only apply to in-apps in your project (a/b is for mobile). In regards to your 500 error, there was a very small rate error/downtime today (well under 1%) that could have affected you but is has been cleared since!


Badge

We are still getting the same errors.

Since, these are Error 500's, I hope you have logs of these errors. Could your team please investigate what's causing them? Thank you @stephanie!


Userlevel 6
Badge +4

Hey @ilike2breakthngs, thanks for following up! We have gone ahead and created a ticket for it, we are waiting to hear back from our Engineering team.


Userlevel 6
Badge +4

@ilike2breakthngs Following up, our engineering team has been able to push an update and it should now be working. Can you check if it is working for you? In the case you still see the 500 error, let us know!


Badge

Thank you so much for that quick fix. We are no longer seeing the errors on our end!


Hi again @stephanie , could you please point me toward the documentation in relation to the decide endpoint, and any related part of the javascript client library that deals with/causes calls to that endpoint? Also, is there a way to disable calls to that endpoint? Hopefully that makes sense. 

Hi again @stephanie , could you please point me toward the documentation in relation to the decide endpoint, and any related part of the javascript client library that deals with/causes calls to that endpoint? Also, is there a way to disable calls to that endpoint? Hopefully that makes sense. 

I would also like to see the `/decide` endpoint documentation. I am having a hard time nailing it down. Thank you :)

Userlevel 6
Badge +3

We don't have external documentation for the /decide endpoint because it is not a public API and  it is only used internally by our SDKs for in-app messaging and for A/B testing. 

That said, our dev docs explain how to better control when in-apps are delivered:

1) iOS: https://developer.mixpanel.com/docs/ios#section-notes-on-experiment-delivery (a/b testing) and https://developer.mixpanel.com/docs/ios-inapp-messages#section-controlling-when-to-show-an-in-app-message (in-app)

2) Android: https://developer.mixpanel.com/docs/android#section-notes-on-experiment-delivery (a/b testing) and https://developer.mixpanel.com/docs/android-inapp-messages#section-controlling-when-to-show-an-in-app-message (in-app)

Reply