Jump to content

[Resolved] How to get a Stat Counter to work?


gayledawn

Recommended Posts

Hi everyone :)

I have signed up for a GoStats Hit Counter, but I do not think its working

In Admin on Cubecart it shows that I am getting people to my Store, but on the Hit Counter from GoStats, there are no hits at all.

I have a code that needs to go somewhere...the code is

<!-- GoStats JavaScript Based Code -->
<script type="text/javascript" src="http://gostats.com/js/counter.js"></script>
<script type="text/javascript">_gos='c4.gostats.com';_goa=406814;
_got=2;_goi=35;_gol='Find out where your visitors come from with GoStats.';_GoStatsRun();</script>
<noscript><a target="_blank" title="Find out where your visitors come from with GoStats." 
href="http://gostats.com"><img alt="Find out where your visitors come from with GoStats." 
src="http://c4.gostats.com/bin/count/a_406814/t_2/i_35/counter.png" 
style="border-width:0" /></a></noscript>
<!-- End GoStats JavaScript Based Code -->

 

I read on here that someone made a document for their code, but did not check the "Show on homepage" button.

Because I do not know where to put the above code, I did what the person on here did and put the code in a document

Can someone please tell me where the code has to go please, as I want to track where my potential customers are coming from :)

Link to comment
Share on other sites

  • 5 years later...

 

Good afternoon. Help me please! I insert this code for my counter between the <body> </body> tags in main.php and my site stops showing after that. What am I doing wrong?
<!--LiveInternet counter--><a href="https://www.liveinternet.ru/click"
target="_blank"><img id="licntACC0" width="88" height="15" style="border:0" 
title="LiveInternet: показано число посетителей за сегодня"
src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAEALAAAAAABAAEAAAIBTAA7"
alt=""/></a><script>(function(d,s){d.getElementById("licntACC0").src=
"https://counter.yadro.ru/hit?t26.10;r"+escape(d.referrer)+
((typeof(s)=="undefined")?"":";s"+s.width+"*"+s.height+"*"+
(s.colorDepth?s.colorDepth:s.pixelDepth))+";u"+escape(d.URL)+
";h"+escape(d.title.substring(0,150))+";"+Math.random()})
(document,screen)</script><!--/LiveInternet-->

Link to comment
Share on other sites

The file main.php is a Smarty template. Smarty reserves for itself the use of braces to enclose Smarty commands and variables.

Adding HTML, CSS, or javascript code that has braces needs special handling.

{literal}
<!-- all of my code that may use braces -->
{/literal}

 

Link to comment
Share on other sites

2 hours ago, bsmither said:

Файл main.php - это шаблон Smarty. Smarty оставляет за собой использование фигурных скобок для заключения команд и переменных Smarty.

Добавление кода HTML, CSS или javascript с фигурными скобками требует особой обработки.


 

 

Did as you said didn't help. The site stops opening. Maybe it's the code of this counter?

Link to comment
Share on other sites

You have put the {literal} tag before your added code, and {/literal} after your added code.

Once the rendered template is delivered to your browser, that is when any javascript is executed, including any retrieval of additional javascript from outside sources. (Smarty does not run any of the javascript.)

I assume you can still access CubeCart's administration? In admin, Error Log, System Error Log tab, see if there are any entries that may explain what happened.

 

Edited by bsmither
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.

×
×
  • Create New...