Skip to content

Commit

Permalink
fix: send export files event in google analytics v4 (#1175)
Browse files Browse the repository at this point in the history
* fix: send export files event in google analytics v4

* fix: event name for download action
  • Loading branch information
richard015ar authored Aug 1, 2023
1 parent d42497c commit ce453d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion partials/content-cover-book-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
?>
<li class="dropdown-item">
<a rel="nofollow" onclick="<?php echo $tracking; ?>" itemprop="offers" itemscope itemtype="http://schema.org/Offer" href="<?php echo $url; ?>">
Expand Down

0 comments on commit ce453d9

Please sign in to comment.