I have a website that I'd like to track properly with Google Analytic. The main site is just MySiteExample.com. There is also a store setup so we are using https on part of the site. My question is do I create different profiles for each variation of the domain name? If yes, do I embed all 4 of them one after another?

URL Variations:

  • MySiteExample.com
  • www.MySiteExample.com
  • https://MySiteExample.com
  • https://www.MySiteExample.com

2 Answers 2


If you look at the example JS code at the Google Analytics help, it does not matter whether e.g. index.html is served through http://www.mysiteexample.com/index.html or https://www.mysiteexample.com/index.html, as both will trigger the same tracking event. If you serve different content depending on whether the protocol is https or not (i.e. two different index.html, if we stick to my example), see this question.

Without a good reason you should not serve exactly the same site at http://mysiteexample.com/ and http://www.mysiteexample.com/. That makes SEO worse, messes up bookmarks and links etc. Decide if you want to serve the site from www or not, and set up a redirect for the other version. See e.g. this question for details how to do this on the Apache web server.

  • Thanks @bhell can you clarify when you say "Without a good reason you should not serve exactly the same site at mysiteexample.com and mysiteexample.com" I'm not sure if you're saying I should not have an https added to my Google Profile or if you mean I should use the https or http throughout the entirety of the site. Commented Aug 19, 2013 at 1:01
  • I meant that it is generally not a good idea to serve the same page from two different URLs with and without www. They are called "Unique Resource Locators", and uniqueness is not having two different URLs pointing at the same resource...
    – bhell
    Commented Aug 19, 2013 at 14:34
  • Thanks @bhell what about for the https? Commented Aug 23, 2013 at 10:01
  • Is e.g. index.html served through http different from index.html served through http? Do you want to track these two resources separately? If you don't, you don't need to worry about the protocol. The tracking code in index.html will trigger the same tracking event in GA when served through either protocol.
    – bhell
    Commented Aug 23, 2013 at 14:30

You can use 301 redirects & Canonical Meta tags to address the issue here.

Select the url scheme you want to follow & then apply 301 redirects to other type of urls. This way your page ranking & weight will be preserved.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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