Jump to content

Google Analytics Integration ERROR


nick8701

Recommended Posts

Hi everyone,

 

Im trying to integrate google analytics into my site but when i add the code in:

 

<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>

<script type="text/javascript">

try {

var pageTracker = _gat._getTracker("MY TRACKER NUMBER");

pageTracker._trackPageview();

} catch(err) {}</script>

 

But i see this error on the whmcs page:

 

Fatal error: Smarty error: [in portal/footer.tpl line 13]: syntax error: unrecognized tag 'var' (Smarty_Compiler.class.php, line 583) in /home/USER NAME/public_html/whmcs/libs/Smarty.class.php on line 1095

 

In the google site they say:

 

If your site has dynamic content, you can use a common include or a template.

 

I dont know what this means or how i can make it work with whmcs.

 

Help much appreciated

 

Nick

Edited by nick8701
spelling
Link to comment
Share on other sites

Have you read the docs?

{literal}
<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>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("MY TRACKER NUMBER");
pageTracker._trackPageview();
} catch(err) {}</script>
{/literal}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated