Extension:LandingCheck

LandingCheck makes using localized and geotargeted landing pages easy.

When called with a landing page name and a set of user-specific parameters, the extension checks to see if a version of the landing page exists for the user's language and country. If not, it looks for a version localized for the user's language. If that doesn't exist either, it looks for the English version. If any of those exist, it then redirects the user.

Installation

 * 1) Download the latest snapshot and extract it to your extensions directory.
 * 2) Add  to LocalSettings.php.
 * 3) The extension should now be active.

Set up landing pages
First, create a set of localized landing pages. For a fundraising campaign, you might set up the following pages:
 * JimmyAppeal/en - landing page localized to English
 * JimmyAppeal/en/US - landing page localized to English and customized for users in the United States
 * JimmyAppeal/en/UK - landing page localized to English and customized for users in the United Kindom
 * JimmyAppeal/en/FR - landing page localized to English and customized for users in France
 * JimmyAppeal/fr - landing page localized to French
 * JimmyAppeal/fr/FR - landing page localized to French and customized for users in France
 * JimmyAppeal/fr/CA - landing page localized to French and customized for users in Canada

Create link
Next, set up a link that uses Javascript to construct the LandingCheck URL with user-specific query string parameters. For example:

Note on tracking: LandingCheck supports the utm_source, utm_medium, and utm_campaign parameters for click-through tracking. Juts add these to the query string to have them passed through. It also automatically passes the referrer.

Note on GeoIP lookup: LandingCheck does not perform a GeoIP lookup, but depends on the referring page to supply the user's country. As of 2010, all Wikimedia page views perform a GeoIP lookup against http://geoiplookup.wikimedia.org/ and record the user's country in the global Javascript variable.

Note on language: LandingCheck looks for whatever landing pages correspond to the user's wgUserLanguage variable. If none exist, it tries to find landing pages in the corresponding fallback language. So, for example, if JimmyAppeal/pt-br doesn't exist, it looks for JimmyAppeal/pt, and then JimmyAppeal/en (English is the final fallback for all languages).

Add more landing pages
As additional localized and geotargeted landing pages are created, users will automatically start being directed to them as appropriate. Make sure that any new landing pages added after your link has gone live are ready to use immediately. If you need to build new localized or geotargeted landing pages gradually, build them under different names and then move them into place once they are complete.