Please bear with me since I´m by no means a developer I need to redirect our site to a specific landing page depending on the location of the user. When I first built this site in Muse I used a script that worked like a charm. However, I cannot seem to make it work in Webflow.
The script is as follows:
<html><head><title></title>
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script>
jQuery.ajax( {
jQuery.ajax({
url: '//freegeoip.net/json/',
type: 'POST',
dataType: 'jsonp',
success: function(location) {
// If the visitor is browsing from Spain.
if (location.country_code === 'ES') {
// Redirect him to the .
window.location.href = 'https://elpais.com/';
}
else
{ return false; }
}
} );
</script>
</head><body></body></html>
I have tried to paste this code in multiple locations (you see, I´m really far from being a developer), such as the project settings, the home page settings, etc. Both in the head tag and in the body tag. Also tried to embed the code, but nothing worked.
Does anybody know what I am doing wrong? Is this feature not possible in webflow?
It’s Ok you are not a developer. Instead of doing coding, there are tools can help. For example, GEO Targetly. It can identify visitors’ physical location by IP using IP geolocation technologies. Its particulate tool, GEO Redirect can auto redirect visitors to different URL webpages based on physical locations, like country, state, city.