# Save IP Address of Logged in User to the Record

> In many cases, it may be helpful to have the User's IP address added to the record. In the following example, I have an IP Address saved to the record…

Source: https://tadabase.com/docs/snippets/save-ip-address-of-logged-in-user-to-the-record  
Status: Not yet re-checked. Moved from our previous help site and not yet re-checked against the current product. Last edited Sep 20, 2024.

**In many cases, it may be helpful to have the User's IP address added to the record. In the following example, I have an IP Address saved to the record when the logged-in teacher edits grades.**

[Video](https://www.screencast.com/users/stellrechtmegan/folders/Snagit/media/e3b53e76-e5c0-4673-823a-d1e36cfdf356/embed)

**Step 1**

**Insert the following code to the JavaScript tab on the layout or pages you wish to use.**

```
$.getJSON("https://api.ipify.org?format=json", function(data) {
localStorage.setItem('ip', data.ip);
})
```

**For example, below the code is inserted into a details page to use on an edit form.**

![Screenshot for “Save IP Address of Logged in User to the Record”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-08/scaled-1680-/2022-08-23_13-14-44.png)

**Step 2 Add a text field where you'll store the IP Address:**

![Screenshot for “Save IP Address of Logged in User to the Record”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-08/scaled-1680-/2022-08-23_13-18-00.png)

**Step 3**

**In each form that you want to track, add one more option to set the field to the Browser Local Storage value of 'IP' as seen below.**

![Screenshot for “Save IP Address of Logged in User to the Record”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-08/scaled-1680-/2022-08-23_13-22-09.png)
