Вопрос

Is it possible to add some sort of tracking or live analytics to the questions or answers I post here on Stack Overflow?

Bottom line: is it possible to add Analytics to a page that is not ours?

Note that this topic hasn't been removed because the information can be usefull for other usecases.

Это было полезно?

Решение

Yes it is! Using an image beacon created primarily to track live github pages.

It's really simple, just follow the steps:

Setup instructions:

First, log in to your Google Analytics account (if you don't have an Analytics account yet, get one here) and set up a new property:

  • Select "Website", use new "Universal Analytics" tracking
  • Website name: anything you want (e.g. StackOverflow Questions and Answers)
  • WebSite URL: https://ga-beacon.appspot.com/
  • Click "Get Tracking ID", copy the UA-XXXXX-X ID on next page

Next, add a tracking image to the questions/answers pages you want to track:

  • https://ga-beacon.appspot.com/UA-XXXXX-X/accounttype/question_name
  • UA-XXXXX-X should be your tracking ID
  • accounttype/question_name is an arbitrary path.

Add this image to your question/answer (if you have both in the same page, choose only one), and you're ready!

Example used for this page:

    ![Beacon][1]
    
    [1]: https://ga-beacon.appspot.com/UA-50149210-2/StackOverflow/How_do_I_add_real-time_analytics_to_my_Q_or_A_on_SO_question?pixel

Once everything is setup, install this custom dashboard in your account for a nice real-time overview (as shown in screenshot below).

Result:

example dashboard

Edit 14-05-2014:

After it being discussed at Meta.SE, I should add the detail to this answer that the use of this beacon or anything similar, might be subject of approval by the terms of service of the targeted website.

In the case of SE, it violates the Stack Exchange terms of service, section 3(e): Subscriber represents, warrants and agrees that it will not contribute any Subscriber Content that ... (e) contains a virus, trojan horse, worm, time bomb or other computer programming routine or engine that is intended to damage, detrimentally interfere with, surreptitiously intercept or expropriate any system, data or information.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top