Google Analytics Redirect rules

How to setup Google Analytics and Google Search Console/Webmaster Tools

When you move your site to ssl, you have to adjust your settings in Google Analytics and Google Webmaster Tools/Search Console accordingly. It’s not much work, but it’s important you fix it. In short, you need to set your primary domain in both Webmaster Tools as in Google analytics to your https domain. I’ll discuss Search Console first, but it really doesn’t matter in which order you do it.

Webmaster Tools / Search Console

In Google Search Console (Google Webmaster Tools), you should add the https variant, and you should set it to your preferred domain as well. You should add all variants of your domain:

  • http://domain.com
  • http://www.domain.com
  • https://domain.com
  • https://www.domain.com

   

If you don’t know how to add a new property, follow these instructions from Google.

The preferred domain should match the one in the general settings of WordPress, the site url. To set as your preferred domain, do the following:

  1. On the Search Console Home page, click the site you want.
  2. Click the gear icon, and then click Site Settings.
  3. In the Preferred domain section, select the option you want.

Google Analytics

After you move to SSL, you should change your domain in Google Analytics to https. This way, GA starts registering your hits again. If the redirect wasn’t set in your .htaccess for some reason, try to add it manually. GA might not register hits when the .htaccess redirect was not in place.

To do this, in Google Analytics, go to manage / property settings, and change the protocol to https.

To make finding this setting a bit easier, I’ve added some screenshots to illustrate the needed steps. The language on the screenshots is not English, but it will look the same in English.

step-1-start step-2

Go to “Manage”

step-3

Select “settings”

step-4

Now, change the protocol to https.

step-6

Related Articles

62 Comments

  • Noumaan

    I think users don’t need to add preferred URL in Google Search Console (webmaster tools) any more. Also I can’t find the option to select https variant. Indexing HTTPS pages by default

    • Rogier Lankhorst

      Reading that article, I’d agree that Google does it’s ranking of http and https automatically, but in Google Search Console, you are encouraged to 1) add all versions of your site, and 2) set a preferred domain. See also this article of Google https://support.google.com/webmasters/answer/34592?hl=en. To select the https variant, add it first as site, then set it as preferred domain.

      • Kathy Fisher

        If I previously added my site to Google Search console as http, so I have to make an entirely new entry in Google Search console to add it as https?

        Thank you!

        • Rogier Lankhorst

          Yes, you add it as a separate property. It seems a bit strange, but that’s how Google like’s it 🙂

          • Palash Madakwar

            I hate that, now I have 4 properties in search console for just one website.

          • Rogier Lankhorst

            New in search console is that you can group properties, which is a great improvement.

  • Erin Pavlicek

    Thank you so much, Rogier! This was a fantastic article, super easy, and very helpful! So grateful to you for all your work and services!

  • Barbara DiLucchio

    Hi Rogier,
    Does it matter whether I change the domain to https in Google Analytics first or Search Console first? Looking at the screen shots it looks like search console was done first but I want to be sure.

    Thanks very much,
    Barbara

    • Rogier Lankhorst

      No, the order doesn’t matter.

  • Felix

    I was change to https by let’s encrypt, but when I browse to my website, it does not appear blue locks. Pls help me. Tks.

  • Katia

    Rogier,

    Even though I didn’t change this yet in Google Analytics, it does still count views on my website. One question I do have is, if I change http to https in GA, will I loose the historical analytics of the http address?

    Thanks for your help.
    Katia

    • Rogier Lankhorst

      Hi Katia,

      On the sites I did the migration for, the historical data is kept after the change to https. Even if your hits are still registered, it’s better to let Google know what your primary url is.

  • Leana

    Hello,
    At the Google Search Console, I only got to enter the first variant of my site’s name and now I don’t understand how to verify it or how t enter the other versions. Such as http://www..etc or https:… I’m not understanding the Google Analytics portion of how to proceed with the real simple SSL plug in? Please help?

    Thank you

    • Rogier Lankhorst

      You can just add a new property in Google Search Console. I’ve added a link to Google instructions how to do this to the article. As for Google Analytics, if you follow the steps described in the article, you should be fine. Is there anything in these steps that is not clear?

  • Saul C.

    Thanks for the article! One question: Do we have to add a new property in Google Analytics with https instead? Or is making the switch from http to https as you described here all we need to do? I followed the article, and in analytics it still shows at the top http://mydomain.com instead of https. Is this normal? I have it set to https as you showed here but just want to clarify that this is all I need to do, or if I should add another property in analytics. Your clarification will be appreciated!!

    -Saul

    • Rogier Lankhorst

      It sounds like you’ve done it right. Is it possible the name of your property is “http://domain.com”? the name doesn’t have to contain the protocol, it’s just a descriptive name.

  • Hanif Adnan

    Hello, i already add all 4 variant URL to Webmaster and those are verified. But…i don’t know how to set one of the https domains as “preferred domain”. Can you help please ?

    • Rogier Lankhorst

      I’ve updated the article with instructions how to set a domain as preferred domain.

  • Martine Loeffen

    Hi there!

    Thanks for a great plugin!
    One question tho: after reactivating the plugin in WP 4.7.1, the “SSL activated! Don’t forget to change your settings in Google Analytics en Webmaster tools. More info.” message in my admin section has lost it’s x to close it.
    I’m very happy it’s all working, but I’d like to get rid of the message 😉 Saving the settings didn’t help.

    Any tips welcome, tia!

    Martine

    • Rogier Lankhorst

      Hi,

      I have tested it with the latest beta release from WordPress, and it works without problems. In some cases the x is hidden behind the “help” dropdown.

  • Satruk

    its true if using ssl/https, we can using histats?

    • Rogier Lankhorst

      I don’t really know histats, but I wouldn’t know why not.

  • mike

    Nice plug in. Thanks for explanation on how to update console and analytics.

  • Fernand

    Amazing piece of information right here. Thank you so much!

  • John Taylor

    Erg bedank Rogier, er zijn veel mensen dier dit vergeten.
    Grt.
    John.

  • Isa Joe

    Thanks Rogier for this wonderful plugin, just followed the link via the plugin and i gained alot of knowledge regarding the SSL certificate and verification on google. Going to google webmaster tools to ensure everything is verified.

  • Marques

    First of all, thanks a lot for making such a wonderful plugin. I used clouflare free ssl & then installed your plugin. Everything is working fine as of now. So, do I need to change anything in Htaccess file?

    • Rogier Lankhorst

      I checked your redirect on the http domain, it is already 301 redirected. So you’re fine.

  • Nick

    Hi Rogier,

    Seems my site is SSL Safe on the backend (dashboard) but not on the front end?

    Any suggestions would be much appreciated!

    Thanks

    • Rogier Lankhorst

      I can see a 301 redirect to https, and a nice secure lock on your site. Looks fine to me!

  • Denilson de Andrade Pereira

    I understood that I must create property all my URLs in case 4. Well, my site had as main URL http: // www on it was my site map and my international follow up. Now my main URL is https: // www and here is my question. Do I have to leave the map site in the new URL and do the international follow-up configuration only for https: // www?

    • Rogier Lankhorst

      Yes, I would reset all these to your new url, that’s the best.

      • Denilson de Andrade Pereira

        After switching to https I see my website disappearing from Google searches.

          • Denilson de Andrade Pereira

            Hello! I tested in Redirect Checker and received this information Error: in URLs found how should I proceed? Help me please. I find it strange because in my .htaccess file a 301 redirect is created after installing Really Simple SSSL

        • Rogier Lankhorst

          Can you mail me the domain at rogier (at) really-simple-ssl.com?

          • Denilson de Andrade Pereira

            Sent with subject: My domains.

          • Denilson de Andrade Pereira

            Hello Rogier! My sites are already normalizing and increasing in Google searches. Already started to have an increase of more than 50%. Thank you very much.

          • Rogier Lankhorst

            Glad to hear that 🙂

  • Maurizio Mau

    Hi and thanks for your plugin, work well, easily installed SSL, but now i lose over 50% of my traffic, and some keyword drop, any suggestion to fix ?
    I would not go back.
    Best Regards

    • Rogier Lankhorst

      If you have a 301 redirect, your traffic and ranking should normally be back in a few days, as all ranking will get transferred to the new domain. You can check this on http://www.redirect-checker.org/

  • Rubin

    Hello Rogier,
    Thank you for your explanation.

    You also say that we should set the preferered domain. However, we can’t choose the https version. See screenshot:
    http://imgur.com/9aDhXzU

    So should I just pick domain.com without https as the preferered domain?

    • Rogier Lankhorst

      Yes, you’re right. Just choose the domain that reflects your home_url in WordPress. So if your site is https://domain.com, choose domain.com as preferred domain.

  • Marc

    Thank you for this article and this plugin. That plugin was recommended by GoDaddy when I migrated 5 domains under SSL and it worked successfully.

  • eslam desouky

    After switching to https I see my website disappearing from Google searches.

    only appear in google usa

    note : i didnot put ant international target but i found that this site put to preferd domain www.

    now i changed to non preferd domains

    any advise ?

    • Rogier Lankhorst

      In my experience a site will drop from rankings for a few days after moving to SSL. Then it’s back again.

      • eslam desouky

        thanks i found that when it was on http i was making preferd for www

        after upgrading to https i kept it with the www and that was the big mistake for my experience because google was targiting http://www.domain.com even after upgrading

        then i made 2 sites https://www.domain.com and https://domain.com

        then i removed the targiting to non www or any in just 24h i found my site again the first page like always

  • rukhs

    Hi,
    I found it working cool but all my facebook shares and pins are gone from post. I am afraid all that vanish as it all done to http:// ?
    I have checked through http://www.redirect-checker.org/index.php as it said everything is fine. Can you guide me little bit, don’t want to loose my sharing stats, as it is very good for new visitors.

  • Gillian McAven

    Really simple SSL worked immediately! I had previously tried to get a result with just using plugin Insecure content fixer…that didnt work at all. so this is fantastic Then in the search console I followed your above instructions to add another property for the https version. I also changed the protocol in analytics. It seemed to generate another duplicate verification number…I thought it would be different…but I uploaded that, just overwrote the file. Then I could not set the preferred version to https. it now says I have to reverify the http version but not sure how to regenerate that again … and then just to complicate matters, (I do have a multi-site) in my yoast, I tried to generate a new sitemap but it went to a 404 page. umm. Any ideas would be gratefully accepted. Oh and you will see pageIDs in my site because the theme HeatMap got stuck and I could not activate the template I wanted, using postname permalink. But that is another issue so just ignore that.. thanks!

    • Rogier Lankhorst

      To verify your site you can in most cases just click “verify” in Google analytics. As you already have done so before, you will still have the html file on your site. As for the 404, try re-saving the permalinks in settings/permalinks, or just retry it in Yoast.

  • BJ Wright

    We have all 4 variants submitted into Search Console (http://, https://, http://www, https://www). My question is specific to selecting the preferred domain. Within my preferred profile (https://), I will select my preferred domain as mysite.com. But in the case of the other 3 profiles, does this mean i need to use the ‘Don’t set a preferred domain’. Even though it’s not differentiated within Search Console to use the https:// version of our site.

    At the moment I have all 4 profiles setting the preferred domain as mysite.com and I just wasn’t sure if I need to change this given which profile it stems from? Or if this even matters?

    • Rogier Lankhorst

      I would set the preferred domain for all properties, just to make sure.

  • Ibrahim

    Thank You so much you solved my problem .Very easy and good article.

  • Yiannis

    Thank you very much Rogier,

    very nice article and replies on comments, both helped me set up this correctly and save some or alot of time 🙂

  • RS Pandey

    Very sincerely Thanks Rogier Lankhorst for such an elaborate and easy to implement article on the subject. It helped me a lot in a successful migration from http to https.

Leave a Comment