International subdirectory implementation in Google Analytics

First of all, you will need a single property in Google Analytics for your website, with one tracking code used across all subdirectories. You will then use the Views feature to separate each subdirectory’s data.

You will need to set up a Google Analytics account (if you don’t already have one), and place the tracking code across all the pages on your website, which can be found in your Google Analytics account here:

country subdirectory set up 1

Next, put together a list of the URLs for all your country subdirectories.  As an example, I will use a Portugal subdirectory on a .com domain – www.example.com/pt. This method would also work for language subdirectories.

If you have built your international website using country subdirectories, your structure probably looks something like this:

www.example.com

www.example.com/it

www.example.com/pt

www.example.com/de

You will then need to create a new view in Google Analytics for each country, and add a filter to it so only traffic relevant to those country-specific pages can be seen within that view.

Important Note: Creating these filtered views will track the traffic to the subdirectory pages, but the view doesn’t signify the country which the traffic is from in terms of geographic location. If you created a French version of your site on a subdirectory targeted to users in France, and set it up correctly in line with Google’s guidelines, you would expect a large proportion of users to be located in France. However, you will still need to view the Geo reports within the Audience tab.

Also Remember: You should retain one main unfiltered view of everything that is happening on your website and it is always best practice to create a new view when you filter out any data.

Step 1.Add a new view for a country or language subdirectory

  1. Go to the Admin tab
  2. Click on the drop-down menu in the view tab and select “create new view”

create a new view image

  1. Then select Website
  2. Enter a name for your view
  3. Select the country and time zone
  4. Click “Create View”

Create a new view 2

Step 2 – Add a filter

Next, you need to filter the data so that only traffic to the Portugal subdirectory pages is reported in this view.

Simply follow the instructions below:

  1. Select the view you have just created
  2. Go to the Admin tab
  3. Click on Filters
  4. Click “New Filter”
  5. Amend the fields as below

Add a filter to a view

Step 3. Testing

Next, you need to test whether this is working correctly and check that the right data is being pulled through into the view. You can check this by going into the real-time section of the Reporting tab, and then open a page from the main domain or from another country subdirectory on your website. Within the real-time report in Google Analytics, the page you are currently viewing should not be reported as currently active as it is not contained within the filtered subdirectory:

real time reporting image

Whether or not you decide to segment your language or country content in this way is dependent upon how useful it will be to your business and if you need to quickly and easily analyse traffic to a particular subdirectory on your website. This method also allows you to create Goals for a specific view (e.g. a submitted contact form). Another potential benefit is that if you have separate country-specific Google AdWords accounts, you can link them up to the corresponding views in Google Analytics.

 

Have you just learned something new?

Then join the 80,000 people who read our expert articles every month.

  • By signing up to this form I agree, that Hallam may store my data and may contact me using the email address I have provided with promotional emails about products, special offers, and other information which may be of interest. Please also read our privacy policy. You can revoke your consent at any time

  • This field is for validation purposes and should be left unchanged.