Live data from Hacker News

Google Analytics for developers

blog.arkency.com

31–40 of 45 posts

Re: Google Analytics for developers

#31
post #28

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…

As others have noted, _trackPageLoadTime is depreciated. However, Google Analytics only automatically samples the page load time for 1% of visitors. To change this call _gaq.push([‘_setSiteSpeedSampleRate’, 100]); before tracking the pageview. This will sample 100% of users for the site load time. https://developers.google.com/analytics/devguides/collection...

Very good point! Just be careful...

- Google will take a lot longer to report your data if you do this. - Google also has data limits. If you're experiencing 10k+ pageviews a day, you will probably run into the limit and it will stop reporting stuff.

http://support.google.com/analytics/bin/answer.py?hl=en&...

Re: Google Analytics for developers

#32
post #29

At the risk of going off topic, a question about sampling and sampling rates. If I set sampling to 1%, will the visitor totals in the Google Analytics dashboards reflect 1% of my true values or do they compensate/extrapolate out to 100% based on the sampling rate?

No.

There are two things here. Sampling rate for calculating page timing and using sampled data when generating reports. Confusingly, they are two different things with the same word "sample."

Sampling rate only affects calculating page timing because it's client side and slows down the client. (http://support.google.com/analytics/bin/answer.py?hl=en&...)

Google Analytics will collect all the unfiltered data for the web property. (http://support.google.com/analytics/bin/answer.py?hl=en&...)

However, to speed up ad-hoc querying, like when you create a custom report, it will limit the amount of data it will fetch to generate that report in order to make the user interface faster.

You can increase/decrease that using the slider. YOu will only see the slider after something like 250k unique pageviews.

Google Analytics Premium increases the number. If you really want to get a better sense of page timing, you should look both at the client side timing and the server side timing together. All you can really control is stuff going out. You can't help it if the user is running a netbook with 512 megs of RAM :)

Re: Google Analytics for developers

#33
post #4

I was expecting something different with the "for developers" title. Perhaps replicating some of the features of MixPanel or KissMetrics, which can track all kinds of interesting things for developers -- which features users of your app use most, in which order they use those features, whether this week's signups are more engaged than last week's signups, etc.

That's the next topic I want to digg in playing with Google Analytics. When I have some results I'll post them.

This is awesome. Thanks!!

Re: Google Analytics for developers

#34

Earlier quoted context omitted.

> "// 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…

In my experience Google's measures are 1-2 seconds higher than what I personally experience. Not sure why. Take it with a grain of salt and look for trends.

Googlebot seems to give up crawling your site after about 14 seconds :) You might see that reported in GWT.

Re: Google Analytics for developers

#35

Earlier quoted context omitted.

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…

In my experience Google's measures are 1-2 seconds higher than what I personally experience. Not sure why. Take it with a grain of salt and look for trends. Googlebot seems to give up crawling your site after about 14 seconds :) You might see that reported in GWT.

There are a lot of reasons this may be. Your Internet may be faster than your average user's. You may be closer geographically to your server. Different browsers will show different load speeds. The site may be cached for you most of the time.

I know you weren't actually asking, but I figured it's worth stating this for someone else who might experience the same thing. Load times do vary greatly. Digging down into the Analytics can show you where/why they vary. And as you said and as always with Analytics, look for trends more than exact figures.

Re: Google Analytics for developers

#36

Earlier quoted context omitted.

In my experience Google's measures are 1-2 seconds higher than what I personally experience. Not sure why. Take it with a grain of salt and look for trends. Googlebot seems to give up crawling your site after about 14 seconds :) You might see that reported in GWT.

There are a lot of reasons this may be. Your Internet may be faster than your average user's. You may be closer geographically to your server. Different browsers will show different load speeds. The site may be cached for you most of the time. I know you weren't actually asking, but I figured it's worth stating this for someone else who might experience the same thing. Load times do vary greatly. Digging down into th…

+1000 I'll tend to look at the speed coming off the server instead. At least I know that I can control 100%. If the user is on a dial up modem, not my problem ;)

Re: Google Analytics for developers

#38

Earlier quoted context omitted.

There are a lot of reasons this may be. Your Internet may be faster than your average user's. You may be closer geographically to your server. Different browsers will show different load speeds. The site may be cached for you most of the time. I know you weren't actually asking, but I figured it's worth stating this for someone else who might experience the same thing. Load times do vary greatly. Digging down into th…

+1000 I'll tend to look at the speed coming off the server instead. At least I know that I can control 100%. If the user is on a dial up modem, not my problem ;)

There are many things you can do to improve the performance of your website, even to people with dial up - or worse - Mobile!

Compress data with gzip is probably the big one for modem users, but also batching scripts and CSS together, reducing image sizes, re-arranging code to reduce blocking during rendering.

These are all things under your control, and with current mobile browsers, these are things you really must care about

Re: Google Analytics for developers

#39

Earlier quoted context omitted.

There are a lot of reasons this may be. Your Internet may be faster than your average user's. You may be closer geographically to your server. Different browsers will show different load speeds. The site may be cached for you most of the time. I know you weren't actually asking, but I figured it's worth stating this for someone else who might experience the same thing. Load times do vary greatly. Digging down into th…

+1000 I'll tend to look at the speed coming off the server instead. At least I know that I can control 100%. If the user is on a dial up modem, not my problem ;)

Getting user perceived page load time down is vital for most sites. You'll see your bounce rate drop, pages per visit rise, and conversion rates go up. A better experience for your users is always better for you.

You can do something to make like better for those on mobile and dialup with server settings, image compression, and the like. You can't change their connection speed, but you can focus on their experience.

Re: Google Analytics for developers

#40

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…

You should consider including a userid of some sort with the error reporting. It can let you debug down esoteric, hard to reproduce errors reported by users, which are otherwise almost impossible.
Post reply on HN