How to setup up split testing only for the user coming only from a particular country in Google Analytics experiment section?

I want to show a different page for all traffic coming from USA and different page to user from UK.


Before you website loads have a conditional check to get the IP of the visitor. I would use Maximinds API because you store the database locally on your server to check IP to Country, this is faster than accessing off site API's, redirect the visitors based on their country to the test page. So everyone in the US gets directed to page A which can have multiple variations of a test being Test A, and people from the UK go to page B which is Test B. You would setup two different tests assuming you're testing different elements on each test page which is targeting the people in those countries.

| improve this answer | |
  • how to use the API with Google analytics experiment module. – Sidh Sep 25 '13 at 16:54
  • Is that a question? – Anagio Sep 25 '13 at 17:41

You would need to use geo IP address location to know which page to serve.

Here is a question from StackOverflow that can help you figure out how to do that: Get Country of IP Address with PHP

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.