diff --git a/js/facets-views-ajax.js b/js/facets-views-ajax.js
index 0ee707749ccc732bb058158669c83cb86fca7d36..c15c5c88a944b7b9268cc75a93d0d0e396104306 100644
--- a/js/facets-views-ajax.js
+++ b/js/facets-views-ajax.js
@@ -65,6 +65,10 @@
 
   // Helper function to update views output & Ajax facets.
   var updateFacetsView = function (href, current_dom_id, view_path) {
+    // Update url.
+    window.historyInitiated = true;
+    window.history.pushState(null, document.title, href);
+    
     // Refresh view.
     var views_parameters = Drupal.Views.parseQueryString(href);
     var views_arguments = Drupal.Views.parseViewArgs(href, 'search');
@@ -82,10 +86,6 @@
 
     Drupal.ajax(views_ajax_settings).execute();
 
-    // Update url.
-    window.historyInitiated = true;
-    window.history.pushState(null, document.title, href);
-
     // ToDo: Update views+facets with ajax on history back.
     // For now we will reload the full page.
     window.addEventListener("popstate", function (e) {