A lot of StackOverflow's results in Google search append a parameter at the end to indicate that the traffic came from Google. I assume this is largely used for internal search volume tracking.


The internal links on these pages do not seem to point to URLs with the parameter attached, which makes me think that Google isn't crawling these links, but that StackOverflow is redirecting Googlebot to them. Am I correct in assuming this?

How does StackOverflow know that the traffic is coming from Google to append this paramater to their URLs? Are they detecting Googlebot through PHP user agent?


if(strstr(strtolower($_SERVER['HTTP_USER_AGENT']), "googlebot"))
    // redirect to $URL + ?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

Source: https://stackoverflow.com/questions/677419/how-to-detect-search-engine-bots-with-php

Here are some example URLs found on Google search results:

https://stackoverflow.com/questions/45254976/how-to-learn-html-and-css?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa https://stackoverflow.com/questions/9942538/is-it-correct-to-use-div-inside-form/9942562?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa https://stackoverflow.com/questions/3294572/is-input-well-formed-without-a-form?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa https://stackoverflow.com/questions/677419/how-to-detect-search-engine-bots-with-php?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

  1. How is Stackoverflow doing this?
  2. What are the benefits of doing this and should I be considering implementing this on my sites as well?
  3. If it's through 301 redirect, is this really worth losing link juice lost in the redirection process?
  4. These parameter URLs don't have any canonical tags in the HTML source. Are they not worried about duplilcate content issues or are they telling Google how to handle this parameter in Search Console?
  • It looks like this I think: schemaapp.com/tips/schema-markup-for-best-answer-answer-cards – Stephen Ostermiller Apr 10 '18 at 15:51
  • @StephenOstermiller the schema creates the parameter URLs? I just saw answer cards in that link – Michael d Apr 10 '18 at 16:22
  • I'm not sure exactly how it works, but I think with the schema you can include a URL for each answer. It looks like URLs with utm params are getting included. – Stephen Ostermiller Apr 10 '18 at 16:31
  • Can you give a query that gives such a result? I tried various queries based on the linked questions (so these questions are the 1st result), but I don’t get the rich QA snippet, so the URLs don’t have the utm parameters. – unor Apr 12 '18 at 20:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.