# Add GhostlyX in minutes

Whether you're running a static site, a Next.js app, or a traditional CMS, integration takes less than two minutes.

## HTML snippet

The simplest way to add GhostlyX to any website. Paste one `<script>` tag into the `<head>` of every page.

- Under 2 kB gzipped
- Loads asynchronously - zero layout shift
- No cookies, no fingerprinting

HTML

```
<!-- Add to your <head> -->
<script
  src="https://ghostlyx.com/js/script.min.js"
  data-site-id="YOUR_SITE_ID"
  defer
></script>
```

## Custom events

Track signups, purchases, clicks, or any other meaningful user action using the `ghostlyx()` global function.

Events appear in your dashboard immediately, broken down by page, referrer, and country.

JavaScript

```javascript
// Track a custom event
ghostlyx('Signup');

// With optional properties
ghostlyx('Purchase', {
  plan: 'pro',
  revenue: 29,
});
```

## Ready to integrate?

[Read the docs](/content/docs/index.html) [API Reference](/content/api-reference/index.html)
