Alles wat ons dagelijks bezig houdt op het gebied van marketing, design en techniek delen we graag met je op onze blog. Van best practices voor een optimale customer experience, tips & tricks om de conversie te meten en te verhogen tot aan onze visie op disruptieve businessmodellen.

orange-juice.nl
/ 0

Development

Optimizing DomeinMagazijn.nl’s filter system

14 december 2016

We saw an opportunity to improve the filter system of DomeinMagazijn.nl’s domain overview page.

The info

On the overview page of Domein Magazijn when you clicked a letter or category the page would refresh, taking you to a new page with the filtered content. If you wanted to change your filter you would click again, then be taken to yet another new page. This process of filtering was extremely slow, it would take around 4-6 seconds just to get your new results.

A better approach

We knew this could be much better, our target was to get the filtered results to show in. Obviously you can’t load a new page and reliably get the results to appear in under 1 second, too many factors are against you. So, we looked at a client side solution.

History API

A really important part of this site is SEO friendly URLs, luckily the HTML5 history api is widely supported, this made the challenge a lot easier for us to tackle. Every time a user clicks a filter we could just push a new state to the browsers history, this keeps the same behavior which we loved before, but without a page refresh.

domainurl

Content rendering

Before, all the data on the page was rendered from the server onto the page making it impossible to filter client side because we would never have all the data. Now when the page loads we ask the server to give us all the data as JSON, from there we read the URL of the page, set the active filters then go through all the JSON and render just what we want.

Faster errors

Before when a filter didn’t have any results you’d have to wait for the page to load before you saw the error message. But now if you encounter a page with no results you can just change the filter and get new results instantly, no worries!

Smoother transitions

Another advantage of filtering client side is animation. When you click a new filter, we can fade the existing results, update them, then fade in the new stuff. It’s visually smoother and a much nicer experience for the end user.

domainfilter

Downsides

Unfortunately using the method has a few downsides:

  • We have to wait for the Javascript before we can show content.
  • Increased page size because of all the JSON.

Upsides

Fortunately using this method has a a lot more upsides:

  • We can manipulate the URL of the page client side.
  • Changing a filter is smoother with animations.
  • Changing a filter takes
  • We can catch mistakes in the URL and show alternate content.
  • We can show friendly error messages and make suggestions.

Future improvements

This is just V1 of the ‘new solution’, but there is still so much we could do to improve the page further.

  • Client side searching.
  • Smarter errors with suggestions or ‘frequently viewed’.
  • Ajax calls to the server for data to reduce initial page load.
  • Disabling filters when there are no results for a combination of filters.

Front end Developer @ Orange Juice.