From ce453d9783a07f8e3bffa54318293790a5314bf9 Mon Sep 17 00:00:00 2001 From: Ricardo Aragon Date: Tue, 1 Aug 2023 11:50:37 -0300 Subject: [PATCH] fix: send export files event in google analytics v4 (#1175) * fix: send export files event in google analytics v4 * fix: event name for download action --- partials/content-cover-book-header.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partials/content-cover-book-header.php b/partials/content-cover-book-header.php index 5b08d7dab..38ccb9f8d 100644 --- a/partials/content-cover-book-header.php +++ b/partials/content-cover-book-header.php @@ -70,7 +70,7 @@ // add_filter('pressbooks_download_tracking_code', function( $tracking, $filetype ) { // return "_gaq.push(['_trackEvent','exportFiles','Downloads','{$title}:{$filetype}']);"; // }, 10, 2); @codingStandardsIgnoreEnd - $tracking = apply_filters( 'pressbooks_download_tracking_code', "ga('send','event','exportFiles','Downloads','{$title}:{$filetype}');", $filetype, $title ); + $tracking = apply_filters( 'pressbooks_download_tracking_code', "gtag( 'event','exportFiles', {action: 'download', title: '{$title}', file_type: '{$filetype}'});", $filetype, $title ); ?>