gayledawn Posted September 11, 2015 Share Posted September 11, 2015 Hi everyone I have signed up for a GoStats Hit Counter, but I do not think its workingIn 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 documentCan someone please tell me where the code has to go please, as I want to track where my potential customers are coming from Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted September 11, 2015 Share Posted September 11, 2015 Google Analytics would probably be a better option. It's built in already. If you do want to use that you can add the HTML code to the main.php template file and main.checkout.php file if it exists. Make sure it's added to a template file that loads on every page. Quote Link to comment Share on other sites More sharing options...
gayledawn Posted September 11, 2015 Author Share Posted September 11, 2015 Thank you Al I will try that I can not find the main.php file AlI can only see Index.php...at my root is it that?Or is it in another folder? Found it lol...in templates duh lol Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted September 11, 2015 Share Posted September 11, 2015 main.php is in your /store directory/skins folder. Quote Link to comment Share on other sites More sharing options...
gayledawn Posted September 12, 2015 Author Share Posted September 12, 2015 thanks everyone After all that....I noticed my shop was closed for maintenance and I had forgot to open it....how stupid am I lol Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted September 12, 2015 Share Posted September 12, 2015 No more than the rest of us - glad it was that simple Quote Link to comment Share on other sites More sharing options...
gayledawn Posted September 12, 2015 Author Share Posted September 12, 2015 Thanks...this problem is resolved now Quote Link to comment Share on other sites More sharing options...
Baxymba Posted December 5, 2020 Share Posted December 5, 2020 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--> Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 5, 2020 Share Posted December 5, 2020 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} Quote Link to comment Share on other sites More sharing options...
Baxymba Posted December 5, 2020 Share Posted December 5, 2020 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? Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 5, 2020 Share Posted December 5, 2020 (edited) 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 December 5, 2020 by bsmither 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.