If Events and Site Speed stay empty, look for urchin.js in the page source. Replace it everywhere with the current ga.js code under the same account number, then check goals, filters and old download links.

Two reports with nothing in them

The visits report looks normal, with the week's visits, the busiest pages and the searches that brought people in. Then someone opens the Site Speed report, and it is empty.

The Events report is empty too. Nothing looks broken: the pages load, and visits keep arriving in the reports every day.

The cause sits in every page: a tracking script from the first years of Google Analytics, still running long after Google moved on from it.

Where urchin.js came from

Google Analytics grew out of a product called Urchin, and its first tracking code was a script named urchin.js. Google replaced it with ga.js several years ago.

The old code still sends the basics: visits, pages, traffic sources, and goals based on page addresses. But Google stopped developing it long ago.

Event tracking, the Site Speed reports and custom variables were all built for ga.js. With urchin.js on the pages, those reports exist in the interface and simply stay blank.

Recognising the old code

Open any page, choose the browser's option to view the source, and search it for the word urchin. These are the signs:

Some sites carry both codes after a change that was started and never finished. Each page view is then recorded twice and the bounce rate looks far too good, so search for both names.

What moving involves

The current code is the ga.js snippet shown in the Analytics admin, the version that loads without holding up the page. It belongs just before the end of each page's head section.

Keep the same account number. The new code then reports into the same profile, so years of history carry on in one place instead of starting again. Google has begun calling profiles views, so either name may appear.

On a site built from templates, the change is made once in the shared header. On a hand-built site every page needs it, and any page missed keeps the old code.

Calls hidden inside links

Many older sites counted downloads by adding an urchinTracker call to each download link. Every click recorded a made-up page address, such as /downloads/entry-form, in the pages report.

Once urchin.js is gone, those calls point at nothing. They stop counting, and some browsers report a script error each time one is clicked.

Each needs rewriting, as an event or as the new code's own call for a made-up page. A developer can find every one with a single search across the site's files.

A worked example

A ski club in the Kootenays runs junior racing and adult lessons at a community hill. Its website holds the race calendar, registration forms as PDFs and photo galleries from each season.

The site was hand-built about seven years ago and still carried urchin.js on every page. The board wanted to know how often the forms were downloaded, and why the galleries felt slow.

Events and Site Speed were both blank. The downloads were counted through urchinTracker calls, and two pages added last year carried both codes.

In the off-season a developer replaced the code on every page with the ga.js snippet, under the same account number, and removed the second code from the two newer pages.

The download calls were rewritten with the new code's call for a made-up page, keeping the same addresses, so the registration goal still matches. Clicks through to the hill's snow report are now counted as events.

An annotation in Analytics marks the day of the change. The Site Speed report has begun to show load times for the galleries, the first real measure the board has had.

Goals after the switch

Goals that match a real page, such as a thank-you page, keep working unchanged. The new code records the same page addresses the old one did.

Goals built on made-up addresses from urchinTracker calls are the ones to watch. If the new calls record different addresses, those goals stop completing, with no warning.

Compare each goal's completions for the week after the change with the week before. A goal that drops to nothing points to an address that no longer matches.

Filters after the switch

Filters deserve the same look. One that filters out visits from the office, by its internet address, may be years out of date if the office has moved or changed providers.

Filters that rewrite addresses or include only one domain were often set up around the old code. Check what each one does today against what it was meant to do.

Keep one profile without any filters, as an untouched record that every other profile can be compared with.

Universal Analytics can wait

Google opened Universal Analytics, the next version of the code, to everyone as a public beta in March. For now, trying it means setting up a new, separate property.

A new property starts with no history. For a site leaving urchin.js today, ga.js keeps every year so far in the profile it already has, which is what this change protects.

The counter-case

A small site where only visits, pages and sources are ever read will see little difference after the switch. The old code still records those.

A site due for a rebuild in a few months might sensibly wait, so the tracking changes once, along with everything else.

But code that Google no longer develops will not gain anything new. Moving to ga.js takes a developer little time, and the checks afterwards are what keep the history sound.

Swapping the code over

  1. Search the page source for the word urchin.
  2. Note the account number the old code uses.
  3. Replace the code on every page with ga.js.
  4. Rewrite the calls inside download links.
  5. Remove the second code from any page with both.
  6. Annotate the date of the switch in Analytics.
  7. Compare goals and filters a week later.

Step four is where a hurried change goes wrong. The main code is easy to spot on each page; calls tucked inside links appear only when someone searches for them.

Once events are being recorded, the same method can count clicks that take visitors off the site, as clicks on the directions link counted as exits shows.


Frequently asked questions

What is urchin.js?

The tracking code from the first version of Google Analytics. Google replaced it with ga.js years ago and stopped developing it, though it still records basic visits.

Why are Site Speed and Events empty?

Both need the ga.js code. With urchin.js on the pages, those reports exist in Analytics but receive no data, however long you wait.

Will changing the code lose our history?

Not if the new code uses the same account number. Visits keep arriving in the same profile, beside everything recorded before the change.

What about download links with urchinTracker calls?

Each one needs rewriting, as an event or as the new code's call for a made-up page. Left alone, they stop counting downloads.

Should we move straight to Universal Analytics?

It is still in public beta, and for now it means a separate property that starts with no history. Moving to ga.js keeps the profile you have.

What needs checking after the change?

Goals that counted made-up addresses, filters that exclude the office or rewrite addresses, and any page still carrying both codes. Compare a week before and after.

West Coast Media Solutions Inc. provides web design, web development, hosting, digital marketing, and business consulting to organisations across Canada, drawing on more than twenty-five years in the field.

Still running the urchin code?

Send us a link to your home page, and we will check its tracking code and list what the move involves.

Start a Conversation