Website to https not Counting all pages

Discussion in 'Help' started by jdpecon, Jul 5, 2018.

  1. jdpecon

    jdpecon New Member

    Joined:
    May 5, 2010
    Messages:
    10
    Likes Received:
    0
    Since we moved our website to an https platform at americasbesthistory.com, statcounter no longer counts all the pages despite the fact that all have the same statcounter code as far as we know.

    We have just started adding the new code to some pages, but since it was random before, we're not sure that will matter.

    Has anybody else had this problem? Is there something we're missing about a solution?

    Thanks in advance.

    Jeff
     
  2. webado

    webado Moderator

    Joined:
    Apr 29, 2004
    Messages:
    28,286
    Likes Received:
    6
    Your tracking code appears to have no sc_security value.
    You are also showing 2 versions of the tracking code on different pages.

    For instance on the homepage you have this code:

    <script type="text/javascript">
    var sc_project=315136;
    var sc_invisible=1;
    var sc_security="";
    </script>
    <script type="text/javascript"
    src="https://www.statcounter.com/counter/counter.js"
    async></script>
    <noscript><div class="statcounter"><a title="Web Analytics
    Made Easy - StatCounter" href="http://statcounter.com/"
    target="_blank"><img class="statcounter"
    src="//c.statcounter.com/315136/0//1/"
    alt="Web Analytics
    Made Easy - StatCounter"></a></div></noscript>​


    On the about.html page you have this code:

    <script type="text/javascript">
    var sc_project=315136; var sc_partition=1; </script>
    <script type="text/javascript" src="https:/www.statcounter.com/counter/counter.js"></script>
    <noscript><a
    href="https:/www.statcounter.com/free_invisible_web_tracker.html"
    target="_blank"><img
    src="https:/c2.statcounter.com/counter.php?sc_project=315136&amp;java=0"

    alt="web tracker" border="0"></a> </noscript>​

    Notice the url of the img tag in the noscript portion is different. Not sure that still works.

    The absence of an actual value for sc_security from both sets of code may mean the tracking code does not work.


    The latest version of the Statcounter tracking code actually presents differently, with an additional variable and using a different counter script:

    <script type="text/javascript">
    <!--
    //<![CDATA[
    var sc_project=315136;
    var sc_invisible=1;
    var sc_security="ssssssss";
    var sc_https=1;
    var scJsHost = (("https:" == document.location.protocol) ?
    "https://secure." : "http://www.");
    document.write("<sc"+"ript type='text/javascript' src='" +
    scJsHost+
    "statcounter.com/counter/counter_xhtml.js'></"+"script>");

    //]]>
    //-->
    </script>
    <noscript><div class="statcounter"><a title="web analytics"
    href="https://statcounter.com/" class="statcounter" rel="nofollow"><img
    class="statcounter"
    src="//c.statcounter.com/315136/0/ssssssss/1/" alt="web
    analytics" /></a></div></noscript>


    I suggest you generate fresh tracking code and get a security code as well, then replace it everywhere on your website.

     
  3. jdpecon

    jdpecon New Member

    Joined:
    May 5, 2010
    Messages:
    10
    Likes Received:
    0
    Thanks. We noticed yesterday that updating the code might be the problem, although it seemed to be counting sporadically. Now I wish there was a way to replace the code in all pages at once, but the current program we have won't do that large of search and replace. If anybody knows of one that would, that would be helpful.

    Thanks again.
     
  4. webado

    webado Moderator

    Joined:
    Apr 29, 2004
    Messages:
    28,286
    Likes Received:
    6
    I'd have expected that with so many pages your website would be built on a template so common elements like Statcounter tracking code, Google Analytics and other similar common bits of code could be inserted ONCE into the template and thus apply to the entire site.
    The thing is once a site has more than 5-6 pages it's not viable to not use a template.
     
  5. jdpecon

    jdpecon New Member

    Joined:
    May 5, 2010
    Messages:
    10
    Likes Received:
    0
    Hmmm. We're not very experienced web designers, although we do design on our own. I'll have to investigate whether we can manipulate the template instead of add it to the code page by page. Yes, with 540 or so pages, that's a chore. You've given me something to do Monday.
     
  6. webado

    webado Moderator

    Joined:
    Apr 29, 2004
    Messages:
    28,286
    Likes Received:
    6
    I'm sure you will crack it :)
     
  7. jdpecon

    jdpecon New Member

    Joined:
    May 5, 2010
    Messages:
    10
    Likes Received:
    0
    Not sure if it will be as easy as I'd like. Seems as if the template does not have a header.php file, and is using just a variety of css files to control things. Still checking through if I can do this easier than page by page. I don't think adding the code to any of the css files will work. Thanks webado for all your help.
     
  8. webado

    webado Moderator

    Joined:
    Apr 29, 2004
    Messages:
    28,286
    Likes Received:
    6
    It will be a footer module. Or somewhere where you have the </body> tag.
     
  9. jdpecon

    jdpecon New Member

    Joined:
    May 5, 2010
    Messages:
    10
    Likes Received:
    0
    Unfortunately, I don't think there is a footer module either and, (although I'll have to check again) there doesn't seem to be the </body> tag in any of the template files outside the generic html pages. If that's the case, I'll just have to go one file at a time. That's not too bad, between my last post to you and now, I did 55 files in about 15 minutes. Not the best use of my time, but if it's necessary, it's necessary.
     
  10. webado

    webado Moderator

    Joined:
    Apr 29, 2004
    Messages:
    28,286
    Likes Received:
    6
    Very weird. The template should have a </body> somewhere.
     
  11. jdpecon

    jdpecon New Member

    Joined:
    May 5, 2010
    Messages:
    10
    Likes Received:
    0
    I agree. The only pure </body> tag I've seen so far is on the individual html pages, not the template css and there's no template php files. In the style.css file there's the following, which I don't think is the right place ...

    /*
    Author: W3layout
    Author URL: http://w3layouts.com
    License: Creative Commons Attribution 3.0 Unported
    License URL: http://creativecommons.org/licenses/by/3.0/
    */
    h4, h5, h6,
    h1, h2, h3 {margin-top: 0;}
    ul, ol {margin: 0;}
    p {margin: 0;}
    html, body{
    font-family: 'Lato', sans-serif;
    font-size: 100%;
    background:#fff;
    }
    body a{
    transition: 0.5s all;
    -webkit-transition: 0.5s all;
    -o-transition: 0.5s all;
    -ms-transition: 0.5s all;
    -moz-transition: 0.5s all;
    }

    And there's mention of body is other css files plus js files but I don't think they're appropriate to tracking code, more about style of the page. Oh well, back to coding individual pages, which is not too bad, but would have been quicker if I'd have been able to edit the template pages all at once.

    Thanks again for your help.
     
  12. webado

    webado Moderator

    Joined:
    Apr 29, 2004
    Messages:
    28,286
    Likes Received:
    6
    Only files that contain html code can have a </body> tag. These files may be suffixed as .html or .php or .inc - it depends on how it's all implemented.
    It's unfortunate that your template isn't actually built for deployment over many pages.
    Next time you use a template take a bit of time to make it flexible.
     

Share This Page