News for hackers. Stuff that matters.
Re:Show HN: Analytics.js – The analytics API you've always w... by alexdean on Wednesday December 12, 2012 @04:31PM (#4912581)
This is a cool idea for a project! The closest equivalent I'm aware of is Qubit OpenTag (https://github.com/QubitProducts/OpenTag).

I'm interested in adding SnowPlow support to this (https://github.com/snowplow/snowplow) - our tracking API is very similar to Google Analytics's.

We've just gone through the quite involved exercise of mapping SnowPlow to Google Tag Manager (http://snowplowanalytics.com/blog/2012/11/16/integrating-sno...) so I was a bit surprised in the code to see this mapping for GA events:

    track : function (event, properties) {
                window._gaq.push(['_trackEvent', 'All', event]);
            }
I'm a bit confused by this - how would I use analytics.js to pass through all the valid data that I can log in a GA event or indeed SnowPlow event - https://github.com/snowplow/snowplow/wiki/javascript-tracker...

I think you might be making the assumption that events consist of an event name plus arbitrary JSON envelope. This is a very MixPanelish view of the world - it doesn't really translate to Google Analytics, Piwik, SnowPlow, Omniture...

Re:Show HN: Analytics.js – The analytics API you've always w... by ianstormtaylor on Thursday December 13, 2012 @03:01AM (#4914821)
Really good points. I think there is definitely a way for the Mixpanel-esque API to map cleanly via a decided on spec to the GA-style API with 'category' and 'label'. We are thinking about how to solve this in the nicest way possible for the developer right now!
Re:Show HN: Analytics.js – The analytics API you've always w... by alexatkeplar on Thursday December 13, 2012 @03:19AM (#4914861)
It's going to be really hard to make a generic, non-lossy mapping in a static, stateless JS script. Have you looked at Google's dataLayer as an alternative yet? The setup guide for SnowPlow + dataLayer is here in case it's interesting: https://github.com/snowplow/snowplow/wiki/Integrating-javasc...

The dataLayer approach seems really sound to us - here's hoping other tag management solutions move to something similar (or standardise on Google's dataLayer API).