Error by using Onestat counter

I placed a counter on the home page from OneStat.com. In the preview there are no problems, after publishing my homepage collapse and is totally white. Only the logo of OneStat is visible. I never had that problem, maybe the script is not written well?

Hereby the used script of Onestat whithout personal data

> <!--ONESTAT SCRIPTCODE START-->
> <!--
> // Het wijzigen van deze code is niet toegestaan en zal uw account definitief blokkeren!
> // Account ID : ******
> // Website URL: http://www.******
> // Copyright (C) 2002-2006 OneStat.com All Rights Reserved
> -->
> <div id="OneStatTag"><table border='0' cellpadding='0' cellspacing='0'><tr><td align='center'>
> <script type="text/javascript">
> <!--
> function OneStat_Pageview()
> {
>     var d=document;
>     var sid="******";
>     var CONTENTSECTION="";
>     var osp_URL=d.URL;
>     var osp_Title=d.title;
>     var t=new Date();
>     var p="http"+(d.URL.indexOf('https:')==0?'s':'')+"://stat.onestat.com/stat.aspx?tagver=2&sid="+sid;
>     p+="&url="+escape(osp_URL);
>     p+="&ti="+escape(osp_Title);
>     p+="&section="+escape(CONTENTSECTION);
>     p+="&rf="+escape(parent==self?document.referrer:top.document.referrer);
>     p+="&tz="+escape(t.getTimezoneOffset());
>     p+="&ch="+escape(t.getHours());
>     p+="&js=1";
>     p+="&ul="+escape(navigator.appName=="Netscape"?navigator.language:navigator.userLanguage);
>     if(typeof(screen)=="object"){
>        p+="&sr="+screen.width+"x"+screen.height;p+="&cd="+screen.colorDepth;
>        p+="&jo="+(navigator.javaEnabled()?"Yes":"No");
>     }
>     d.write('<a href="http://www.onestat.com/aspx/login.aspx?sid='+sid+'" target=_blank><img id="ONESTAT_TAG" border="0" src="'+p+'" alt="This site tracked by OneStat.com. Get your own free site tracker."></'+'a>');
> }
> 
> OneStat_Pageview();
> //-->
> </script>
> <noscript>
> <a href="http://www.onestat.com"><img border="0" src="http://stat.onestat.com/stat.aspx?tagver=2&amp;sid=316743&amp;js=No&amp;" ALT="website stats"></a>
> </noscript>
> </td></tr><tr><td align='center'><div style="COLOR:black;display:none;FONT-FAMILY:'Verdana';"><a href="http://www.onestat.com/dutch/dutch_home.html" style="text-decoration:none;">website tellers</a></div></td></tr></table></div>
> <!--ONESTAT SCRIPTCODE END-->

This question is not solved yet

We generally don’t provide code-level support. If you have privacy enabled though it might not work properly with that code. It’s pretty horrible on many levels. You most likely need to turn off “activate after consent”, though that will expose your visitors to tracking before they have a chance of denying.

I would use a different statistics package or ask them to provide a more modern snippet (specifically without document.write).

Thanks for the answer and suggestions.