diff --git a/matomo.js b/matomo.js
index f3b2f4c0f222d38ce8e81f296fcb35ed4f335b6a..2036f39a67938a4f3895b86790dca419a6b3f481 100644
--- a/matomo.js
+++ b/matomo.js
@@ -12,7 +12,7 @@ var result_count = 0;
 // compatibilité Magasin de thème
 if ( search_keywords && $('body').attr('data-template') && $('div.search_result') ) {
     result_count = $('li.result_count_results').text().match('[0-9]+')[0];
-    search_page = $('li.result_pager span').html().match(' ([0-9]+) /')[1];
+    search_page = $('li.result_pager input[name="page"]').attr('max');
     tracksearch = true;
 }