MeLight
MeLight

Reputation: 5555

App Engine traffic splitting is not persisting

When splitting traffic by cookies, we're observing the following behavior:
GOOGAPPUID cookie does not receive a number between 0-999, but rather a string which resembles this form: xCgsIARD8AiDF1PjnBQ
Even though the client has the cookie he is not always sent to the same version, every few minutes the version the client is directed to is switched.

How do we remedy this?

Upvotes: 2

Views: 258

Answers (1)

MeLight
MeLight

Reputation: 5555

So apparently it's a bug from 2015 (Google issue tracker) that has not been fixed yet.

We've implemented a partial solution though:

If you have versions A and B, split 30%/70% then if you set the GOOGAPPUID cookie manually to values between 0-299 you'll get to version A, or to values between 300-999 you'll get to version B, consistently, across requests.

Knowing that, on the relevant handlers of our app (you might need to do it for all handlers of your app), we check if the incoming request already has a GOOGAPPUID cookie AND that it's a number. If it is a number, we leave it as is.

If it's not present or not a number it means that we have not set it before. So we check on which version we are (because the App Engine traffic splitting works well, it's only the persistence cookie mechanism is broken), and if we're on version A, we set the cookie to a value between 0-299, if we're on version B we set the cookie to value of 300-999.

This patch will fill the gap of Google's issue with GOOGAPPUID cookies and will give your user a persistent experience across requests.

Upvotes: 2

Related Questions