Posts Tagged ‘JavaScript’

Custom link click tracking using Omniture

Omniture is the de facto standard tracking and analytics system that most online retailers use. It has a suite of reporting metrics and allows for custom reporting variables. It is primarily designed for online stores to track usage, conversions and sales.

Admittedly, I am not that big a fan of Omniture. Their SiteCatalyst reporting application is slower than Google Analytics and not as flexible as it could be. My biggest gripe is their tracking JavaScript code, it’s just plain terrible. It’s slow, obfuscated (really? why do this?), bloated, impossible to debug and not built using modern practices. Oh, and they’re also insanely expensive if you want to get at all fancy.

This article is simply a straight how-to for building a custom link tracking JavaScript in the hopes that I can save some other JavaScript developer out there the headaches and tears usually associated with learning advanced Omniture implementations.

Read more »

JavaScript regex trick: Parse a query string into an object

Have you ever needed to get query string values using JavaScript? This task is usually a painful split, split, split, iterate, indexOf hack that is really slow and terribly ugly to look at. It also tends to pile up lines of code really fast.

Here is a really sweet way to parse the query string into a JavaScript object with two lines of code using regular expressions to populate an object. I discovered this trick a few years ago and filed it away in my code snippets folder.

Read more »

AddThis: friendly widget and brilliant viral tracking scheme

I was once a huge fan of the AddThis social bookmarking widget, it’s a simple device for adding the social network buttons that everyone expects to see on every page on the internet (now-a-days). It has excellent browser support and is very simple to implement, modify and configure. As far as social bookmarking widgets go, it is probably the best.

However, in the latter half of 2008 AddThis was acquired by Clearspring, an online media company. They were able to see the value in having a glorified tracking bug on hundreds of thousands of sites across the internet. It’s grown to such an extent that Clearspring now sees what half of the internet is doing.

I’m no tinfoil hat paranoid, but I was a bit surprised at the scale and power of this system. Personally I congratulate them on their wild success. It was a brilliant idea and has become an internet phenomenon. However, I have no interest in giving Clearspring information on my visitors (for free).

So lets reduce it’s tracking ability with a couple lines of JavaScript.

Read more »

External templates for the DataView control: Microsoft Ajax Library 4.0

One of the best things about templates is how portable they are. You can build a template for a particular piece of presentation and then use that template everywhere you need it. In fact you can have several templates to choose from, giving you themes and different ways of displaying the same data.

This is a very powerful and very maintainable technique. Portable template files are a great example of the Don’t Repeat Yourself (DRY) principal and are a good idea for any template that will see reuse.

The new DataView control in the latest beta of the Microsoft Ajax Library version 4.0 (aka the ASP.NET AJAX Library) has a fine template engine built into it. Unfortunately, those templates must be embedded in the page markup. If it’s your project then you can simply use an ascx User Control, or a ContentPlaceHolder or an Html.RenderPartial, but what if you need to be able to use the template on a static file, or a clients site, or even in another framework? You can’t have portable template files that you can just call anywhere. Well, you can, but you have to use a workaround technique.

This is one technique that I came up with for importing a template file into a page. This lets me have one (or a selection of) template files that I can use everywhere for a portable JavaScript widget. It has no dependencies other than the Microsoft Ajax Library.

Read more »

Must-have Firefox Add-ons for Web Developers & Designers

Mozilla Firefox is by far my favorite web browser. It is secure, feature packed, and very well maintained with a great community behind it. It is also the web developers’ best friend, with tons of built-in tools and user created add-ons to help people creating web sites. In my opinion, because of the array of tools available and the quality of the product, every web developer should already be using Firefox as their main browser.

This is an arbitrary list of my favorite Firefox add-ons for web development. These tools have fundamentally changed how I design and develop web pages. With these tools I can accomplish tasks in minutes that would have taken me hours just four years ago.

Read more »

Page 1 of 212