How do I add real-time analytics of views to my questions and answers in the OS?

Asked

Viewed 186 times

2

It is possible to add some kind of live monitoring or analysis of the views to the questions and/or answers I post here on the stack overflow?

In the background it will be possible to add Analytics to a page that is not ours?

2 answers

5

How about using the Stack Exchange Own API ?

Look at a little fragment of what you can do:

Api de respostas:
/answers                  Obtem todas as respostas do site
/answers/{ids}            Obtem respostas identificadas por um set de IDs
/answers/{id}/accept      Dá um accept na resposta identificada [precisa de autorizacao]
/answers/{id}/accept/undo Desfaz o accept
/answers/{ids}/comments   Obtem os comentários nas respostas selecionadas pelos IDs
...

In the documentation has much more.

I pointed this way as a possibility, because even if we do not have methods with data of desired visuliazations, it would be the case to suggest in Meta da SE.

  • Yes it is also very good but together with that now I also have live data, what the API if I’m not mistaken does not offer... The set of the two is what gives the global vision to those who want it! ;)

  • In addition it is a small hack for the guys to keep entertained, since it is quite useful since it works with everything in which you can add links of images, I added to the OS more for example, other examples would be: emails, forums, repositories, etc.

  • 1

    @Cmpsoares clear, I put more as a complement, many people do not know this API. Even you can use this API to automatically place your tracking images. BUT I would suggest you put the image pointing to a PHP or ASP your, instead of sending the data to third parties (despite the interface "cute" already ready)

  • Yeah, I know, but the fun part is, it’s Opensource and I can get in there and control the repository. For these games I do not think it is important, but I agree that if it is for situations such as data for commercial or professional purposes I would already have to create my...

  • That’s fun! When I have more time I want to make some jokes with that, for now, it’s just like that! I’m very busy with college! : -S

  • I’ve been taking a closer look at the API and it doesn’t answer my question... It gives answers, votes etc and what you can see on the page but nothing that shows the activity on the page, is interesting information but does not answer the question... :-/

Show 1 more comment

3


Yes, it is! Using a signal image created primarily for track pages from github.

It’s very simple, just follow the following steps:

Setup instructions

First, log in to your Google Analytics account (if you don’t have an Analytics account, however, get an here) and create a new property:

  • Select "Website", use the "Universal Analytics" tracking type"
  • Website name: Anything you want (e.g. Stackoverflow Questions & Answers)
  • URL of the website: https://ga-beacon.appspot.com/
  • Press the "Get Control ID" button, copy the ID to type UA-XXXXX-Xon the following page

Then add a tracking image to the question/answer pages you want to follow:

  • https://ga-beacon.appspot.com/UA-XXXXX-X/tipoConta/nome_pergunta
  • 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 on the same page, just choose one), and you’re done!

Here is the example used for this page:

    ![Beacon][1]

    [1]: https://ga-beacon.appspot.com/UA-50149210-2/PT_StackOverflow/Como_faco_para_adicionar_analise_em_tempo_real_das_visualizacoes_nas_minhas_perguntas_e_respostas_no_SO_QA?pixel

Once everything is configured, install this custom panel in your account for a nice real-time view (as shown in the image below).

And the result is this:

example dashboard


Edit 14-05-2014:

After be discussed at the Meta.SE, I must add the detail to this reply that the use of this lighthouse or any similar, may be subject to approval by the Terms of Service of the target website.

In the case of the SE, this violates the Stack Exchange Terms of service, Section 3(and):

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.

  • I feel a little outdated... are you saying that it is possible to install an Analytics on a page that is not ours? . . . In fact, your question is very vague... the answer seems phenomenal, but the question does not explain much of the problem being solved.

  • That’s right! Add Analytics to any page that allows you to add an image in Markdown or html. ;-)

  • 1

    I can’t right now, but I can’t wait to test this, Gracias muchas!

  • 1

    It reminded me of an article I read in 2011: Abusing HTTP Status Codes to Expose Private Information using a similar technique can show whether or not you are logged in to a particular service.

  • In this case it does not show the personal data of the visits but it does a summary of the general.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.