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

# Lovable

> Install Trfyx analytics in a Lovable-built website.

# Add Trfyx to your Lovable website

Ask Lovable to add the Trfyx tracker to your app's shared layout or document head. The tracker must load once across the site, not separately inside each page.

## 1. Get the Trfyx tracking values

Use your Trfyx Website ID and the domain you want to measure. The tracking script URL is:

`https://app.trfyx.com/script.js`

This is the reference snippet Lovable should implement, adapted to your project's framework:

```html theme={null}
<script
  defer
  data-website-id="YOUR_TRFYX_PROJECT_ID"
  data-domain="yourdomain.com"
  src="https://app.trfyx.com/script.js"
></script>
```

<Warning>
  Replace `YOUR_TRFYX_PROJECT_ID` with your Trfyx Website ID and `yourdomain.com` with the domain you want to track. Keep the script URL exactly as shown.
</Warning>

## 2. Ask Lovable to install Trfyx

Paste this prompt into your Lovable project:

```text theme={null}
Install Trfyx analytics in my application.

Use this tracking script URL: https://app.trfyx.com/script.js
Use data-website-id="YOUR_TRFYX_PROJECT_ID" and data-domain="yourdomain.com".

Replace those two values with the Trfyx Website ID and domain I provide. Follow this project's framework conventions and add the tracker to the global document head or root layout so it runs across all pages and routes.

Install it once only. Do not add duplicate copies to individual pages or components. Show me the file you changed and explain how to verify that the tracker loads.
```

Review Lovable's changes before publishing. If the app uses React or Next.js, prefer its shared root layout or framework script component rather than adding a raw script to a single page.

## 3. Publish and verify

1. Publish the site.
2. Open the public URL in a normal browser tab.
3. Visit the homepage and several additional routes.
4. Open [app.trfyx.com](https://app.trfyx.com/) and check that activity appears in the correct Trfyx project.

## Troubleshooting

If only one page is tracked, move the tracker to the global layout. If no data appears, verify the Website ID and domain, inspect the browser's **Console** and **Network** tabs, and check whether CSP, consent settings, or browser extensions block the script. Remove any duplicate installation.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.