> For the complete documentation index, see [llms.txt](https://ipforensics.gitbook.io/ipforensics/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ipforensics.gitbook.io/ipforensics/code-implantation/detect-visitors-from-eu-countries.md).

# Detect visitors from EU countries

In this tutorial we demonstrate how to detect whether a website visitor comes from a European Union member country based on their IP address with client side Javascript code :

```javascript
$.get("https://ipforensics.net/api/v1/origin?apikey=APIKEY", function (response) {
  if(response.meta_data.geolocation.in_eu){
    alert("By looking at this page you are agreeing to our use of cookies.");
  }
}, "jsonp");
```

{% hint style="success" %}
**Always reference the** [**API endpoint**](/ipforensics/api/ip-and-threat-intelligence-api.md) **for complete response result**
{% endhint %}
