cclayton Posted August 12, 2010 Share Posted August 12, 2010 On the product_info page, I want to set up a Google Analytics Event when someone adds an item to the basket. So far I have the link: echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image(tep_output_string('/images/') . 'book_now.png', IMAGE_BUTTON_IN_CART, '139', '41', ' onclick = "checkBeforSubmit();"'); And its on this part that I am struggling due to the speach marks: onclick = "checkBeforSubmit();"'); I want to add this onto the onclick also: pageTracker._trackEvent("Product_Info", "Book", "$product_name") Any ideas? As because of the speach marks it just keeps getting messed up. Thanks, Chris Founder & Director at CSC Tours Ltd Link to comment Share on other sites More sharing options...
♥zelf Posted August 12, 2010 Share Posted August 12, 2010 echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image(tep_output_string('/images/') . 'book_now.png', IMAGE_BUTTON_IN_CART, '139', '41', ' onclick = "checkBeforSubmit();"'); And its on this part that I am struggling due to the speach marks: onclick = "checkBeforSubmit();"'); I want to add this onto the onclick also: pageTracker._trackEvent("Product_Info", "Book", "$product_name") echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image(tep_output_string('/images/') . 'book_now.png', IMAGE_BUTTON_IN_CART, '139', '41', ' onclick = "checkBeforSubmit(); pageTracker._trackEvent(\'Product_Info\', \'Book\', \'urlencode($product_name)\');"'); Something like this should work. Virtual Merchant a.k.a. Elavon, ViaKlix, Nova Payment Module Contribution Link to comment Share on other sites More sharing options...
Guest Posted August 20, 2010 Share Posted August 20, 2010 Chris, because the product_info.php is created dynamically depending on product, the google page clicks will not actually trap the specific product, so adding it to the page is redundant. Chris Link to comment Share on other sites More sharing options...
cclayton Posted August 24, 2010 Author Share Posted August 24, 2010 Chris, because the product_info.php is created dynamically depending on product, the google page clicks will not actually trap the specific product, so adding it to the page is redundant. Chris So I see... I have tried and cant get the ($product_name) to show the product name in it... does anyone know a way round this?? There must be a way. Thanks, Chris Founder & Director at CSC Tours Ltd Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.