Analytics
4.5K members online now
4.5K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Google analytics settings for move from http to https

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

My site moved from http to https.  First I had one tracking code on every page of my site, now I put two.  The only difference between the two codes is

UA-xxxxxxxx-1 and UA-xxxxxxxx-2.

Google analytics is showing both under my master account however it is only tracking traffic from the http version.  The https stays empty.

On my site (asp.net) I made a redirect rule that is working fine.  Everybody trying to access the http version is redirected to the https.

All traffic seems as usual, the only thing that worries me is why all traffic did not move to https and stays where it was in http.

Can somebody help me with this?

 

Thanks.

Rik

 

2 Expert replyverified_user

Google analytics settings for move from http to https

Top Contributor
# 2
Top Contributor

Hi,

 

Did you use a named tracker for the second property? Please check the document below about working with multiple trackers:

https://developers.google.com/analytics/devguides/collection/analyticsjs/creating-trackers#working_w...

Let me know if you have questions.


Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Google analytics settings for move from http to https

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Arnold, thanks for the input.  Both trackers are not named.  I named one of them now and will see within 24h if GA starts tracking the https site now.

I'll let you know.

Rik

 

Re: Google analytics settings for move from http to https

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Still not working.

Below the code that I put on every page, just above the body tag. The first tracker (http://) is working fine, the second not.

Below also how it is shown in GA.

Thanks for any help.

 

<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', 'https://www.google-analytics.com/analytics.js', 'ga');

ga('create', 'UA-xxxxxxxx-1', 'auto');

ga('create', 'UA-xxxxxxxx-2', 'auto', 'https');

ga('send', 'pageview');

</script>

 

ga.JPG

Google analytics settings for move from http to https

Top Contributor
# 5
Top Contributor

Hi,

 

You need to add the send pageview command for the named tracker too:

ga('https.send', 'pageview');

Let me know how you get on.


Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Google analytics settings for move from http to https

Explorer ✭ ✭ ✭
# 6
Explorer ✭ ✭ ✭

I think it is unnecessary complication.

If http version redirects to https ,then there is no need to have two UA codes.

Just put your old http version UA code to https version and thats it.

Google analytics settings for move from http to https

Top Contributor
# 7
Top Contributor

That's right, it doesn't matter if the protocol is http or https, GA will track every page that has the tracking code on it.


Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Google analytics settings for move from http to https

Visitor ✭ ✭ ✭
# 8
Visitor ✭ ✭ ✭

I agree that it is unnecessary to have both trackings but I wanted to be sure that the https will track before deleting the http.

And it works, now that I put the code right both are tracking.

But now I have another question as both trackers are giving different numbers.  The http is giving 4 times more visitors than the https and also the nature is different.

 

How do I understand those numbers as all visitors are directed to https even if they enter the http.

Can somebody explain me this?  If I delete the http tracking as it seems now, I will be left with 1/4 of the visitors.

I suppose the http tracking is the right one as this one is running for years now and numbers never changed suddenly.

Thanks.

Google analytics settings for move from http to https

Top Contributor
# 9
Top Contributor

If you are sure that every page on your site is tagged with both tracking codes, you are most likely getting referral spam in your -1 property.

Please check the article below about referral spam:

http://help.analyticsedge.com/spam-filter/definitive-guide-to-removing-google-analytics-spam/

Let me know if you have more questions.


Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Google analytics settings for move from http to https

Visitor ✭ ✭ ✭
# 10
Visitor ✭ ✭ ✭

Thanks everybody for helping me out with this.

Everything is tracking fine now.

Rik