Live data from Hacker News

Google Analytics for developers

blog.arkency.com

11–20 of 45 posts

Re: Google Analytics for developers

#11

Here are two of my favorite tricks. You can do this just after you set your account ID: var _gaq = _gaq || []; _gaq.push(['_setAccount', 'YOUR ANALYTICS ID GOES HERE']); _gaq.push(['_trackPageview']); //******************* // Trick #1: Track page load time in Google Analytics // (note: only works for HTML5 browsers) //******************* _gaq.push(['_trackPageLoadTime']); (function() { var ga = document.createElement…

> "// Track page load time in Google Analytics"

After adding that, where does that appear in the Google Analytics dashboard? Can you explain further how that works? Thanks!

Re: Google Analytics for developers

#12

Here are two of my favorite tricks. You can do this just after you set your account ID: var _gaq = _gaq || []; _gaq.push(['_setAccount', 'YOUR ANALYTICS ID GOES HERE']); _gaq.push(['_trackPageview']); //******************* // Trick #1: Track page load time in Google Analytics // (note: only works for HTML5 browsers) //******************* _gaq.push(['_trackPageLoadTime']); (function() { var ga = document.createElement…

Best to check for the existence of _gaq before pushing elements into it, or the user might get a reference error.

Re: Google Analytics for developers

#13
I'm a big fan of the GAS (Google Analytics on Steroids) wrapper [1]. One of the coolest features is firing GA events from embedded YouTube videos [2] to track viewer retention [3].

[1] https://github.com/cardinalpath/gas

[2] https://gist.github.com/2715896

[3] http://i.imgur.com/QILnG.png

Re: Google Analytics for developers

#15

Here are two of my favorite tricks. You can do this just after you set your account ID: var _gaq = _gaq || []; _gaq.push(['_setAccount', 'YOUR ANALYTICS ID GOES HERE']); _gaq.push(['_trackPageview']); //******************* // Trick #1: Track page load time in Google Analytics // (note: only works for HTML5 browsers) //******************* _gaq.push(['_trackPageLoadTime']); (function() { var ga = document.createElement…

Best to check for the existence of _gaq before pushing elements into it, or the user might get a reference error.

I just updated by code segment to show where I call this (it's right after declaring _gaq).

Re: Google Analytics for developers

#16

Here are two of my favorite tricks. You can do this just after you set your account ID: var _gaq = _gaq || []; _gaq.push(['_setAccount', 'YOUR ANALYTICS ID GOES HERE']); _gaq.push(['_trackPageview']); //******************* // Trick #1: Track page load time in Google Analytics // (note: only works for HTML5 browsers) //******************* _gaq.push(['_trackPageLoadTime']); (function() { var ga = document.createElement…

According to this page [0], _trackPageLoadTime() is deprecated because site speed reporting is enabled automatically for all users.

Update: your 2nd trick is still relevant though

[0] https://developers.google.com/analytics/devguides/collection...

Re: Google Analytics for developers

#18

Here are two of my favorite tricks. You can do this just after you set your account ID: var _gaq = _gaq || []; _gaq.push(['_setAccount', 'YOUR ANALYTICS ID GOES HERE']); _gaq.push(['_trackPageview']); //******************* // Trick #1: Track page load time in Google Analytics // (note: only works for HTML5 browsers) //******************* _gaq.push(['_trackPageLoadTime']); (function() { var ga = document.createElement…

> "// Track page load time in Google Analytics" After adding that, where does that appear in the Google Analytics dashboard? Can you explain further how that works? Thanks!

It's under Standard Reporting -> Content -> Site Speed

The GA code will track client side page load time (DOM fully loaded) across your site. You'll get site-wide averages and you'll also get to drill in on slow pages. This doesn't work for every single browser (last I checked it only worked for browsers that support HTML5), but it still provides a good sample size.

It's also important to do this as Google Webmaster tools dropped support of the Site Speed lab which shows you how fast Google thinks your site is ( = 1.5 seconds is "slow"). If you're trying to improve your Google ranking you need to be tracking how fast Google thinks your site is. (Also, fast websites are great for lots of reasons, not just Google ranking.)

See also: http://analytics.blogspot.com/2011/05/measure-page-load-time...

Re: Google Analytics for developers

#19

Here are two of my favorite tricks. You can do this just after you set your account ID: var _gaq = _gaq || []; _gaq.push(['_setAccount', 'YOUR ANALYTICS ID GOES HERE']); _gaq.push(['_trackPageview']); //******************* // Trick #1: Track page load time in Google Analytics // (note: only works for HTML5 browsers) //******************* _gaq.push(['_trackPageLoadTime']); (function() { var ga = document.createElement…

According to this page [0], _trackPageLoadTime() is deprecated because site speed reporting is enabled automatically for all users. Update: your 2nd trick is still relevant though [0] https://developers.google.com/analytics/devguides/collection...

Thank you! I was unaware of this change.

Re: Google Analytics for developers

#20

Perhaps I'm confused but what benefit do you get from using event tracking for an outbound click, and lastly what does ET have to do with real time? Thanks

I use event tracking on my outbound clicks all the time. My side project is a vertical niche search engine, so I like to know when, where and how people are leaving the site (since that is the point of the app afterall).

I have some of it tracked with internal code, but for a lot of things that don't need rigorous analysis/tracking, firing an outbound click event to GA is sufficient.

Post reply on HN