Juanzo Posted September 4, 2008 Share Posted September 4, 2008 I've read some threads about configuring Google AdWords / Analytics conversion tracking but I can't seem to get it done. Please bear with me if this has been explained before. This is the code I've used in complete.tpl to make AdWords conversion tracking. Should I do anything else?{php} $orderid = $this->get_template_vars('orderid'); $result = select_query("tblorders","amount",array("id"=>$orderid)); $data = mysql_fetch_array($result); $amount = $data["amount"]; $this->assign('amount',$amount); {/php} <link rel="stylesheet" type="text/css" href="templates/orderforms/cart/style.css" /> <p align="center" class="cartheading">{$LANG.orderconfirmation}</p> <p>{$LANG.orderreceived}</p> <div class="cartbox"> <p align="center"><strong>{$LANG.ordernumberis} {$ordernumber}</strong></p> </div> <p>{$LANG.orderfinalinstructions}</p> {if $invoiceid && !$ispaid} <div class="errorbox">{$LANG.ordercompletebutnotpaid}</div> <p align="center"><a href="viewinvoice.php?id={$invoiceid}" target="_blank">{$LANG.invoicenumber}{$invoiceid}</a></p> {/if} {if $ispaid} <!-- Google Code for Contratación de Servicios Conversion Page --> <script language="JavaScript" type="text/javascript"> <!-- var google_conversion_id = XXXX; var google_conversion_language = "es"; var google_conversion_format = "1"; var google_conversion_color = "ffffff"; var google_conversion_value = {$amount}; var google_conversion_label = "MXB0CN-wVhDLjrr9Aw"; //--> </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/XXXXX/?value={$amount}&label=MXB0CN-wVhDLjrr9Aw&script=0"/> </noscript> {/if} <p align="center"><a href="clientarea.php">{$LANG.ordergotoclientarea}</a></p> At Google Analytics settings, I've placed the following URL as exact match: /clientes/order.php?step=complete. Is that all or should I do something else? 0 Quote Link to comment Share on other sites More sharing options...
Juanzo Posted September 17, 2008 Author Share Posted September 17, 2008 Anyone that could give me a hand? 0 Quote Link to comment Share on other sites More sharing options...
Terra Posted October 10, 2008 Share Posted October 10, 2008 (edited) I take it that in your real code you replaced XXXX with your actual conversion ID number? The code I'm using is (NB: you must replace XXXX with your actual ID and label code!): For conversion tracking: <!-- Google Code for Sale Conversion Page --> <script language="JavaScript" type="text/javascript"> <!-- var google_conversion_id = XXXX; var google_conversion_language = "en_GB"; var google_conversion_format = "1"; var google_conversion_color = "ffffff"; var google_conversion_label = "XXXX"; //--> </script> <script language="JavaScript" src="https://www.googleadservices.com/pagead/conversion.js"> </script> <noscript> <img height="1" width="1" border="0" src="https://www.googleadservices.com/pagead/conversion/XXXX/?label=XXXX&script=0"/> </noscript> And below for E-commerce Analytics tracking: {php} $orderid = $this->get_template_vars('orderid'); $result = select_query("tblorders","amount",array("id"=>$orderid)); $data = mysql_fetch_array($result); $amount = $data["amount"]; $this->assign('amount',$amount); {/php} <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> Plus the usual Analytics code in the footer template. Edited October 10, 2008 by Terra 0 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.