Use Location Personalization Features in Cloudflare Workers

Share this video with your friends

Social Share Links

Send Tweet
Published 3 years ago
Updated 3 years 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.

egghead
egghead
~ 47 seconds ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today