jrnetwork Posted March 2, 2011 Share Posted March 2, 2011 I'm putting this code right before the </body> tag in the footer.tpl file which is part of the default whmcs issued template called 'portal'. As per the wiki page where it says to put this code below. I've also tried it with the {literal} tags outside the script tags, and tried it like a few others have in other posts on these forums, but my page still breaks. The code seems to work fine i.e. when I browse to a template page and 'view soure' the code is there, but the whole right-hand pane of the portal page then jumps below the main content area... with no other changes being made other than inserting the Google code exactly where it should go. I hope I'm not the only one who this is/has happened to... and that there is a work-around... <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")); {literal} try { var pageTracker = _gat._getTracker("UA-xxxxx-x"); pageTracker._trackPageview(); } catch(err) {} {/literal} </script> Here is a screen shot of what is happening. 0 Quote Link to comment Share on other sites More sharing options...
altomarketing Posted March 2, 2011 Share Posted March 2, 2011 what means } catch(err) {} {/literal} in your code ? you can use {php} include("includes/_analytics.txt"); {/php} and put analytics code in a txt , we use it at http://www.altomarketing.com/clientes 0 Quote Link to comment Share on other sites More sharing options...
jrnetwork Posted March 4, 2011 Author Share Posted March 4, 2011 I've put this into my code right before the </body> tag: {php} include("../includes/analyticstracking-whmcs.txt"); {/php} If you view the page here, you'll see it throws the side bar out of whack, placing it below the content in the default portal template. http://www.cubewebsolutions.com.au/support/ The analytics coding is actually showing in the source code, so that seems to be correct, it's just the issue above that I can't seem to fix. I don't know why inserting the code where I have should affect the template. Any help would be great, thanks. 0 Quote Link to comment Share on other sites More sharing options...
jrnetwork Posted March 5, 2011 Author Share Posted March 5, 2011 Hoping someone can still help me with this bug. 0 Quote Link to comment Share on other sites More sharing options...
jrnetwork Posted March 5, 2011 Author Share Posted March 5, 2011 in footer.tpl in the 'portal' template, there is a line of code missing. At the very top of footer.tpl, you'll see: {if $langchange}<div align="right">{$setlanguage}</div><br />{/if} <div id="side_menu"> There needs to be another </div> in there which is missing, so it becomes this: {if $langchange}<div align="right">{$setlanguage}</div><br />{/if} </div> <div id="side_menu"> This only comes to light for those people wanting to put Google Analtics right before the </body> tag of footer.tpl. Thanks to 'Sparky' for solving this. 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.