Skip to content

Commit

Permalink
Fix GA4 tracking for fullwidth treeview. (#1606)
Browse files Browse the repository at this point in the history
  • Loading branch information
melaniekung committed Oct 12, 2023
1 parent 978d397 commit 259c5ab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/arDominionB5Plugin/js/fullWidthTreeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
});

Expand Down

0 comments on commit 259c5ab

Please sign in to comment.