To set up geolocation with a Cloudflare Worker:
- Log in to Cloudflare
- Click “Workers”, then “Manage Workers” and after the page reloads “Create a Worker”

- In the new window:

- Replace the script on the left (1) with this:
addEventListener("fetch", event => {
const response = new Response(`{"country":"${event.request.headers.get("cf-ipcountry")}"}`, {
headers: {
"Access-Control-Allow-Origin": "*",
"Content-Type": "application/json"
}
})
event.respondWith(response)
})
- Click “Send” button (2) and then “Preview” (3).
If you did everything correctly, you will see your country code on the screen, like{"country": "GB")
- Now click “Save and Deploy” button and copy the URL that you will see in a popup window.
- Paste this URL in the geolocation settings field in Full Picture’s settings panel
And you’re done!