diff --git a/core/modules/views/views.module b/core/modules/views/views.module
index f9bd098169..180770f7e5 100644
--- a/core/modules/views/views.module
+++ b/core/modules/views/views.module
@@ -60,7 +60,7 @@ function views_views_pre_render($view) {
           'view_name' => $view->storage->id(),
           'view_display_id' => $view->current_display,
           'view_args' => Html::escape(implode('/', $view->args)),
-          'view_path' => Html::escape(Url::fromRoute('<current>')->toString()),
+          'view_path' => '/' . ltrim(\Drupal::routeMatch()->getRouteName() === 'views.ajax' ? \Drupal::service('path.current')->getPath() : Html::escape(Url::fromRoute('<current>')->toString()), '/'),
           'view_base_path' => $view->getPath(),
           'view_dom_id' => $view->dom_id,
           // To fit multiple views on a page, the programmer may have
