Reputation: 4205
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.
Upvotes: 1
Views: 179
Reputation: 4205
Yes it is! Using an image beacon created primarily to track live github pages.
It's really simple, just follow the steps:
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:
https://ga-beacon.appspot.com/
UA-XXXXX-X
ID on next pageNext, 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 IDaccounttype/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!
![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).
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.
Upvotes: 3