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 13, 2023
1 parent 9fd22ac commit 278bb8c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 7 additions & 1 deletion js/fullWidthTreeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@
// Insert new content into page
$('#main-column h1').first().replaceWith($(response.find('#main-column h1').first()));

// Get new document title for G4 Tracking
var doctitle = $('#main-column h1').first();

// Extract the text content without HTML tags and set title
document.title = doctitle[0].textContent;

// Add empty breadcrumb section if current page has none, but response does
if (!$('#main-column .breadcrumb').length && $(response.find('#main-column .breadcrumb').length))
{
Expand Down Expand Up @@ -269,7 +275,7 @@
}
};

// On node open: remove tooltip after a node is selected, the
// On node open: remove tooltip after a node is selected, the
// node is reloaded and the first tooltip is never removed
var openNodeListener = function (e, data)
{
Expand Down
6 changes: 6 additions & 0 deletions plugins/arDominionB5Plugin/js/fullWidthTreeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,12 @@
.first()
.replaceWith($(response.find("#main-column h1").first()));

// Get new document title for G4 Tracking
var doctitle = $("#main-column h1").first();

// Extract the text content without HTML tags and set title
document.title = doctitle[0].textContent;

// Add empty breadcrumb section if current page has none, but response does
if (
!$("#breadcrumb").length &&
Expand Down

0 comments on commit 278bb8c

Please sign in to comment.