Earlier quoted context omitted.
Correct. The only service which can provide you with google queries is google analytics. So if you want the data, you are forced to help spread the google drag net across the internet.
No. Keywords do not appear in Google Analytics since search switched to HTTPS. The query strings are dropped going from HTTPS to HTTP. Keywords will show up as "(not provided)"(Disclaimer: I work at Google but I'm not on the search team. I do use Google Analytics.)
Ask HN: Why does Google put the query in the URL hash instead of query string?
31–40 of 71 posts
Re: Ask HN: Why does Google put the query in the URL hash instead of query string?
#32Earlier quoted context omitted.
Yes, and if you're using Firefox, you can this with the knowledge of its Smart Keywords to create super quick shortcuts! https://support.mozilla.org/en-US/kb/how-search-from-address... For example, I directly go to Wikipedia's page on "India " by typing wp India in my address bar using these search keywords, or search images of birds on google by typing gi birds in it. (There's a rather cumbersome way to do the same…
It's not that cumbersome in Chrome. Right click the URL bar -> "Edit search engines" -> Find the search engine you'd like to easily search, double click the second column and enter a keyword for it. For example, for wikipedia, I have "wp" as a keyword. In the URL bar, you can just type "wp " and you can search wikipedia.
Re: Ask HN: Why does Google put the query in the URL hash instead of query string?
#33Earlier quoted context omitted.
I don't think they can - iirc the hash isn't sent to the server, so to it this looks like any other normal query.
Well sure they can, how do you think the search results for "alice" are obtained? It gets sent to the server, just not upon first load but using Javascript. This Javascript could check for another query being present in the query string, or (less reliably) the server could in the referrer.
Re: Ask HN: Why does Google put the query in the URL hash instead of query string?
#34Earlier quoted context omitted.
I don't think they can - iirc the hash isn't sent to the server, so to it this looks like any other normal query.
Well sure they can, how do you think the search results for "alice" are obtained? It gets sent to the server, just not upon first load but using Javascript. This Javascript could check for another query being present in the query string, or (less reliably) the server could in the referrer.
Re: Ask HN: Why does Google put the query in the URL hash instead of query string?
#35Earlier quoted context omitted.
I don't think they can - iirc the hash isn't sent to the server, so to it this looks like any other normal query.
Well sure they can, how do you think the search results for "alice" are obtained? It gets sent to the server, just not upon first load but using Javascript. This Javascript could check for another query being present in the query string, or (less reliably) the server could in the referrer.
Re: Ask HN: Why does Google put the query in the URL hash instead of query string?
#36If you are search from any place (toolbar, addressbar) other than google.com, your search query would be passed in as a query string. But once you are already on google.com search page, the entire page need not be reloaded. So google would fetch the search results for the new search string via a XHR and update the page. In fact if you search for https://www.google.com/search?q=wonderland#q=alice , the webpage would f…
Re: Ask HN: Why does Google put the query in the URL hash instead of query string?
#37The hash won't be sent along as part of the referrer header, so the search query won't be available to 3rd party analytics. The only way to track search queries is to use Google's own analytics, which can correlate queries to traffic since it's watching both ends of the handoff.
The technical explanation discussed in this thread is certainly valid. But it only explains what is happening. The question posed was "why". Why would a search engine implement a design that would have the effect of removing the query string from referrer headers?
Answer that, and you'll answer your question
Re: Ask HN: Why does Google put the query in the URL hash instead of query string?
#38If you are search from any place (toolbar, addressbar) other than google.com, your search query would be passed in as a query string. But once you are already on google.com search page, the entire page need not be reloaded. So google would fetch the search results for the new search string via a XHR and update the page. In fact if you search for https://www.google.com/search?q=wonderland#q=alice , the webpage would f…
They could use `pushState` to change the query without reloading the page?
Re: Ask HN: Why does Google put the query in the URL hash instead of query string?
#39Re: Ask HN: Why does Google put the query in the URL hash instead of query string?
#40Earlier quoted context omitted.
Yes, and if you're using Firefox, you can this with the knowledge of its Smart Keywords to create super quick shortcuts! https://support.mozilla.org/en-US/kb/how-search-from-address... For example, I directly go to Wikipedia's page on "India " by typing wp India in my address bar using these search keywords, or search images of birds on google by typing gi birds in it. (There's a rather cumbersome way to do the same…
Set DuckDuckGo as your default search engine and you don't even need to do any configuring. You can then just type `!wiki India` or `!gi birds` or any other !bang: https://duckduckgo.com/bang