« Back to Glossary Index

Definition

A web application or website that interacts with the user by dynamically rewriting the current web page with new data from the webserver, instead of the default method of a web browser loading entire new pages. – Wikipedia

Relevance in CRO

The concept of an SPA is a modern web development methodology that can significantly reduce load times and make websites function more like an app. Basically, an SPA uses JavaScript to load and render only the minimum necessary amount of content and UI based on user actions, instead of having to (re)load an entire page. For example, say you’re looking at the cart page of an e-commerce site. You have 4 items in your cart and go to remove one. An SPA would handle this by running a script that triggers when you click the “remove item” button. That script deletes the HTML container for that item and redrawing the cart total text elements with the updated price data. Thus, just the bits of the UI that actually change are reloaded, not the whole page.

SPAs present new challenges and difficulties to overcome for folks running experimentation programs. Page loads are gone, which are a backbone triggering mechanism of traditional analytics tools. No page loads means that all the analytics scripts and testing tools installed on your site get loaded once and then just sit there not doing anything after their initialization. No more tracking pageviews, triggering an experiment based on URL, etc. Well… that’s not entirely true. You just have to do those things in a different way. With an SPA everything becomes event-based, so it adds additional development overhead. Clicking a link doesn’t actually load a new page, instead it fires a “virtual pageview” event, which is what you hook into for analytics tracking or experiment triggers instead.

SPAs are a new(ish) web development process that comes with its own set of pros and cons. Many of the popular testing platforms have updated their platforms to deal with test execution on SPAs, but not all. It’s definitely something you need to consider when evaluating making changes to your tech stack.

« Back to Glossary Index