AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Analytics
1.5K members online now
1.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

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

If I have my website with http and https, which generated 2 different tracking ID, do I have to add the script for both (as shown below) in all my pages or only one is enough?

I don't really care to track http and https differently.  I saw help references that showed how to setup preference for www and non-www.  

 

<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-XXXX1621-1', 'auto');
ga('send', 'pageview');

ga('create', 'UA-XXXX1621-2', 'auto');
ga('send', 'pageview');

 

</script>

 

Re: Google Analytics

A T
Participant ✭ ✭ ✭
# 2
A T
Participant ✭ ✭ ✭
Hi,

Two trackers are not required.

Just make sure all the pages have the tracking code.

Best Regards,
A.T.

'Star' or 'Accept as Solution' if it helped.

Re: Google Analytics

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Thank you for responding.
I had different tracker ID for http and https, so was asking if I had to put both. The code is already added to all the pages.

On second thought I am guessing, the differentiation is only when I have to view the analytics from google account and need to select the web property (http or https) which matches the IDI have used in the code. If this is the case, I think I am good.

Thanks.