Live data from Hacker News

Google Analytics for developers

blog.arkency.com

41–45 of 45 posts

Re: Google Analytics for developers

#42
post #30
post #24

Is anyone using GA to track mobile apps? The mobile SDKs shows a lot of potential until you start wondering about offline usage, GA being a website tracker first. I couldn't find any final answers but from what I can see it might be a sore point: the SDK docs dodge the topic [1] and I see complaints, ie events can be batched for later but get the timestamps of when they were uploaded, instead of when they happened [2…

We are using GA to track mobile apps. The local queuing and dispatch of hits to GA is covered here[1]. We've found it to be pretty reliable. You can also modify the dispatch time for testing, etc. [1] https://developers.google.com/analytics/devguides/collection...

Note: Data must be dispatched and received by 4 a.m. of the following day, in the local timezone of each profile. Any data received later than that will not appear in reports.

Do your mobile apps require an Internet connection? From what I'm seeing I imagine that's a prerequisite to use GA. It's a deal breaker for me though, I can't intentionally throw away a slice of offline usage data (iPods, iPads, etc).

Re: Google Analytics for developers

#43
post #41

If you want to extract more data from your site to Google Analytics I recommend GAS (Google Analytics on Steroids). https://github.com/CardinalPath/gas It adds these events and even more to your site. (I'm the main developer by the way.)

This is really impressive.

Re: Google Analytics for developers

#44
The article is interesting, but gives some bad instructions on how to track outbound links and also probably how to track form submissions. Because of the asynchronous nature of communications back/forth from Google Analytics if you load a new page before an event is properly tracked, you won't be able to see it on the GA Dashboard. Bad intel is worse than no intel at all.

Here's what Google itself has to say on the matter: http://support.Google.com/analytics/bin/answer.py?hl=en&...

Here's how to correct one code example from the blog post:

  //this function is OK, but probably an unnecessary abstraction of a one-liner
  function trackEvent(category, action, label) {
    window._gaq.push(['_trackEvent', category, action, label])
  }

  //this event handler will not track some non-negligible percentage of events
  $("article a").click(function(e) {
    var element = $(this)
    var label = element.attr("href")
    trackEvent("Outbound link", "Click", label)
  });


  //corrected outbound link event handler which gives GA 100 ms to register
  //the event.  higher than 100 risks UX degradation, lower increases the %
  //of untracked events.  100 ms is happy medium  
  $("article a").click(function(e) {
    e.preventDefault();  //stay on the page for now
    var element = $(this)
    var label = element.attr("href")
    trackEvent("Outbound link", "Click", label)
    //leave the page after a short delay
    window.setTimeout("window.location.href='" + label + "'", 100);
  });

Re: Google Analytics for developers

#45

The article is interesting, but gives some bad instructions on how to track outbound links and also probably how to track form submissions. Because of the asynchronous nature of communications back/forth from Google Analytics if you load a new page before an event is properly tracked, you won't be able to see it on the GA Dashboard. Bad intel is worse than no intel at all. Here's what Google itself has to say on the…

I'm a bit suspicous of that method... will it still work for people right clicking and opening in new window, or shift-clicking, or middle-clicking, or right clicking and copying the URL?
Post reply on HN