Posts Tagged ‘tracking code’
We’ve had a couple of reports from users that their traffic had gone noticeably down in the last day, coincidentally enough starting around the same time we released our new tracking code.
To be clear, most sites didn’t have any problems, and their users are unconsciously thanking them for a faster loading experience. However, one thing became clear – the sites that were noticing a large effect also happened to be site that aren’t exactly the fastest loading sites in the world.
To address this, we’ve made a change to the code. Unless you have specifically defined the new clicky_custom.delay property, the tracking code will register an onload event as well as a timeout of 3 seconds to log the page view anyways. These won’t both happen – whichever one fires first goes laughing all the way to the bank, and the other one goes crying home to mommy.
We think this is a good tradeoff. If your site loads in a decent amount of time, we’ll wait for the onload event. But if it’s slow, then we’ll log a page view after waiting for 3 seconds to help ensure that we log as many of your visitors as possible.
If you want to override this either/or behavior, just specify the delay manually. Its value can be either onload, in which case it will ONLY fire onload, or the number of milliseconds you want it to wait (0 = no delay).
We’ve just released a change to our tracking code that will help ensure the best user experience possible on your web site. You don’t have to change anything on your site, the changes are in the code itself that is loaded via the script element.
We have changed the default behavior so that the initial page view is not logged until the onload event has fired. For users on very slow connections, or who browse between pages very quickly, this may result in slightly less accurate tracking. But we’ve been testing it all day on a few of our own sites (including getclicky.com) and there are no discernable differences in our numbers, so this should work well for everyone.
Of course, if you prefer the old behavior, you can change it via the new clicky_custom.delay parameter. Set it to the number of milliseconds you want the delay to be – 0 will result in no delay at all, emulating the old behavior. We recommend keeping it to the default setting however, unless it causes any problems with your tracking (and if it does, let us know).
The tracking code should be the very last thing in your HTML anyways, so changing the default to onload shouldn’t change the accuracy – it will just let your site’s onload events fire before we log data.
Google recently introduced asynchronous tracking for Google Analytics. Ultimately we’d like Clicky to have this option as well, but it’s not as easy as it sounds and we can’t make it the default behavior like we did with this change.
The change we made today though should make a noticeable difference on your site. Logging data to our servers is generally much slower than downloading the tracking code, so this change makes a much bigger difference overall. Yes, the tracking code itself still must be downloaded before your onload event fires, but since we now use a global tracking code URL for all users, and we’re tracking almost 180,000 sites, chances are fairly good that a user arriving at your site already has our tracking code cached in their web browser. And even if they don’t, that will only affect their first page view. Every subsequent page view will benefit greatly from this change.
Of course, because they may have the old version cached already for up to 7 days, it will be 7 days before every single user on your site will be affected by this change. But in all likelihood, most of them will have it within 48 hours.
As of a few weeks ago, we changed the format to this:
[script]clicky.init( 123 );[/script]
As you can see, the URL of the tracking code is now the exact same for every site that someone would visit with Clicky on it. We just added a seperate function call to set the site ID within the script after it’s downloaded. Since any user’s browser would cache this script, it doesn’t have to redownload it. This means your site will load faster for anyone who has visited another site with Clicky on it in the last 7 days.
So, the point. If possible, please replace the existing tracking code on your site with a fresh copy (go to site prefs, then tracking code, to get a copy). As already mentioned, this will help speed up your site for the average visitor, as well as reducing bandwidth usage on our end.
Of course, the old format still works, and will indefinitely. We don’t want to force you to do this, but if you have a few extra minutes, the web will be a better place. Thanks.
UPDATE: Yes, the new WP plugin has the new tracking code format. This only applies to people who manually paste the code on their site anyways, since using a plugin puts you at the mercy of the plugin developer.