aris1234 Posted May 3, 2006 Share Posted May 3, 2006 I need to add some code to cubecart which does conversion tracking for my ads on google. All I need to do is add some javascript which is executed when a particular event occurs - in this case, i'd like to add it in after a successful sale via PayPal IPN. Am I right in thinking that it this code needs to be added in orderSuccess.inc.php in the includes directory? I tried adding it in with an 'echo' command like this: echo " <!-- Google Code for Purchase Conversion Page --> <script language=\"JavaScript\" type=\"text/javascript\"> <!-- var google_conversion_id = 1234567890; var google_conversion_language = \"en_GB\"; var google_conversion_format = \"2\"; var google_conversion_color = \"FFFFFF\"; if (1.0) { var google_conversion_value = 1.0; } var google_conversion_label = \"Purchase\"; //--> </script> <script language=\"JavaScript\" src=\"http://www.googleadservices.com/pagead/conversion.js\"> </script> <noscript> <img height=1 width=1 border=0 src=\"http://www.googleadservices.com/pagead/conversion/1234567890/?value=1.0&label=Purchase&script=0\"> </noscript> " Note, that I escaped all the quotes with a backslash. I added this code just before the "// get exchange rates etc" line. Basically adding this code made all my sales think they had failed. Is this the best place and way to add such code? Thanks. Quote Link to comment Share on other sites More sharing options...
Guest gwizard Posted May 4, 2006 Share Posted May 4, 2006 You need to add it to your skin file, not php. The one to edit is at skins/YOUR SKIN/styleTemplates/global/index.tpl Just put the code there at the end, but before the </body> tag. Quote Link to comment Share on other sites More sharing options...
Guest Posted May 4, 2006 Share Posted May 4, 2006 I don't wan't to doubt that last response of a seasoned forum member, and I could be totally wrong here...but: Isn't that code supposed to go on a 'webgood' page? Meaning, it should only be accessed AFTER the transaction (conversion) has been completed. Hence...'conversion tracking'. I would put that snippet of code on the page that says: 'thank you, your order has been completed'. If you put it on the index.tpl page, your Adwords stats will show sales everytime someone visits your site! That would make for one helluva day in your adwords account! :w00t: Quote Link to comment Share on other sites More sharing options...
Guest gwizard Posted May 4, 2006 Share Posted May 4, 2006 Oops, you are correct. I though that were the standart page conversion script. For purchase conversion you need to put it in skins/YOUR SKIN/styleTemplates/content/confirm.tpl in the successful purchase section. You'll see what I mean once you open that file. Quote Link to comment Share on other sites More sharing options...
Guest Posted May 4, 2006 Share Posted May 4, 2006 skins/YOUR SKIN/styleTemplates/content/confirm.tpl Thanks, I wasn't sure about that location... so you answered one of my future questions. :w00t: Quote Link to comment Share on other sites More sharing options...
Guest Posted December 4, 2006 Share Posted December 4, 2006 Oops, you are correct. I though that were the standart page conversion script. For purchase conversion you need to put it in skins/YOUR SKIN/styleTemplates/content/confirm.tpl in the successful purchase section. You'll see what I mean once you open that file. Hi, I am trying to do this as well, does it go in the <affliate tracking section> or? Let me know, most appreciated! Quote Link to comment Share on other sites More sharing options...
Guest Hellborn Posted April 25, 2007 Share Posted April 25, 2007 How can I do this in Cubecart 2 ? Yes I'm lazy haven't change to version 3 =) Quote Link to comment Share on other sites More sharing options...
Guest Posted August 14, 2007 Share Posted August 14, 2007 Can someone show me where exactly to put the adwords code. I know it needs to go into confirmed.tpl but I'm not sure where it needs to be placed. Thanks, Herschel www.whackerusa.com Quote Link to comment Share on other sites More sharing options...
Guest notting Posted September 9, 2007 Share Posted September 9, 2007 Yup i can't get this to work either. I have tried a few methods. Can anyone offer me help? Has anyone sorted this yet? Thanks Notting Quote Link to comment Share on other sites More sharing options...
Guest webicon Posted September 10, 2007 Share Posted September 10, 2007 Have you seen this post? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.