From e8d5ee4113f0c3591155ab6df8737adbf4571908 Mon Sep 17 00:00:00 2001 From: Austin Von Ville Date: Wed, 4 Dec 2024 14:16:07 -0700 Subject: [PATCH] Add settings tabs to GA (#1006) --- Generic_Plugin_Admin.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Generic_Plugin_Admin.php b/Generic_Plugin_Admin.php index 00413dedf..f6d51be80 100644 --- a/Generic_Plugin_Admin.php +++ b/Generic_Plugin_Admin.php @@ -493,10 +493,10 @@ function w3tc_ga(){dataLayer.push(arguments);} // Track clicks on W3TC Pro Services tab. document.addEventListener('click', function(event) { - if ( jQuery( event.target ).hasClass( 'w3tc-pro-services') ) { + if ( jQuery( event.target ).attr( 'data-tab-type') ) { w3tc_ga('event', 'click', { - 'eventCategory': 'w3tc-pro-services', - 'eventLabel': event.target.innerText + 'eventCategory': 'w3tc-tabs', + 'eventLabel': event.target.getAttribute('data-tab-type'), }); } });