Skip to content

Visitor Location

The Visitor Location function detects and provides access to visitor geographic location data through dynamic tags. Version 1.6.1 adds latitude and longitude dynamic tags for precise coordinate access.

What’s New in 1.6.1

  • @site(visitor.latitude): New dynamic tag for geographic latitude
  • @site(visitor.longitude): New dynamic tag for geographic longitude

Overview

Visitor Location detects the geographic location of site visitors using either browser geolocation or IP-based detection. The location data is then available through dynamic tags for use in templates, widgets, and conditional logic.

Key Features

  • Automatic visitor location detection
  • Browser geolocation (precise) with IP fallback
  • Multiple IP geolocation APIs with consensus
  • Configurable cache duration
  • Dynamic tags for all location components
  • Local IP detection filtering

Available Dynamic Tags

TagDescriptionExample Output
@site(visitor.location)Full location string“Los Angeles, California, United States”
@site(visitor.city)City name only“Los Angeles”
@site(visitor.state)State/Region name“California”
@site(visitor.country)Country name“United States”
@site(visitor.latitude)Geographic latitude (NEW)“34.0522”
@site(visitor.longitude)Geographic longitude (NEW)“-118.2437”

Setup Instructions

Step 1: Enable the Function

  1. Navigate to Voxel Toolkit → Functions
  2. Find Visitor Location in the list
  3. Toggle the switch to enable
  4. Click Save Changes

Step 2: Configure Settings

  1. Click the settings icon next to Visitor Location
  2. Select detection mode (IP or Browser)
  3. Set cache duration
  4. Save your changes

Configuration Settings

SettingDescriptionDefault
Detection ModeIP-based or Browser geolocationIP
Cache DurationHow long to cache location data (seconds)3600 (1 hour)

Detection Modes

IP Mode (Default):

  • Uses multiple free geolocation APIs (geojs.io, ipapi.co, ip-api.com)
  • Consensus-based results for accuracy
  • No user permission required
  • City-level accuracy

Browser Mode:

  • Uses HTML5 Geolocation API
  • Prompts user for permission
  • Precise coordinates (street-level)
  • Falls back to IP mode if denied

Using Latitude & Longitude (New)

The new latitude and longitude tags enable powerful location-based functionality:

Pre-fill Search Coordinates

Use the coordinates to pre-fill location search fields or map center points.

Distance Calculations

Pass coordinates to external services for distance-based sorting or filtering.

Map Integration

Center maps on the visitor’s location using the coordinate tags.

Example Usage

Your coordinates: @site(visitor.latitude), @site(visitor.longitude)

Use Cases

Personalized Welcome

Display “Welcome visitor from [City]!” messages using the city tag.

Location-Based Content

Show different content or promotions based on visitor location using visibility conditions.

Auto-Center Maps

Use latitude and longitude to automatically center maps on the visitor’s location.

Pre-fill Search Forms

Pre-populate location search fields with the visitor’s detected location.

Nearby Listings

Use coordinates to sort or filter listings by proximity to the visitor.

Troubleshooting

Tags Return Empty

  • Check that Visitor Location function is enabled
  • Wait for initial detection (may take a moment)
  • Local development IPs (127.0.0.1, localhost) are filtered out
  • Try clearing the cache

Inaccurate Location

  • IP detection is typically city-level accurate
  • VPNs and proxies affect IP-based detection
  • Switch to Browser mode for more precision
  • Mobile networks may show ISP location instead

Browser Mode Permission Denied

  • Falls back to IP detection automatically
  • Ensure site is served over HTTPS
  • User may have blocked location for all sites

Built by Code Wattz.