Map/browser detection
Map/browser detection works in two ways. With a map, participants mark a location: they search for a place, click on the map or type coordinates, and a pin shows their answer. Without a map, the question records which browser the participant uses, without asking anything. Use the map for questions such as "Where did the incident happen?", and browser detection when you need to know which devices your participants use.
In the picture (OpenStreetMap): 1 the search field, which needs at least three characters, 2 Latitude and Longitude, filled in when participants set the pin, 3 the map. Participants click to set the pin or drag it to move it.
Map/browser detection is the Browser detection question theme of Short free text. The new editor lists it as Map/browser detection under Dates & data, the classic editor as Browser detection under Text questions. See Question themes.
Add a Map/browser detection question
In the new editor
- Click the purple + in the top bar. The question type picker opens.
- Under Dates & data, click Map/browser detection. The question appears at the end of the current question group.
- Click Your question here and type your question.
- In Question settings on the right, set Use mapping service on the Simple tab: Google Maps or OpenStreetMap via MapQuest for a map, Off for browser detection. A new question starts with OpenStreetMap via MapQuest.
In the classic editor
- In the Structure tab of the survey sidebar, click Add question.
- Click the button below Question type and select Browser detection under Text questions. Click Select.
- Enter the code and the question text.
- For a map, open Location in the settings on the right and set Use mapping service to OpenStreetMap via MapQuest or Google Maps. Leave it Off for browser detection.
- Click Save.

The two map services
- OpenStreetMap via MapQuest: works without any setup. Participants can search for a place, click on the map, drag the pin or type the coordinates.
- Google Maps: needs a Google Maps API key. Enter it in Global settings ⇒ General ⇒ Google Maps API key. Without a valid key, the map does not load. Participants drag the pin or right-click on the map to move it.
The place search of OpenStreetMap uses the GeoNames service with the user name limesurvey. To use your own GeoNames account, set $config['GeoNamesUsername'] in config.php.
Settings that matter
In the new editor, click the question to open Question settings on the right. The map settings are under Advanced ⇒ Location. In the classic editor, they are under Location on the right of the edit page.
- Use mapping service (also on the Simple tab of the new editor): Google Maps, OpenStreetMap via MapQuest or Off.
- Default position: where the map starts, as latitude and longitude separated by a space, for example
53.5511 9.9937. - IP as default location: starts the map at the approximate location of the participant, based on their internet address. Set it to No if the map should always start at Default position.
- On LimeSurvey Cloud, the location is looked up without any setup.
- The lookup needs an API key of the IPInfoDB service, entered in Global settings ⇒ General ⇒ IP Info DB API Key. Without a key, the map starts at Default position.
- Zoom level: how close the map starts (default: 11). Higher numbers show a smaller area.
- Save country, Save state, Save city and Save postal code: store these details of the pin location as well. They work with Google Maps, which looks up the address of the pin.
- Show platform information (new editor: Simple tab; classic editor: Display): for browser detection, adds the operating system to the browser.
How the answers are stored
With a map, the answer is the position of the pin as latitude and longitude, separated by a semicolon, for example 53.55682;9.99653. With Google Maps, the city, state, country and postal code follow, also separated by semicolons; the parts whose Save setting is off stay empty.
With browser detection, the answer is a text such as Chrome (156.0) | Linux (unknown): the browser with its version and, with Show platform information, the operating system. Participants see this text in a field they cannot change.
FAQ
The map starts somewhere unexpected. Why?
With IP as default location on, the map starts where the participant's internet connection appears to be, which can be the location of their provider. Set it to No and set Default position.
Can participants answer without using the map?
Yes. With OpenStreetMap, they can type the coordinates into Latitude and Longitude, or search for the place by name.
Can participants change the detected browser?
No. The field is filled in automatically and cannot be edited.
Can I record the browser without showing the question?
Yes: enter d-none in CSS class(es) (Display). The question is on the page but invisible, and the browser is still recorded. Do not turn on Always hide this question for browser detection: a hidden question is not put on the page at all, so nothing is detected.