Statcounter counter displays in Preview but not after Upload

My Statcounter code is placed in the Page Settings > Add Code > Footer as follows:

<!-- Default Statcounter code for VISION Security (Japanese)
http://visionsecurity.jp/ -->
<script type="text/javascript">
var sc_project=752692; 
var sc_invisible=0; 
var sc_security="a42fbbd1"; 
var sc_text=2; 
var scJsHost = "https://";
document.write("<sc"+"ript type='text/javascript' src='" +
scJsHost+
"statcounter.com/counter/counter.js'></"+"script>");
</script>
<noscript><div class="statcounter"><a title="Web Analytics
Made Easy - StatCounter" href="https://statcounter.com/"
target="_blank"><img class="statcounter"
src="https://c.statcounter.com/752692/0/a42fbbd1/0/"
alt="Web Analytics Made Easy -
StatCounter"></a></div></noscript>
<!-- End of Statcounter Code -->

When I Preview in Blocs or in Safari, I see the Counter number appear in the bottom left corner just fine. But when I upload to my web server, the number vanishes, and I cannot do a “Verify code” on the Statcounter site either.

The page in question on my server here:
https://visionsecurity.jp/

View the page code and you will see it’s there, properly placed just before the end body tag.

Would any of you know what is breaking the code when I upload it? Seems odd it works fine when I preview locally.

Thanks.

Hello JDW, turn off lazy load option when export.

1 Like

@Pealco, I’ve been so busy I’ve not had time to test your advice until today. Sadly, disabling Lazy Load does NOT fix the problem.

Adding the code displays the Counter in the bottom left corner when I preview in Blocs or preview in the browser. But when I upload to my web server and test in Safari using my domain name, the Counter does NOT display.

In other words, there is absolutely no improvement at all by disabling Lazy Load in Project Settings and then exporting. I also tried disabling Minify in Page Settings, but that doesn’t work either.

When I then use the “Verify” feature on the Statcounter website, it says the code is not properly installed. And yet, that code (in my opening post), is the Statcounter default recommended code, and it is properly placed before the ending body tag, just as they specify.

I know the code works because until last week that web page was built in SoftPress Freeway, and the code worked fine, displaying the Counter properly. But after I rebuild that page in Blocs and then added the code, the code never worked at all. So something in Blocs is killing my Counter code!

View my web page here.

Any further thoughts and advice would be greatly appreciated.

Thank you,

James

Hello James,

In your code I didn’t see any DIV with the code… only the script…

Send me please your page…

After the English div, add a new div bric.
Inside that Div add a code bric,
And inside that bric you add te code, not in the page preferences.

Quit your browser, then reload my page. I just edited it with the code inside a DIV, but the Counter number still will NOT display!

The only difference now is you can see the Japanese word for “Counter” (very bottom of that web page), but the actual Counter number (which is normally pulled from the Statcounter site) will NOT display.

image

Well, I cannot see that 744,451 number, and Statcounter gives me the following error too:

change that address to https please and try.

It is adding views…

The bad news is that HTTPS doesn’t fix the verify error:

The good news is I can now see the 744,45x number in Safari and Chrome. Firefox still blocks it, but maybe that’s because I use FireFox in “Private” mode. So I will ignore FireFox and the Statcounter verify error. It seems to be working.

Thank you for your kind help in testing, my friend!

–James

No problem… Here to help…

Best Regards…

1 Like