rbro Posted December 19, 2007 Share Posted December 19, 2007 I'm trying to add the Google Analytics tracking code to my order form and I saw a few different threads on the matter, but I think they've changed the code recently and I want to do it the right way. There's a help document here: http://www.google.com/support/googleanalytics/bin/static.py?page=troubleshooter.cs&problem=tracking&selected=tracking_php&ctx=tracking_tracking_php_55504&aw_referral=#static Is this essentially what I'm looking for? Is this the best way to add the code to and track the WHMCS order process? 0 Quote Link to comment Share on other sites More sharing options...
nitro Posted December 20, 2007 Share Posted December 20, 2007 we use the static tracking code on our templates and it works fine 0 Quote Link to comment Share on other sites More sharing options...
meneketehe Posted December 23, 2007 Share Posted December 23, 2007 footer.tpl -----------snip----------------- {literal} your google code {/literal} </body> </html> 0 Quote Link to comment Share on other sites More sharing options...
uberhost Posted December 23, 2007 Share Posted December 23, 2007 If you put the code in footer.tpl just above the closing body tag, you won't need the {literal} tags, though they don't hurt. Be sure that if you're using SSL that you use the proper link (https://ssl.google-analytics.com/urchin.js) so that you don't cause a "mixed content" error with your security cert. 0 Quote Link to comment Share on other sites More sharing options...
rbro Posted December 23, 2007 Author Share Posted December 23, 2007 Thanks. I think they've changed the tracking code recently. Should meneketehe's code be used in lieu of the analyticstracking.php method they now suggest? Does anyone know? 0 Quote Link to comment Share on other sites More sharing options...
nitro Posted December 23, 2007 Share Posted December 23, 2007 Be sure that if you're using SSL that you use the proper link (https://ssl.google-analytics.com/urchin.js) so that you don't cause a "mixed content" error with your security cert. I had originally called all js from the https address - but looking at the new js from the OP above it seems that google now have ssl checking in their invocation code. 0 Quote Link to comment Share on other sites More sharing options...
uberhost Posted December 23, 2007 Share Posted December 23, 2007 I had originally called all js from the https address - but looking at the new js from the OP above it seems that google now have ssl checking in their invocation code. Well it's about time, lol. Good to know, thanks. 0 Quote Link to comment Share on other sites More sharing options...
rbro Posted December 24, 2007 Author Share Posted December 24, 2007 I tried this earlier and was getting an SSL/Cert mismatch warning, but it seems to be working now (fingers crossed). What do identify as the conversion page if I'm using this method though? order-complete.tpl? Should I put the tracking code in there as well to identify that uniquely somehow? 0 Quote Link to comment Share on other sites More sharing options...
rbro Posted December 25, 2007 Author Share Posted December 25, 2007 we use the static tracking code on our templates and it works fine So are you uploading the analyticstracking.php file and all that, or just putting the code in footer.tpl like others have suggested? I can't seem to get my order form to track in GA yet and every time I try something else, I have to wait 24 hours to see if it shows up or not......... 0 Quote Link to comment Share on other sites More sharing options...
rbro Posted December 26, 2007 Author Share Posted December 26, 2007 If anyone can clear this up for me I'd really appreciate it. I have seen 2 methods for getting this tracking to work. One involves adding the google code to the footer.tpl file as suggested by some in this thread and the other involves uploading a file called analyticstracking.php and then adding code to each .tpl file in the order form. Neither seems to work correctly for me. Does anyone know for sure? Google's help page says this: "After you've uploaded analyticstracking.php to your site, add the following line to each template page before the closing </body> tag: Alternatively, you can add the line above to an existing footer include file, which will place it in the correct area of the HTML document." Unfortunately, the line that's supposed to be added is missing from the google help page. Can anyone who has this working properly throw me a bone here? 0 Quote Link to comment Share on other sites More sharing options...
rbro Posted December 27, 2007 Author Share Posted December 27, 2007 OK, I think I have this tracking properly now. I added this to footer.tpl: <?php include('analyticstracking.php'); ?> Now what page do I define as the "completed order" page, so I can set up goals etc? I saw a number of threads on this but am unsure what is correct. 0 Quote Link to comment Share on other sites More sharing options...
brianr Posted December 27, 2007 Share Posted December 27, 2007 Good luck w/ that rbro -- There's another thread that here I've been begging in for clarification on the step=X problem I've been having.... No luck so far. 0 Quote Link to comment Share on other sites More sharing options...
rbro Posted December 28, 2007 Author Share Posted December 28, 2007 Well I see this page is being tracked: /client/order.php?step=4 but I got one signup so far today and I don't see anything that looks like order-complete being tracked, although I guess it will take another 24 hours.... 0 Quote Link to comment Share on other sites More sharing options...
Nimitz1061 Posted September 18, 2008 Share Posted September 18, 2008 The analytics.php file referred to is part of a sample setup presented by Google, its only one possible way to set up the tracking. Pay careful attention to the existing threads on this topic and we should be able to come up with a consistent, working code set. As for the checkout steps, we'll just need to map them out and post results... 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.