What’s the deal with Universal Variable?

Share this article

Bask in our UV rays! (Universal Variable, that is).

Universal Variable, or UV as we like to call it, is a JavaScript object which contains the details of any web page being viewed at the time. This could be information on the current visitor as well as your product information. This data layer allows you to analyze visitor behavior on a truly granular scale.

With user journey data containing information ranging from user details, products viewed, to all their previous transactions - UVs allow you to see the big picture. For example, the UV could contain details of the product being viewed at the time, an example being the product ID and its price, as well as the user’s details, like username and whether they’re a returning customer.

You can read us like an open book

Universal Variable was created with the future of data in mind. An online data standard has been launched, in which Qubit is a founding leader, which will save developers time when implementing technologies. At the moment, data comes in a range of different formats - each website and each technology having its own style. With the creation of a standardized data model, websites will all be able to, in simple terms, ‘talk’ to each other. The standard is being developed in conjunction with the web standards body: the W3C, making it an ‘official’ online standard.

To give you an example of why this is so important: if an ecommerce tag requires a transaction order ID, in this instance perhaps it’s within Opentag, then this information is easily retrievable from the UV. If the time comes and you’re no longer using Opentag, by having this future proofed data layer, your new TMS will still be able to retrieve information without you needing to go into the code of your website.

The Wonderful (UV) Wizard of Oz (Opentag)

The UV guys at Qubit are really spoiling you with this little tool. Our UV docs site is a guide to implementing Universal Variable onto your site - with information that, depending upon your business, whether it’s ecommerce to travel, helps design the parameters you’ll need and provides you with a sample code which you can simply copy over.

We’ve also created a demo website so you can see exactly how UVs work on a website. This case study takes you through each of the page types - including category, subcategory, basket, checkout and more - so you can see how your UVs should be set up as well as the vast amounts of information that you could be storing.

Tools of the trade

For those of you with UV on the brain, there are also some handy elements that might excite you. We’ve created a clever bookmarklet so you can validate your UVs on page - simply drag it to your toolbar, open it on your site, and voila: an instant validation tool slides across on command!

It automatically takes the UV from the page and once you have defined the page type, the validator tool then checks your code for errors. The UV Wizard also even contains a comprehensive list of our most up to date version of the UV validator schema so you can learn more about each of the parameters.

Have a cup of tea, you’ve mastered UV.

Hopefully, you’ve gotten all you need from Universal Variable here but if you’re interested in reading more about how UV has helped our other clients then definitely have a peruse of our recent case studies. We also have regular UV webinars, these are available to watch on-demand or you can sign up to our next live one.

Subscribe to stay up to date