1

I just recently extended my SSL certificate to every page on my website in hopes of gaining some rank. I made sure to add the HTTPS version of the property in my Google search Console and in Analytics.

I then copied and pasted the tracking code into backend of my Big commerce website in the Web Analytics sections, along with the previous code from the non HTTPS version of my site.

I'm trying to find out if what I did was redundant or the correct thing to do. In Search Console I resubmitted the site map and my pages aren't really indexing so I'm trying to see if I messed up the code implementation.

The section where I entered the code looks like this

   <script>


(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-859355-1', 'auto');
  ga('send', 'pageview');

</script>

<script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-859355-1', 'XXXXXXXXX.com');
    ga('send', 'pageview');
    ga('require', 'ecommerce', 'ecommerce.js');

    function trackEcommerce() {
    this._addTrans = addTrans;
    this._addItem = addItems;
    this._trackTrans = trackTrans;
    }
    function addTrans(orderID,store,total,tax,shipping,city,state,country) {
    ga('ecommerce:addTransaction', {
        'id': orderID,
        'affiliation': store,
        'revenue': total,
        'tax': tax,
        'shipping': shipping,
        'city': city,
        'state': state,
        'country': country
    });
    }
    function addItems(orderID,sku,product,variation,price,qty) {
    ga('ecommerce:addItem', {
        'id': orderID,
        'sku': sku,
        'name': product,
        'category': variation,
        'price': price,
        'quantity': qty
    });
    }
    function trackTrans() {
        ga('ecommerce:send');
    }
    var pageTracker = new trackEcommerce();
</script>

<meta name="google-site-verification" content="Fi5p51MCg1LHIxCSzLNQCm5Xu3vmpxDhGEhogtbrUsI" />

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-859355-4', 'auto');
  ga('send', 'pageview');

</script>
1

You seem to mix two completely different things. You mention that you don't see the pages indexing in the Search console - but the code you give is the Analytics tracking code - which is completely unrelated to the Search Console. The fact that you messed up your Analytics tracking code will not have an effect on the indexing.

That said - your analytics code is wrong. You don't need to do anything special for tracking https pages - the standard analytics code will track both of them just fine (http & https).

If you want to add 2 trackers you will have to rename the second one (check the docs for more info) and combine those in the same script. With the code you're using it's quite possible that you are measuring the same traffic twice. Use the tag assistant plugin to check your implementation.

For you issue of https pages not indexing in the Search Console - did you properly redirect the http version to the https version?

  • Thanks for the advice Dirk. I have redirected http to https. I'll go ahead and do some research on my trackers with the link your provided. Thanks again, I appreciate the help! – Billy A Feb 8 '16 at 15:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.