Use Location Personalization Features in Cloudflare Workers

Share this video with your friends

Send Tweet
Published a year ago
Updated 10 months ago

We recently made more specific location personalization features available to all users on Cloudflare Workers. Previously only available to Enterprise users, these new features will allow us to give more detailed information in our example project, such as the city the user is visiting from.

Kristian Freeman: [0:00] We recently announced the addition of new location-based personalization tools in Cloudflare Workers. Specifically, things like city, continent, latitude, longitude, and a whole bunch of other fields here, which were previously only available to our Enterprise users are now available to everyone, including our free plan users.

[0:18] We can use these fields to update our template and make a little bit better presentation for our users. Let's say we'll still keep the emoji, which is based on cf.country, but maybe instead of just using the country, we can now come down here and say you're now connecting from cf.city in cf.country.

[0:39] Again, this was previously only available to our Enterprise users, but we've made it available to everyone because it's a really great feature that everyone should be able to use.

[0:47] If we open up our terminal and publish real quick using wrangler publish, and in the browser, you can see it says, "Hello there! You're connecting from Austin in US." You can see that we get the city information. It comes with every request.

[1:00] Just like everything else in this example, it will work no matter where your user is in the world.