Search

I insert the statcounter.com tracking code into my website like pic1.But a piece of code displayed directly on the site footer like pic2,and this tracking code does not work.I can not get any information visit the Web site,How to solve this problem?

Attachments:
2.png and 1.png

Is it inside the body tag? I don't know statcounter but perhaps you may hâve to wait 24h to see the stats.

I have tested a few weeks, the problem is not solved.

Seems to me like the statcounter script is not working properly. Look at similar things done by Google etc. The script should never appear in the HTML output.

It looks like you're not actually writing a script element, but just a string that looks like one, try replacing your document.write line with the following

document.write('<script src="'+scJsHost+'statcounter.com/counter/counter_xhtml.js">x3C/script>');

and I'd also recommend removing the // (double slashes) from your CDATA lines, so just use

&lt;script><![CDATA[

and

]]>&lt;/script>

You don't need type="text/javascript" either as that is the default.

That should do it, I've tried it on a template here and it works fine. Hope it helps.

I can't edit my above comment, but the forum mangled the code, the &lt; should be less than signs obviously, here's a screenshot of what the code should look like instead....

Attachments:
Screen Shot 2016-05-18 at 10.34.34.png

@firegoby thanks , I modified the code based on your suggestions,but website footer problems still exist.

        &lt;script type="text/javascript">
        <![CDATA[

var scproject=*******; var scinvisible=1; var scsecurity="******"; var scJsHost = (("https:" == document.location.protocol) ? "https://secure." : "http://www."); document.write('<script src="'+scJsHost+'statcounter.com/counter/counterxhtml.js">x3c/script>'); ]]> </script>

like this

Attachments:
2016-05-19_8-52-57.png

Very odd, I just typed your code into a test page here and it fetched and loaded the script from StatCounter fine. Not sure what else to suggest, have you looked in your browser's developer tools to see if the resource is being fetched. Or if there are any console messages? If you look in the DOM browser ('Elements' tab in Chrome) you should see the script tag as an actual element in your page if everything is working.

OK,thanks very much,Let me try again.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details