Mobile app version of vmapp.org
Login or Join
Jessie594

: Do I use a different Google Analytics tracking tracking code when I set up the https version of my website in Google Search Console? I just recently extended my SSL certificate to every page

@Jessie594

Posted in: #GoogleAnalytics #GoogleSearchConsole #Https

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>

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Jessie594

1 Comments

Sorted by latest first Latest Oldest Best

 

@Heady270

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?

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme