Photo of a map of the constellations

Google Analytics is the most popular analytics service on the web, allowing website owners and marketers to monitor how users are interacting with their content from an easy-to-use dashboard. Thousands of companies rely on Google Analytics to optimize their websites and measure the efficacy of advertising campaigns. At its most basic level, Google Analytics enables you to see who’s visiting your website, where they’re coming from, how long they’re staying on your pages, and what links they’re clicking on.

More advanced implementations—like campaign tagging—can also gather much more information.

The current standard for Google Analytics is called Universal Analytics. Launched in 2013, it’s built around the JavaScript library analytics.js. However, many websites are still using the legacy Google Analytics framework, which uses the older ga.js library. In this article, we’ll briefly take a look at the differences between these two libraries and explain why you should strongly consider upgrading to analytics.js.

What is analytics.js?

Both ga.js and analytics.js are JavaScript libraries that measure how users interact with your website. To enable them, you have to add a small bit of code (called the “JavaScript tracking snippet”) to your site’s templates. This tracking snippet runs in the client browser while the client is browsing the website, collecting data, and sending it back to the Google Analytics server.

To be clear, analytics.js and ga.js are not competing libraries—analytics.js superceded ga.js in 2013, meaning that all of the features supported by ga.js are now in analytics.js. If you’re building a new website, there’s no reason not to go with the latest version. That said, there are still many websites running ga.js even though it hasn’t been officially supported for several years.

So if ga.js ain’t broke, why fix it?

A good way to think of the difference is that ga.js is designed to measure websites while analytics.js is designed to measure users. The latter allows you to see not just what users do on your website, but how they access it, which is extremely important as you decide what channels to devote resources to.

Here are three features that make upgrading to analytics.js worth your while.

1. User ID

The main driver behind Google’s shift to the Universal Analytics standard was mobile adoption. When Google Analytics was first introduced in 2005, mobile usage was negligible. Once the mobile revolution took off, however, web analysts needed more sophisticated tools to take advantage of this new data. One shortcoming of the ga.js framework is that it treats visits to the same website from different devices or browsers as unique users, even if it’s the same person. Analytics.js solves this problem by introducing the concept of the User ID, which creates a persistent ID that gives analysts better insight into exactly how many people are visiting their site and from where.

2. More Custom Variables

With the old ga.js framework, users only have access to five custom variables (or 50 with the premium version). By contrast, analytics.js gives you 20 custom dimensions (as they’re called in analytics.js) in the free version and 200 in the premium version. This is a huge advantage for analysts who want to customize their analytics setup to track information that Google Analytics doesn’t gather by default, such as differences in behavior between logged-in and anonymous users, or how users interact with premium content.

3. More Flexible Tracking Codes

The legacy ga.js tracking code only captures data from users who are visiting your website from a browser. But there are plenty of other ways users can interact with your business—from mobile apps to physical POS systems. Universal Analytics makes an effort to capture all this previously unavailable information with three versions of its tracking code: analytics.js does the job for websites, the Analytics SDKs support mobile devices, and the Measurement Protocol collects data from other devices, like gaming consoles, call centers, and more. The result is a much more comprehensive system for collecting data, no matter how your users interact with your business.

The ability to reliably track user behavior and derive actionable insights from it is critical for building a successful online business. Are you ready to make the jump from ga.js to analytics.js or gain more insights into the people who visit your website? Explore data analysts and Google Analytics specialists on Upwork today.