Thursday, November 8, 2012

Memeja Analytics Engine

Today, we spent all day setting a new MVP to test our hypothesis.

The key is to make it easy for people to engage with the site by reading the memes/rage comics on one page. This runs into a problem with Google Analytics, though, as it uses two different timestamps for a time diff (and records that as your Avg Time).

Even worse, GA counts someone who just views one page as a bounce because the user hasn't seen a pageview. Usually, this wouldn't be so bad, but for our one-pager site, it's a problem.

Javascript hacking to the rescue...

First, to adjust the bounce rate to exclude any user visit above x time:

setTimeout('_gaq.push(['_trackEvent', 'NotABounce', 'Over 45 seconds']), 45000);

We believe 45 seconds is enough to engage with at least a few comics. It's conservative but anything less means that the user might simply be curious but doesn't want to actually engage with rage comics.

As usual, returning visitors is the best sign. They know the website is already there and want to check back.

Next, we wanted to more precisely find out how much time a user would be spending on our site. This requires long polling to tell GA at different intervals. Knowing the adjusted bounce rate is nice, but knowing how much time the user is spending looking at these comics is even better.

Adding this portion of the code...


(function (timer) {
  window.setInterval(function () {
    timer = (function (t) {
      return t[0] == 50 ? (parseInt(t[1]) + 1) + ':00' : (t[1] || '0') + ':' + (parseInt(t[0]) + 10);
    })(timer.split(':').reverse());
    window.pageTracker ? pageTracker._trackEvent('Track', 'Check', tos) : _gaq.push(['_trackEvent', 'Track', 'Check', timer]);
  }, 10000);
})('00');

This piece of Javascript will help us log the time spent for each user on one page. Although it will slow down the site (a little bit), we're wary of reaching out limit with GA. Still, it should serve us well.

...

Ultimately, what we want to know is how people react to rage comics. Do they like to read them if they're more personal? If so, then we have a host of other interesting questions to ask: Would they create them if creation was made easy? Would they create them for friends to read?

No comments:

Post a Comment