How to Change a Website’s Domain in Google Analytics

Changing a domain in Google Analytics between and doesn’t cause GA to lose data or corrupt in any other way.

I first tested this, and wrote the original version of this post, in November 2012. Google Analytics has changed a lot since then so here’s an update on how to do it.

Why did we need to change our Google Analytics domain in 2016?

In mid-2015 we launched the first version of our website onto our domain

Zanzi evolved quickly as a business, and it wasn’t long before the website needed some major updates. These went live in mid-2016 and for reasons known to themselves, the developers implemented the new design onto

We decided not to move the site back to the www version of the site for 3 main reasons:

  1. we didn’t believe it would make much difference
  2. it gave us a chance to experiment and see what difference it did make
  3. leaving it on, would give us the opportunity to change the domain in Google Analytics and update this post.

But this did mean we’d need to change the domain in Google Analytics. Here’s how to do it:

How to change your domain in Google Analytics

1. Click on the ‘Admin’ label in the main menu


2. In the middle column, click ‘Property Settings’


3. Change the Property Name and the Default URL


4. Then scroll down, hit save, and you’re done!

What next?

It really is as simple as that. Google Analytics will report accurately on your site, as will any other research, reporting and analysis tools that you have.

Call Zanzi Digital on 01865 595260 if you would like advice on Google Analytics tracking or website migration advice for your business.

For the record, here’s the original post I wrote in November 2012:

When we audit a client’s website for the first time, we quite often find that although the site is on a ‘www’ domain, their Google Analytics (GA) profile has been set up on the ‘http’ version of the domain.

And if the site’s been set up properly and http redirects to www – or vice versa – this can cause problems: because GA sees the ‘www’ and ‘http’ versions of the site as two different websites.

The problems that this creates aren’t huge: in fact GA works fine across the two versions of the site in all areas except for In-Page Analytics. To be honest, I don’t use In-Page Analytics much, but it can provide additional nuggets of information to help paint a full picture of a website.

Google Analytics best practice

It’s worth noting that no single report, statistic or dimension can tell the whole story about your website’s health. Best practice is therefore more about bringing lots of things together to tell the story. And then combining them in a way that helps you to make informed judgements and invest your hard-earned marketing budget as wisely as possible.

Some history

In mid 2012 we came across this situation with one of our large charity clients: the site was set up on the http://www domain, GA was implemented to http://

I wanted to correct it, so we could see what insights might be offered by In-Page Analytics. I’ve known for a while that it’s possible to change the domain settings in GA but I’ve not been sure whether it would lead to historical data being deleted from the account. I could find just one good clear article on the subject, by Anna Lewis from Koozai.

Anna does a great job of explaining the topic, but as hers was the only good article I could find, and the stakes were high if we lost the client’s historical data, potentially loosing 2 years+ of tracking data, I decided not to make the change.

Fast forward to November 2012

In November 2012 we reviewed our new client’s website Silver Bee and found that the site was at and GA was set up on

We wanted to review In-Page Analytics because, as an e-commerce site, we were interested in how much of a product page could be seen ‘above the fold’. Since the site was very new and GA has only a few weeks data in it, the client allowed us to reset the domain and see what happens.

We did this by following Anna’s excellent article. GA had slightly evolved since she wrote it so here’s the process I took:

Update Domain URL in Google Analytics

  1. From your Account Home page – the very first one you get to in GA – select the property you wish to edit
  2. From the top right corner of the page, click ‘Admin’ – in the orange bar
  3. Select ‘Property Settings’
  4. Change the ‘Default URL’ from to
  5. Scroll to the bottom of the page to apply the changes
  6. Bonus point: before clicking ‘Apply’ you can connect up your Google Webmaster Tools account if you haven’t done so already.

Now go back up to the top of the page and click ‘Standard Reporting’. You’ll see all the historical data still in there.

Update Google Analytics Profile Names

  1. From the top right hand corner click ‘Admin’ – in the orange bar.. same as last time
  2. Select the profile name – if you have more than one you’ll need to do this for all of them
  3. Select ‘Profile Settings’
  4. Change the website’s URL from to
  5. Scroll to the bottom and click ‘Apply’
  6. Bonus point: if you’ve found that, although your site has site search, the data is not feeding into GA, there’s a setting on this page that needs to be enabled.

And… you’re done. With no loss of historical data.

We’d love to hear your experiences of changing domain names in Google Analytics, let us know in the comments below.


free website review


By | 2019-02-06T14:09:51+00:00 August 30th, 2016|Analytics and tracking|


  1. Tommy 29th November 2012 at 11:14 am - Reply

    Brilliant article! Just what I needed – up-to-date, straight to the point and answered my own worries perfectly.


    • Ned Wells 30th November 2012 at 8:08 am - Reply

      You’re welcome, Tommy. Really glad to have helped. Feel free to get back to me if you need any more information. Best wishes, Ned

  2. Tx36 4th February 2013 at 4:02 pm - Reply

    I was just looking for this.. 🙂 And as Tommy said this is the exact answer i needed 🙂

    Thanks a lot.. 🙂

    • Ned Wells 4th February 2013 at 5:30 pm - Reply

      Glad I could help! Please do get back if you need any more info

  3. Emily Lutz 15th May 2013 at 2:46 am - Reply

    This was hugely helpful! Thank you!!!

  4. Jesse Tom 17th June 2013 at 5:29 am - Reply

    Hi there,
    I am moving my domain, and i have been to the Google webmaster tools. Have redirected my old domain to the new one. Question; do i have to sign up for another analytics code for the new domain or just stick to the old one?
    If yes or no how do how do maintain the old results and do it the simpler way?
    Are you talking about the same thing?

    • Ned Wells 17th June 2013 at 10:05 am - Reply

      Hello Jesse Tom,

      If you want to keep your Google Analytics history, you’ll need to use the Google Analytics tracking code from your old domain.

  5. Justin Stortz 6th July 2013 at 4:00 am - Reply

    This worked like a champ. Thanks!!

    – @newfirewithin

  6. stef 9th August 2013 at 3:16 am - Reply

    Thanks so much!

    Simple, straightforward, success! yay!

  7. Jeet 17th September 2013 at 1:37 am - Reply

    Bull’s eye! Thanks heaps!

  8. Pete 26th September 2013 at 11:13 am - Reply

    Great – to the point, easy to follow and managed to get it done really quickly. Much better than instructions on other sites.


    • Ned Wells 26th September 2013 at 12:23 pm - Reply

      Thanks for the great feedback, Peter! Any other questions do just ask.

  9. Jacob Y. 6th November 2013 at 7:32 pm - Reply

    Worked like a charm! Very well written, straight to the point.

    I was freaking out before I read this article thinking that I’d have to export all of my historical data so as not to lose it.

    Thanks for saving me hours of work!

  10. Vinayak 13th November 2013 at 7:04 am - Reply

    Hi Ned,

    Good post.. we already have done mentioned changes in URLs in settings at account as well
    as profile level. though analytics is not tracking any traffic from the website.

    Please suggest what might have gone wrong.


    • Ned Wells 14th November 2013 at 10:19 am - Reply

      Hi Vinayak, good to hear from you.

      Difficult for me to assess what might be going on unless I can access your Google Analytics. If you don’t mind giving me access (use ned dot wells at gmail dot com) I’d be happy to take a quick look.


  11. Srini 23rd November 2013 at 3:40 am - Reply

    Hi Ned,

    Your article is excellent. I need one more help. Can you advise please.

    Our current site is (Just Example) and we have a profile created in GA with domain name set as in tracking script.

    Now we are changing the domain to How to address the change in GA with no impact on tracking.


  12. Srini 23rd November 2013 at 3:48 am - Reply

    Hi Ned

    Sorry i missed to mention one more important point. Both the URLs will exist and we are planning to do the redirection from to and i want to track both under the existing profile.

    Note: Due to company policies, i have not mentioned the site name i have given for example purpose.


    • Ned Wells 25th November 2013 at 4:49 pm - Reply

      Hello Srini, good to hear from you.

      I’ve not done this before so I don’t have direct experience of it. Having said that, I think you can just add the same tracking code that you have on to No need to do anything in Google Analytics.

      Do let me know how it goes!

  13. Dave Canham 5th December 2013 at 11:50 am - Reply

    Great article just what I was looking for. Worth noting that Google Analytics have renamed “Profiles” to “Views”, in case anyone was confused when reading the section about updating profile settings.

    • Ned Wells 5th December 2013 at 2:00 pm - Reply

      Thanks for your feedback, Dave!

      Yes, I wrote this article a while ago and Analytics has changed quite a lot since then. I’ll try and schedule in an update.

  14. zaid 7th December 2013 at 6:28 am - Reply

    hey thank you very very much.

  15. Dennis Bo Møller 8th December 2013 at 5:33 pm - Reply

    I was actually always wondering how this is done, you explained very easily, Thank you! :p

  16. Anju Yadav 3rd January 2014 at 8:59 am - Reply

    Hi Ned,

    I want to change default from http:// to https:// so should i change directly in default in property setting ? Is there any chances to lose historical data after changing http:// to https:// .Please help me out with same. Thanks

  17. John 20th July 2014 at 2:12 pm - Reply

    Very helpful thanks and also to Dave for the update.

  18. Greg 13th October 2014 at 8:36 pm - Reply

    Ned, our company changed our name and so also our website domain recently. It is essentially the same site, just updated branding and domain. We would like to keep our GA history from the old site but now track the new site (including forwards from the old domain). Any suggestions? Can you point me to a resource that can help me?


  19. Sree 23rd October 2014 at 7:39 am - Reply

    Thanks a lot, this artical was great help. I had a issue with website not showing the data due to the url was not with WWW

  20. Amie 24th October 2014 at 8:52 pm - Reply

    I switched my domain from www. to a non-www. But I’m still getting an error saying, “Error: The Website in your settings (, redirects into a different domain. (…” – does this take some time to take effect to stop seeing this error?

  21. Matt Dolge 11th November 2014 at 11:54 pm - Reply

    Great article Ned,

    After reading your article I am thinking about making the described changes…what would the change in analytics be if you made the following changes for each of these scenarios?

    1) to


    2) to

  22. Rihan 3rd February 2017 at 4:27 am - Reply

    If i change domain name in analytics then it will be bad effect for reporting?

    • Ned Wells 22nd February 2017 at 12:12 pm - Reply

      Hi Rihan, that really depends on what and how you’re reporting, Rihan. Can you get back to me with a bit more detail? Thanks.

  23. Ben 8th February 2017 at 8:03 pm - Reply

    Hey Ned.
    When I check the source code between dev and prod for a certain page, I see the GA code for dev but not for prod.
    Is that due to a change in domain?
    If so, how do you fix that.


    • Ned Wells 22nd February 2017 at 12:11 pm - Reply

      Hey Ben sorry not to have got back to you sooner on this. Is this still an issue for you? Happy to help if I can

  24. Pinar 12th May 2017 at 11:02 am - Reply

    Great help indeed, I was wanted to figure out how to implement this change on my google analytics. Thanks.

  25. Averra Vaid 19th January 2018 at 10:19 am - Reply

    I am going through a major change in my website. Please help me with that.
    My old website was and we created a new one for But later on, we moved our to old one
    My Analytics account is still fetching old data. How to update it or what else I can do for my analytics account in this matter.

    Averra Vaid

  26. Benson 13th March 2018 at 9:23 am - Reply

    Great post. It helps me to change the domain in google analytics. Thank you so much for sharing.

  27. Madhav 20th March 2018 at 11:09 am - Reply

    Hey Ned…..Excellent post! I want to change domain of my website from to . I am hoping the steps mentioned above will help without deleting the historical data.
    Also, If you can tell me difference between analytics.js and gtag.js in GA tracking code. Currently, the code snippet has analytics.js snippet embedded just before the .
    Thanks in advance

  28. Madhav 20th March 2018 at 11:25 am - Reply

    Another query- is profile same as views. I don’t find anything mentioned as profile in my Google Analytics.

  29. […] you’ll need to update your account to the new domain. Go to your Google Analytics dashboard, and change the domain associated on your account. Then, install the your tracking code on your new domain to ensure you keep previous data on the […]

  30. Martin Brendan 9th October 2018 at 3:16 pm - Reply

    I am really happy I’ve this information. Thanks!

  31. Michelle Carmody 10th January 2019 at 10:18 am - Reply

    You just made my day. So simple and I would never have known! Thanks.

  32. saeed 19th January 2019 at 8:29 am - Reply

    special thanks to you for this post

Leave A Comment