> For the complete documentation index, see [llms.txt](https://docs.zipy.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zipy.ai/integration/new-relic.md).

# New Relic

*Note: Make sure you have Zipy and New Relic installed on your site.*

### Step 1. Add the below code in \<head> tag on your site.

To get zipy session url with browser interaction we need to pass it as custom attribute to new relic.

```javascript
<script>
const getCurrentZipySessionURL = async () => {
  return await new Promise(function(resolve, reject) {
      let i = 0;
      const _interval = setInterval(() => {
          let zipySessionUrl = (window)?.zipy?.getCurrentSessionURL();
          
          if(zipySessionUrl){
              resolve(zipySessionUrl);
              clearInterval(_interval);
          }
          else{
              i++;
              if(i >= 4){
                reject("Some problem occurred while loading zipy.");
                clearInterval(_interval);
              }
          }
      },1500);
  });
}

getCurrentZipySessionURL()
.then(zipySessionUrl => {
    newrelic.setCustomAttribute('zipy_session_url',zipySessionUrl);
})
.catch((e) => {
    console.log(e);
});
</script>
```

### Step 2. Find Zipy session url in New Relic.

Go to **Query Your Data** section in New Relic.&#x20;

<div data-full-width="true"><figure><img src="/files/kHFMlnMcppTJJBoY1iJC" alt="" width="563"><figcaption></figcaption></figure></div>

Then put the below query in the input section and click run.

```sql
SELECT * FROM BrowserInteraction WHERE appName LIKE '<Your-Newrelic-App-Name>' 
```

*Note: Replace **\<Your-Newrelic-App-Name>** with your app name.*

You will be able to see Zipy Session Url against a BrowserInteraction in New Relic.&#x20;

<figure><img src="/files/Vc9wazH7PxcqdJ7BrCwJ" alt="" width="563"><figcaption></figcaption></figure>

For more information about `newrelic.setCustomAttribute()` please visit: <https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/setcustomattribute/>
