Live data from Hacker News

0 second visits according to Google Analytics

paweljaniak.co.za

31–40 of 59 posts

Re: 0 second visits according to Google Analytics

#31

Can I get some feedback on the following idea please: - Maintain an open (but idle) websocket connection on your page to have an accurate real-time visitor information. The websocket should remain open as long as the user doesn't close the tab or navigate away. What are some cons that prevent everyone from doing so?

Everyone does do so already (though not necessarily with websockets; occasional pings are sufficient and more widely supported). Google Analytics has a real-time dashboard. So do most web analytics platforms these days.

How do you ping a browser? Where can I find more info about this.

I figured the real-time dashboard of Google Analytics must be doing something similar, but I don't know what exactly they use.

Re: 0 second visits according to Google Analytics

#32
post #10
post #6

Honest question here: Why do all this? If there are no secondary source of data that one can observe (subscriptions, adclicks, citations, google link scores...), then why spend so much time and energy on statistics?

Assuming you have a reasonable estimate on the time spent reading an article, the distribution of time spent on the page can be telling as to the quality of the article and how you conveyed the content. If a reader leaves early that's possibly a symptom of poor writing. If you're lucky, it was just the wrong topic for the reader: no shame in that. If you're unlucky, however, it may be that your content is confronting…

I do a lot of content based marketing in different market/industries. The type of testing you describe is best used in addition to click-through rates. Due to how presentation and content can be both right, and still get you bad results. How come? The offer stinks. If the offer stinks, then the click-through rates will show. And that's the most important metric of this group that you should pay attention to: how interesting is my offer to the market.

Re: 0 second visits according to Google Analytics

#33
post #26

Can I get some feedback on the following idea please: - Maintain an open (but idle) websocket connection on your page to have an accurate real-time visitor information. The websocket should remain open as long as the user doesn't close the tab or navigate away. What are some cons that prevent everyone from doing so?

I have many tabs open that I'm not actually "on." I just took a shower and left HN open, for example. Can it detect that the tab is "active" or "focus?" That may help. But I'm not sure this is a problem worth a ton of work. It's, at best, a proxy for measuring things like interest.

    document.addEventListener('visibilitychange', onVisibilityChange);

Re: 0 second visits according to Google Analytics

#35

Earlier quoted context omitted.

Everyone does do so already (though not necessarily with websockets; occasional pings are sufficient and more widely supported). Google Analytics has a real-time dashboard. So do most web analytics platforms these days.

How do you ping a browser? Where can I find more info about this. I figured the real-time dashboard of Google Analytics must be doing something similar, but I don't know what exactly they use.

The browser pings the server.

    setInterval(function() {
        $.ajax('http://analytics-site.com/ping?page=' + window.location.href);
    }, 5000);

Re: 0 second visits according to Google Analytics

#36
I'm surprised they don't have a timer running that pings themselves every N seconds. The ads all do that. Pinging themselves on visibilitychange or beforeunload could also be helpful (though there will always be people who disconnect without warning, which is why you ping periodically if you care about time spent as a metric).

Re: 0 second visits according to Google Analytics

#37

Earlier quoted context omitted.

How do you ping a browser? Where can I find more info about this. I figured the real-time dashboard of Google Analytics must be doing something similar, but I don't know what exactly they use.

The browser pings the server. setInterval(function() { $.ajax('http://analytics-site.com/ping?page=' + window.location.href); }, 5000);

Ah, makes sense, thanks.

Re: 0 second visits according to Google Analytics

#38
Great idea, but why do we require real-time and user-impacting statistics in the first place?

Why not place a AJAX script to a local session monitor that stores up details about a visit and flushes the results via hits to GA? That way, a user doesn't have to wait for GA to load on a page (I've see it be the majority of load time on many websites). The AJAX script could be tied to all types of events such as mouse movement (people hover over links, images, ect. without clicking so capture that as interactivity), onFocus events, and in future eye-tracking events.

This could be built up as a off-screen buffer that generates a more detailed session and fires it off to AG in near-real-time. One other important factor could be to label the events in a concatenated nomenclature so that home.hover, home.idle.30s, home.unFocus, home.gaze.rightMenu.17s, and home.scroll.down.x143 all make sense.

Re: 0 second visits according to Google Analytics

#39

Can I get some feedback on the following idea please: - Maintain an open (but idle) websocket connection on your page to have an accurate real-time visitor information. The websocket should remain open as long as the user doesn't close the tab or navigate away. What are some cons that prevent everyone from doing so?

You can see a sample in action here [1]. The page should list every single person in the world (whose browser supports websockets) who is currently on that page. You can open multiple tabs and see that whenever you close/navigate away, your corresponding entry will disappear. [1] https://dl.dropboxusercontent.com/u/8554242/live-status.html

Error: TypeError: sock is undefined

Ubuntu, Firefox 20.0

Re: 0 second visits according to Google Analytics

#40

Can I get some feedback on the following idea please: - Maintain an open (but idle) websocket connection on your page to have an accurate real-time visitor information. The websocket should remain open as long as the user doesn't close the tab or navigate away. What are some cons that prevent everyone from doing so?

Everyone does do so already (though not necessarily with websockets; occasional pings are sufficient and more widely supported). Google Analytics has a real-time dashboard. So do most web analytics platforms these days.

GA realtime does not differ in tracking methodology, it uses the same onload beacon, just like the long-tail reporting.
Post reply on HN