Friday, 11 May 2012

Blogger: prevent new country-specific URLs


As you may have noticed, the people of Blogger have decided to implement a new URL system. Basically, the blog URL is changing to a country specific domain based on the origin of the browser request.
To simplify it, if you visit the web thought from the UK, the original blog URL (which is will be changed to
And that is happening for each country.
As a result, the new country specific URLs have, among others, a great impact on blogs traffic statistics. However there's a solution which is quite simple and which I explain in the following post.

Some considerations
Before explaining the solution I would like to share some ideas on the aforementioned Blogger policy.
The reason why country specific URLs were implemented, according to Blogger, is to be found in censorship. Some countries want to filter and in some way control what net surfers visit and see with their devices. Some countries want to prevent the spreading of ideas. I believe that mainly the problem resides on protesters, people against regimes and stuff like that. That is not the case of the web thought, as you may very well know.
Blogger, in any case, decided to comply to the request of those countries and implemented the country specific URLs.

Which is the problem?
Well, we are not talking about a problem but about some problems.
First of all, I've noticed that there's a direct impact on web statistics. Google Analytics seems to be able to deal with that. In the admin/tracking code section, it is possible to select multiple top-level domains as tracking target and thus obtain a correct JavaScript code to be inserted in the head of your blog template.
I must admit, I'm not really sure it is working properly though: I have to wait and see the results in the long term.

Second problem: links. Social networks like Facebook or Google+ are linking to a blog post using its URL. I don't know what kind of impact, that might have, but surely we might end up having different URLs for the same article. If it has some kind of effect on search engines, I don't know, but it's likely.
The same is happening with sites linking to country specific pages.

First of all, you should know that there's a ready solution for country specific URLs: adding a "/ncr" (no-country-redirection) at the end of the blog URL (like "").
That will override the country redirection.
If we want to make it permanent, we can add a short JavaScript snippet in the head of the blog template. The code will add the "/ncr" switch automatically:
<script type="text/javascript">
var str= window.location.href.toString();
if ((str.indexOf('.com/'))=='-1') {
var str1=str.substring(str.lastIndexOf(".blogspot."));
if (str1.indexOf('/')=='-1') {
var str2=str1;
else {
var str2=str1.substring(0,str1.indexOf('/')+1);
window.location.href =window.location.href.toString().replace(str2,'');
Just place the above after
<b:include data='blog' name='all-head-content'/>
in the blog template and you're done.

Other considerations
Google is still working on country specific URLs. They need to minimise the impact on SEO, or so they say.
The above solution seems a good starting point, but it could not work in the future, if Google decides to remove the "/ncr" switch.
We don't know what will happen but in the meantime I suggest to use the above code and if you have a Google Analytics account to swith to multiple top-level domains as tracking target.

If you have other ideas or experiences to share, please use the comments section below.


  1. You are providing the best comment and 'tutorial' I have been able to find on this subject. Thanks!

  2. Dear Marco!

    Thank you SOOOOOOOOOOOOOOOOO MUCH!!! Finally my google analytics started to receive data again. I had this problem since 1st of June - a sudden drop of visits by 95%... totally nonsense, as blogger statistics was unchanged, while analytics was not counting neither 100% sure visits (say I got 10 comments to my blog a day and 0 visits by analytics...). I tried like everything and had no clue what is going on. Two days ago, I had this idea, if it cant be connected to changing url, which I remarked few weeks ago. And so I have checked the tracking code to top-level domains, but helas, it did not work at all for me.... no change...

    BUT - the /ncr trick does the trick!!! I immediately started receiving traffic on google analytics!!!

    Thank you, thank you and again - THANK YOU!, you are my HERO!


    1. You are very welcome. I'm glad it helped!


Comments are moderated. I apologize if I don't publish comments immediately.

However, I do answer to all the comments.