From 4e72d3104316e9426af37694a9ac5349ba0caa98 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Fri, 24 Jul 2020 10:40:15 +0200 Subject: [PATCH] Fixed Google Analytics not tracking URLs with instant loading --- material/partials/integrations/analytics.html | 2 +- src/partials/integrations/analytics.html | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/material/partials/integrations/analytics.html b/material/partials/integrations/analytics.html index c5a96f0c8..eb7f428ab 100644 --- a/material/partials/integrations/analytics.html +++ b/material/partials/integrations/analytics.html @@ -2,5 +2,5 @@ This file was automatically generated - do not edit -#} {% set analytics = config.google_analytics %} - + diff --git a/src/partials/integrations/analytics.html b/src/partials/integrations/analytics.html index c8820bfbd..15403ae0a 100644 --- a/src/partials/integrations/analytics.html +++ b/src/partials/integrations/analytics.html @@ -48,7 +48,10 @@ /* Send page view on document switch (instant loading, custom event) */ document.addEventListener("DOMContentSwitch", function() { - ga("send", "pageview", document.location.pathname) + ga("send", "pageview", { + title: document.title, + location: document.location + }) })