> ## Documentation Index
> Fetch the complete documentation index at: https://docs.litlyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Vue

> Learn how to track your first visit & event using Vue.

## Pre-Requisites

Before proceeding, ensure you:

<Steps>
  <Step title="Have installed Vue">
    Get started [here](https://vuejs.org/)
  </Step>

  <Step title="Get your workspace ID">
    Sign up on [Litlyx Dashboard](https://dashboard.litlyx.com/) and create a new workspace.
  </Step>
</Steps>

## 1. Install

Choose your package manager & install the library.

<CodeGroup>
  ```bash npm theme={null}
  npm install litlyx-js
  ```

  ```bash yarn theme={null}
  yarn add litlyx-js
  ```

  ```bash pnpm theme={null}
  pnpm add litlyx-js
  ```

  ```bash bun theme={null}
  bun install litlyx-js
  ```
</CodeGroup>

## 2. Import

Now import litlyx in your `entry-point` file. Normally in Vue 2, it is called `main.vue` or if you use Vue 3 `app.vue`.

```javascript javascript theme={null}
import { Lit } from "litlyx-js"
```

## 3. Initialize

Next, initialize Litlyx library with your workspace in your entry-point file as follow:

```javascript javascript theme={null}
Lit.init("workspace_id");
```

This line of code will immediately start collecting web analytics such as: `Page Visits`, `Real-Time Users`, `Referrers`, `Bounce Rate`, `Countries`, `Unique Visitor Sessions`, `OS` & `Devices`.

## 4. Collect Custom Events

To customize your experience, add the following line in each function you desire. There is no limit to the number of events.

```javascript javascript theme={null}
Lit.event("your_event_name");
```

If you want to exercise more control over your events, you can use the `metadata` field.

```javascript javascript theme={null}
Lit.event("your_event_name", metadata: { 
  'type': 'MAIN_CTA', 
  'priority': 0.9
});
```

In your dashboard, you can group them in the `Events` tab with the `Event Metadata Analyzer`.

## 5. Your turn now!

Use litlyx in your Vue 2 or Vue 3 app at ease.
