1jQuery( document ).ready( function( $ ) { 2 //remove item from cart event 3 $('.product-remove').click(function(){ 4 console.log('click working'); 5 const productName = $('.product-title').text(); 6 const productPrice = $('.woocommerce-Price-amount').find("bdi").text(); 7 const productQuantity = $('.product-quantity').text(); 8 gtag("event", "remove_from_cart", { 9 currency: "USD", 10 value: productPrice, 11 items: [ 12 { 13 item_name: productName, 14 affiliation: "Google Merchandise Store", 15 index: 0, 16 item_brand: "Vector Medical Group", 17 price: productPrice, 18 quantity: productQuantity 19 } 20 ] 21 }); 22 }) 23 //add item to cart event - should cover both products 24 $('.single_add_to_cart_button').click(function(){ 25 console.log('click working'); 26 const productName = $('.product-title').text(); 27 const productPrice = $('.woocommerce-Price-amount').find("bdi").text(); 28 gtag("event", "add_to_cart", { 29 currency: "USD", 30 value: productPrice, 31 items: [ 32 { 33 item_name: productName, 34 affiliation: "Google Merchandise Store", 35 index: 0, 36 item_brand: "Vector Medical Group", 37 price: productPrice, 38 quantity: 1 39 } 40 ] 41 }); 42 43 }) 44 45} );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.