Visitor Map
The visitor map shows the geographic distribution of website visitors. You can find it in the website analytics dashboard.
Map Provider Selection
Tianji selects the map provider from the configured environment variables:
- Use Mapbox when
MAPBOX_TOKENis set. - Otherwise, use AMap when
AMAP_TOKENis set. - Use the default map when neither variable is set.
When both variables are set, Mapbox takes priority.
Configure Mapbox
Set a browser-compatible Mapbox public access token:
MAPBOX_TOKEN=your-mapbox-public-access-token
Configure AMap
Set an AMap key that can be used by its browser map SDK:
AMAP_TOKEN=your-amap-key
Restart Tianji after changing either environment variable. For other deployment settings, see Environment Variables.
Token Safety
Map tokens are sent to the browser to load the map. Do not use a server-side secret token. Restrict the token to your Tianji domain in the provider console when that option is available.
Troubleshooting
- If the map is blank, check the browser network panel for
401or403responses, token restrictions, and provider quota limits. - If Tianji still uses the default map, confirm that the environment variable is available to the Tianji process and restart the service.
- If the map has no visitor points, confirm that the selected date range contains visits with geographic data.