From 259c5abd828f8f9f717322aab0210d2594cd14ae Mon Sep 17 00:00:00 2001 From: mlnkng Date: Wed, 4 Oct 2023 10:25:51 -0700 Subject: [PATCH] Fix GA4 tracking for fullwidth treeview. (#1606) --- plugins/arDominionB5Plugin/js/fullWidthTreeView.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/arDominionB5Plugin/js/fullWidthTreeView.js b/plugins/arDominionB5Plugin/js/fullWidthTreeView.js index 7dc0c7ae61..8489ac5abf 100644 --- a/plugins/arDominionB5Plugin/js/fullWidthTreeView.js +++ b/plugins/arDominionB5Plugin/js/fullWidthTreeView.js @@ -295,12 +295,12 @@ var tempElement = document.createElement('div'); tempElement.innerHTML = doctitle[0].outerHTML; - // Extract the text content without HTML tags - var textContent = tempElement.textContent; + // Extract the text content without HTML tags and set title + document.title = tempElement.textContent; // Manually send page_view events for G4 Tracking gtag('event', 'page_view', { - page_title: textContent, + page_title: document.title, page_location: url });