The Geographical Trouble with Google Analytics

Google Analytics logs all visits from Northern Ireland, Scotland, Wales and England as being from United Kingdom.

uk-1

Hmmm, debatable. They have their own parliaments… and football teams!

Politics aside, it is difficult to separate out visits from all of these countries once they are aggregated and logged as ‘United Kingdom’.  If visits were attributed to each country separately, it would be easy to group them using a simple regular expression or even just by adding up the number of visits from each.

The GA issues with UK

Markets. Here in the Republic of Ireland, we share many all-Ireland agencies with Northern Ireland, and for many companies the island of Ireland is considered one market.

Delivery areas. For other companies, Northern Ireland is a separate market to the Republic of Ireland, but they still need to analyse each country separately because they deliver to the North, but not to England, Scotland or Wales.

Customer segmentation. Because we are all on the one little island here, I often need to maintain an ‘Island of Ireland’ segment, as well as a ‘Republic of Ireland’ segment and a ‘Northern Ireland’ segment. The UK is far too blurry a distinction.

Is this a technical constraint?

Google Analytics derives the geographical location of a visitor from the IP address.  There is no country-specific characteristic I can use to detect what country an IP address is from. Telephone numbers have this: any phone number that starts with +353 is from the Republic of Ireland.  However, with IP addresses, you’d need to consult a massive directory of them to figure out where in the world it’s based. That takes too much time.

The directory does provide regional information, which means it is possible to detect whether a visit is from Northern Ireland, England, Scotland or Wales. Therefore, I believe Google could breakdown the UK segment for us.

GA loopholes

Ireland Only Filter. In order to restrict a profile to just collecting data on visits that originated within the Republic of Ireland only, we can apply a simple filter as follows:

Visitor Country = Ireland

include-republic-of-ireland-only

Northern Ireland Only Filter. There is no Visitor Country = Northern Ireland, since GA logs any visits originating there as having come from the United Kingdom.

But we can work around this. If you drill down on the UK, you will see that there are a limited number of “cities” in Northern Ireland, few enough that we can capture them in a city filter:

Visitor City = (Londonderry|Coleraine|Belfast|Portadown|Lisburn|Newry|Glengormley|
Dunmurry|Newtownards|Newtownabbey|Antrim|Enniskillen|Banbridge)

Note that there is a 255 character limit on filter fields, but you should still have sufficient space to add plenty more cities if required.

include-northern-ireland-only

Maintain a profile excluding all these cities, and keep an eye on the ‘Map Overlay’ report to ensure that no visits from Northern Ireland are visible on the map. If there are, you should add the city to your ‘Northern Ireland Cities’ filters so that they check for this new city in future.

But what if you want one profile with both of these restrictions applied? You can do it, but it’s a bit complicated.

If you apply:

Include Country is “Ireland” and Include City is “A Northern Ireland city”

to a single profile, any visit must satisfy both of these criteria in order to make it into the profile.

A single visit cannot match ‘originating in Republic of Ireland’ and match ‘originating in Northern Ireland’. So you have just filtered all traffic out of your profile. Much head scratching will follow as you wonder why your Google Analytics is broken and pick up the phone to call Niamh in IQ Content!

Why does this approach not work?

A number of includes on one profile should be considered conditions separated by ‘AND’
For example: ‘meets condition A AND meets condition B’

A number of excludes on one profile should be considered conditions separated by ‘OR’.
For example:    meets condition A OR meets condition B

So if we apply Include Ireland and Include Northern Ireland as two separate filters, because it is not possible for both of these conditions to be achieved concurrently, the result is that no visits make it into your profile.

Island of Ireland Filter?

We need somehow to get these into one big include filter.

Cascading Custom Advanced Filters
Robbin Steif in Lunametrics has written about this technique, and called them “Cascading Filters“. I like it, much more eloquent than my own term….”great, big, giant filters made up of filters on top of other filters”.

Rewrite the Country and City fields into a spare field

I thought I could use an advanced custom filter to achieve this.  The objective is to copy the Country and City into Custom Field 1.

So this spare field, Custom Field 1,  would contain the country followed by the city

For example: Ireland, Dublin or United Kingdom, Belfast.

Then I could create a single filter which includes any visits where Custom Field 1, contains either “Ireland” followed by anything or “United Kingdom” followed by any Northern Ireland city

Unfortunately when I select the City field as the field I wanted to rewrite, the City filter isn’t there as an option.  A pity, as this would have been an elegant solution.

rewrite-to-custom-field-1
Island of Ireland - Advanced Segment

Thankfully we now have Advanced Segmentation, with the added bonus that when I write an Advanced Segment filter, I can apply it to my historical data.

Unlike profile filters, using advanced segmentation I can join conditions that operate on two different fields (Country and City) using the logical operators, AND and OR.

advanced-segment

So, just drag and drop the Country from the left nav and type ‘Ireland’ , click the ‘Add “or” statement’ link, then drag and drop the City metric from the left nav, and paste in your Northern Ireland cities.  Give the segment a name, like “Include Island of Ireland”.

This advanced segment is now attached to the User ID which created it, so you can apply this segment in any profile you are viewing in any of your accounts.

If any of you across the pond have strong feelings on separating out visits from Northern Ireland, Scotland, Wales and England please comment, and let me know of any other approaches you have taken.  Surely, the Scots have something to say on this!

Categories Web analytics