How to share a Google SERP experiment

or save your cookies, share a NID

by Valentin Pletzer - August 31, 2018

the gist of this article

In order to share an exciting Google SERP experiments with your colleagues all you need to do ist to share the NID cookie value.

the longer read

In 2017, Google engineers tweaked the search algorithm 2,400 times based on the results of more than 270,000 experiments, reviews and live user tests [1]. While I am not sure if this stats also include the layout changes, I know from experience that Google changes those quite a lot as well.

As SEO professionals you probably see those tests quite often as well, because as a responsible SEO you know that you should not be logged in and avoid personalized search results. An easy way to do this, is to use the incognito mode (Chrome)[2] or private browsing (Firefox)[3]. After you close this private session your browser basically deletes everything it recorded - including the cookies. And one of those cookies is the key to those Google experiments.

about cookies and a/b experiments

Cookies are basically a small piece of text which are sent and received with nearly every HTTP connection and cookies can’t be created and read either by the server or via javascript locally. The data within those http cookies are tied to the domain/hostnames so only you (your browser) and the webserver can access this data. The data itself is structured in a very simple way. It is composed of a key and value as well as the connected domain and a time on which the data is expected to expire (deleted by your browser).

Cookies are often used (next to ip addresses) to divide users into groups, e.g. one group seeing the old version and one group with the experiment. This helps, once a user is part of an experiment, only will see one version of the test so it does not get irritating. A naive approach would be to set key (e.g. userid) and a random number as the value. If your number is even, you are part of group A and if the number is odd, you are part of group B.

Google’s way to group users for experiments

Google is using something very similar for it’s search result experiments. If you don’t have any cookies, the Google servers will send you a set of cookies. A seemingly random string get’s written as value for the cookie with the key NID. At the moment of me writing this article a typical value begins with a number like “137=” and a large amount of random numbers and letters. While this still might be decodable, I don’t know how to decode it (it’s probably not a base64 encoded protocol buffer binary)[4] but this does not really matter, if the only thing you would like to do is to share an experiment with your friends and colleagues.

Google itself describes the NID cookie as a unique ID Google uses to remember your preferences and other information, such as your preferred language (e.g. English), how many search results you wish to have shown per page (e.g. 10 or 20), and whether or not you wish to have Google’s SafeSearch filter turned on.[5] Also, and that is something Google doesn’t share, NID is tied to the experiment you are currently experiencing (or not).

getting and setting the NID cookie tutorial

Therefor all you have to do, is to open the developer console[6][7] while you are surfing on google.com, open the Application (or Storage) tab and find the NID cookie. Once you found it, you can copy the value for your partners in crime or insert a copy of someone else’s.

getting & setting the NID value

when and where does this work

The experiments might be tied to certain environments like browser, operating system, language or even locations. So if you care to share an experimental NID cookie, be sure to share some basic information with it - including the circumstances like a query you used.

Important!

In doing so you might leak private information to other people you share the cookie with. So the responsible thing to do is to only share NID values you found in a private / incognito session of your browser.

an live example

At the time of this writing one of Google’s experiments is a test of a sticky header and this is the value I got in my Chrome browser on MacOS:

NID 137=Xjnd2meFLITOA2LF1xB0TCOprrMeeIUXlUM790kfLYod3_Zy5EjecTzzRYd7y_bVXhf5qzbOdnnXPAZeFreNfbtfzTfuvtPq-cYBU3LL_QG7ROYtcnEu6dWoYisKR5KOHiyxxjU

feedback welcome

If you like this tool, experience any problems, have ideas for upgrades or just want to say hi, feel free to contact me on Twitter @VorticonCmdr.

References

  1. AP EXPLAINS: How Google search results work
  2. Browse in private - Chrome
  3. Private Browsing - Use Firefox without saving history
  4. Google stick parameter decoder
  5. Types of cookies used by Google
  6. Inspect and Delete Cookies | Google Chrome
  7. Storage Inspector - Firefox Developer Tools