# TrackJS

## Integration Steps:

### Step 1: Install TrackJS&#x20;

Ensure that TrackJS is properly installed and initialized within your application. This typically involves adding the TrackJS JavaScript snippet to your project's HTML file(s). Make sure to replace `<YOUR_TRACKJS_TOKEN>` with your actual TrackJS token.

```javascript
window.TrackJS && TrackJS.install({ 
    token: "<YOUR_TRACKJS_TOKEN>"
});
```

### Step 2: Retrieve the Zipy Session URL&#x20;

To include the Zipy session URL in TrackJS exception reports, you need to fetch the current Zipy session URL using the `getCurrentSessionURL()` function provided by the Zipy SDK. Assign the retrieved URL to the `zipySessionUrl` variable.

```javascript
const zipySessionUrl = window.zipy.getCurrentSessionURL();
```

### Step 3: Add Zipy Session URL as TrackJS Metadata&#x20;

In order to include the Zipy session URL in the TrackJS exception reports, you can leverage TrackJS's metadata feature. Use the `addMetadata()` function provided by TrackJS to associate the Zipy session URL with the `"zipy_session_url"` key.

```javascript
TrackJS.addMetadata("zipy_session_url", zipySessionUrl);
```

### Step 4: Verify Zipy Session URL in TrackJS Metadata&#x20;

When viewing a specific exception report in TrackJS, navigate to the "Metadata" section. Here, you should find the `"zipy_session_url"` key along with its corresponding value, which represents the Zipy session URL.

<figure><img src="https://3440602746-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcCYilc27NCELgnKQNPVF%2Fuploads%2FYl2TLiajNSiZkHmemKUv%2Fimage.png?alt=media&#x26;token=9b10a76b-e665-46d0-9eee-17e3afc78a18" alt=""><figcaption></figcaption></figure>
