The HTML5 Geolocation API-based content option is an alternative method for presenting location-specific content. This approach is significantly more accurate in determining the user’s location compared to the IP-to-location method (which is not crucial at the country and state level, but might be significant at the city level).
The drawback of this approach is that it necessitates the user’s consent to share their location.
The HTML5 eolocation API is a browser-based technology that enables us to determine the user’s geographical location with high accuracy. Upon receiving the users’ consent to share their location, the browser automatically provides the website with the user’s latitude and longitude coordinates. We then utilize a third-party database to translate the coordinates into relevant location information, such as city, state, country, or continent.
Note: Unlike our IP-to-location service, the HTML5 Geolocation API does not support timezone-based conditions.
Users who give their permission to share their location will receive location-based content based on the HTML5 Geolocation API, while users who haven’t granted their permission will be served with location-based content based on our IP-to-location service.
When utilizing the HTML5 Geolocation API, you have control over when and how you ask users for permission:
The geolocation API service works with any method If-So offers to display geotargeted content, including:
– Triggers
– Conditional Gutenberg blocks
– Conditional Elementor elements
– CSV Extension
– Geolocation DKI shortcodes
Yes, the Geolocation API is a much more accurate method. IP-to-location services are not 100% accurate. While their accuracy is higher at the country and state levels, it becomes less consistent at the city level. Learn more about IP-to-location services and their accuracy.
No, you should only set up the targeted content once. If-So handles everything automatically – users who grant permission to access their location will be served content based on the HTML5 Geolocation API service, while users who don’t grant permission will receive content based on the IP-to-location service.