When you follow a permalink to a chat message in the Stack Exchange chat, you get a view of the transcript page for the day that contains the particular message. This message is highlighted in yellow, and the page is scrolled to its position.

Sometimes – admittedly rarely, but it happens – a web search will result in such a transcript link. Here's a (constructed, obviously) example: A Google search for

strange behavior of the \bibliography command site:chat.stackexchange.com

gives me a link to this chat message. This message is obiously unrelated to my query, but the transcript page does indeed contain my search terms – just in a totally different spot.

Both the above links lead to the same content, and Google knows this, since both pages have

<link rel="canonical" href="/transcript/41/2012/4/9/0-24" />

in their <head>. The only difference between the two links is Which message has the highlight css class?.

Is there a way to let Google know that while all three links have the same content, they put an emphasis on a different part of the content?

Note that the permalinks on the transcript page already have a #12345 hash to "point" to the relavant chat message, but Google appears to drop it.


Given the incredible popularity of Google (it is 90% of incoming traffic on Stack Overflow, for example), couldn't you simply check the referer?

Example referer strings from search engines:




I know Google is switching to a lot of SSL, so that might affect whether or not you get the referer, but if you do, you can definitely jump to the matching section in the chat transcript based on the search query string passed in there.

| improve this answer | |
  • This creates memories of bad "Hello Googler, I see you're searching for X" sites -- but yes, it's an nice workaround. Of course, I'd also love that Google knows the relevant part of the page, but the idea is certainly interesting. – balpha Apr 12 '12 at 6:40
  • 2
    you could also perhaps detect the inverse, when it is highlighting the wrong passage, that has zero of the search words -- and decide not to highlight anything? Better to try to match what they searched, but that may be hard if it's a partial match and not a perfect "this is a quoted string" result, which is kind of artificial. – Jeff Atwood Apr 12 '12 at 6:41

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.