Show HN: Analytics.js – The analytics API you've always wanted
segmentio.github.com
segmentio.github.com
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...
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).
The one underhandedly fills in information that the user hasn't explicitly given a site. That's abhorrent.
Another offers a solution for incorporating multiple analytics services into a website a sane way. That's worthy of applause.
They are completely different products/services serving completely different needs.
I.E. this type of person that is my potential customer doesn't convert on my landing page.
Personal targeting is a TOTALLY different thing. It's not about optimizing technology, it's about optimizing sales WITHOUT optimizing technology.
Remember: it's one thing when it affects you as a user. It's another thing when it affects your users.
It just depends on which hat you're wearing.
Specifically...
1. It includes code to load up various analytics tools even if you never use them. For example, if I only use GA and Mixpanel, do I really want to serve the bytes for all the other plugins to my users? Maybe it would be useful to only package the JavaScript that a certain site needs.
2. The script still blocks the onload event. See this post for a way around that: http://calendar.perfplanet.com/2012/the-non-blocking-script-...
3. How does having multiple analytics solutions on a page affect the load time of that page?
Lastly, I couldn't tell from the docs how to call methods before the script has finished loading. Is it similar to GA's method queue pattern?
It only has code that knows how to load each script, which isn't that much. So for example if you don't tell it to load chartbeat.js, it will never load chartbeat.js.
Regarding load time of pages, it's one thing we (Chartbeat) take really seriously, e.g. our default implementation waits until after onload before downloading anything and we keep our JS as light as possible. This script does, unfortunately, throw some of that out the window with it's implementation though. I'm working on my pull request already. :)
analytics.track('Purchased an Item', { price : 39.95, shippingMethod : '2-day' });
translate to Google Analytics?
_gaq.push(['...?
How many properties can you have?
Hope that helps!
https://developers.google.com/analytics/devguides/collection...
We could contribute integration to https://bitdeli.com for those who want to build their own analytics. Is it enough to add a new provider to availableProviders?
https://developers.google.com/analytics/devguides/collection...
(seriously, that would be a great name. and, ya know, in reference to being anal retentive. get your mind outta the gutter people.)
How clever of them.
edit: a reply below points out that it's hard to search for. that's actually a quite good reason why the author(s) might want to reconsider the name.