0

I'm am a beginner programmer. My question is how google is able to track how many clicks a website gets regardless of whether the website has Google Analytics installed.

For example, If I google, "Free kittens"

and press on the 8th result, how does Google know I pressed on the 8th result?

Does google use a redirect tracker? because I don't see a redirect when i press on a result.

My other intuition is that there may be a js tracker script that overlays the search results page (I don't know if this makes sense) that tracks the clicks.

Please help.

Thanks

  • "Does google use a redirect tracker?". Yes, it does. Note that your question has nothing to do with programming. – Ram Jan 24 '16 at 02:14
  • 1
    @Vohuman While not directly related to programming, this question seems to be about the programming technique that Google has used to implement a redirect tracker without obscuring the end URL, and is generally applicable beyond just Google. – anjsimmo Jan 24 '16 at 02:34
  • @vohuman I am trying to develop an application that simulates this particular kind of activity, but in a different context. If you have a better category of suggestion, please share it with me. – user5831870 Jan 25 '16 at 06:01

2 Answers2

1

For me, it seems that Google changes the URL to a redirect link as the user clicks on it. So when you mouse over the link, it appears as the external URL, but the moment the user left or right clicks on the link, it changes to the Google redirect link.

Before clicking on link: googling free kittens, no redirect

After left/right clicking on link, then moving mouse away: googling free kittens, redirect

Using the developer tools element inspector, we can see that Google is using the onmousedown event to intercept clicks on the link before the browser follows it:

<a href="http://www.gumtree.com.au/s-cats-kittens/melbourne/free+kittens/k0c18435l3001317"
   onmousedown="return rwt(this,'','','','1','AFQjCNEeR2KfOPRwfAbyIssU37Eyo5NaMQ','py4LAAToFTvvPvE72uV6Yw','0ahUKEwijhLTzwsHKAhUGVZQKHRvHA9cQFggcMAA','','',event)">
        free kittens in Melbourne Region, VIC | Cats ... - Gumtree
</a>

See also: Why do browsers allow onmousedown JS to change href?

Community
  • 1
  • 1
anjsimmo
  • 704
  • 5
  • 18