diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2020-01-06 14:32:30 -0500 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2020-01-06 14:32:30 -0500 |
commit | 10ef81bf85ad0a4bad0d204838e14c99ca2526f7 (patch) | |
tree | b4bb36a326d41de12d1a6181d2a2baf34696ac24 /plugins/jetpack/modules/google-analytics/classes/wp-google-analytics-legacy.php | |
parent | Updating script for Update (diff) | |
download | blogs-gentoo-10ef81bf85ad0a4bad0d204838e14c99ca2526f7.tar.gz blogs-gentoo-10ef81bf85ad0a4bad0d204838e14c99ca2526f7.tar.bz2 blogs-gentoo-10ef81bf85ad0a4bad0d204838e14c99ca2526f7.zip |
Update jetpack 8.0
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'plugins/jetpack/modules/google-analytics/classes/wp-google-analytics-legacy.php')
-rw-r--r-- | plugins/jetpack/modules/google-analytics/classes/wp-google-analytics-legacy.php | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/plugins/jetpack/modules/google-analytics/classes/wp-google-analytics-legacy.php b/plugins/jetpack/modules/google-analytics/classes/wp-google-analytics-legacy.php index ddca0e46..5356e7f4 100644 --- a/plugins/jetpack/modules/google-analytics/classes/wp-google-analytics-legacy.php +++ b/plugins/jetpack/modules/google-analytics/classes/wp-google-analytics-legacy.php @@ -236,19 +236,15 @@ class Jetpack_Google_Analytics_Legacy { global $product; $product_sku_or_id = $product->get_sku() ? $product->get_sku() : "#" + $product->get_id(); wc_enqueue_js( - "jQuery( function( $ ) { - $( '.single_add_to_cart_button' ).click( function() { - _gaq.push(['_trackEvent', 'Products', 'Add to Cart', '#" . esc_js( $product_sku_or_id ) . "']); - } ); + "$( '.single_add_to_cart_button' ).click( function() { + _gaq.push(['_trackEvent', 'Products', 'Add to Cart', '#" . esc_js( $product_sku_or_id ) . "']); } );" ); } else if ( is_woocommerce() ) { // any other page that uses templates (like product lists, archives, etc) wc_enqueue_js( - "jQuery( function( $ ) { - $( '.add_to_cart_button:not(.product_type_variable, .product_type_grouped)' ).click( function() { - var label = $( this ).data( 'product_sku' ) ? $( this ).data( 'product_sku' ) : '#' + $( this ).data( 'product_id' ); - _gaq.push(['_trackEvent', 'Products', 'Add to Cart', label]); - } ); + "$( '.add_to_cart_button:not(.product_type_variable, .product_type_grouped)' ).click( function() { + var label = $( this ).data( 'product_sku' ) ? $( this ).data( 'product_sku' ) : '#' + $( this ).data( 'product_id' ); + _gaq.push(['_trackEvent', 'Products', 'Add to Cart', label]); } );" ); } |