janetgot Posted October 21, 2008 Posted October 21, 2008 Hi everyone, I've been trying to get Google Adwords conversion tracker as well as Adwatcher conversion tracker to work on my site. Neither is cooperating! The tech person at Adwatcher sent me some code to put on my includes/languages/english/checkout_success.php page as follows: * @AdWatcher Sale Tracking Code Follows */ $order_query = "select orders_id from " . TABLE_ORDERS . " where customers_id = :customersID order by date_purchased desc limit 1"; $order_query = $db->bindVars($order_query, ':customersID', $_SESSION['customer_id'], 'integer'); $order = $db->Execute($order_query); $adw_tracker = array(); $totals = $db->Execute("select value, class from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order->fields['orders_id'] . "' and (class = 'ot_total')"); while (!$totals->EOF) { $adw_tracker[$totals->fields['class']] = number_format($totals->fields['value'], 2, '.', ''); $totals->MoveNext(); } $amount =$adw_tracker['ot_total']; /* * @End Of AdWatcher Sale Tracking Code */ and define('TEXT_CHECKOUT_LOGOFF_CUSTOMER', "Some of your text here. <img height=1 width=1 border=0 src=\"http://s7.adwatcher.net/accountname/tracker.php?tp=s&amount=$amount\">"); When I try this, I get the following error: Fatal error: Call to a member function on a non-object in \includes\languages\english\checkout_success.php on line 19 Can anybody point me in the right direction on this? Also, in using Google Adwords, I've put the conversion tracking code in my checkout_success.php as follows: <script language="JavaScript" type="text/javascript"><!-- var google_conversion_id = xxxxxxxxxx; var google_conversion_language = "en"; var google_conversion_format = "1"; var google_conversion_color = "ffffff"; 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/xxxxxxxx/?label=purchase&script=0"/> </noscript> But my google account never shows a conversion. I'm sure people are puchasing through adwords, it's just not tracking them correctly. If anybody has any hints, I'd sure appreciate it! The site is www.hellynewengland.com and it's heavily modified. Thanks! Janet
danjt Posted October 21, 2008 Posted October 21, 2008 Put the adwords code in the includes/footer.php file, after the last table before the 2 final <?php tags. The checkout_success.php, I'm guessing, needs to go after the last closing table tag, just before the footer include? Dan
janetgot Posted October 21, 2008 Author Posted October 21, 2008 Put the adwords code in the includes/footer.php file, after the last table before the 2 final <?php tags. The checkout_success.php, I'm guessing, needs to go after the last closing table tag, just before the footer include? Dan Hi Dan, thanks so much for responding... I just wanted to clarify before I do this... On the adwords part, this code is to track sales, so wouldn't putting it in the footer file track every page that calls that file, and not just sales conversions? With the adwatcher code, the tech guy was having me put the code in the language file. I had it in the main checkout_success.php file but it didn't track from there. I did have my adwords code BELOW the footer include, so I'll move it up to just after the last table close tag and see if I get any results... if I do, I'll move the adwatcher code there too! I'd be so happy if this would work and we could track our ad ROI better.
danjt Posted October 22, 2008 Posted October 22, 2008 I thought the adwords code was Google analytics, sorry, just read it and realised it's not! I'd put it in the same place as the adwatcher code I would say? Be worth getting the analytics code from within ur adwords account and popping it in the footer too! Dan
janetgot Posted October 22, 2008 Author Posted October 22, 2008 I'm still not getting adwords conversions tracking code to read... I just did a test order, and when I got to the Thank you page, the url isn't checkout_success.php, but https://secure.authorize.net/gateway/transact.dll. I did a source code view and the tracking code isn't there. I'm using STS... I wonder if that might be the issue... ??? I'll dig some more... hmmmm.
janetgot Posted October 22, 2008 Author Posted October 22, 2008 I found the issue was, indeed STS... to resolve this, I created an individual STS template page for checkou_success.php.html and put my conversion codes there... I'm hoping this will fix BOTH problems with adwords and adwatcher. If so, I just need to figure out how to track actual order totals... but first I need to wait and see if this fix did the trick. Hopefully this will save somebody some time and $$$ in the future! Thanks again for your ideas! Janet
Recommended Posts
Archived
This topic is now archived and is closed to further replies.