# Add the AnyTrack Skill to Lovable

> Download the AnyTrack skill, add it to your Lovable workspace, and let the Lovable agent set up AnyTrack tracking in your app.

The AnyTrack skill teaches the Lovable agent how to set up AnyTrack in your app. Add the skill one time. Then ask Lovable to add AnyTrack tracking, and the agent follows the AnyTrack setup steps instead of guesswork.

The skill tells the Lovable agent to:

- Pass the AnyTrack Click ID with every lead. Each form, quiz, sign-up, or booking request sends the Click ID to the place that stores the lead: your CRM, your database, or a webhook. Your CRM conversions then match the ad click and the website session.
- Apply the AnyTrack Stripe prompt to your Stripe checkout, so each payment carries the Click ID. See [Stripe](/docs/stripe).
- Ask you a short list of questions before it changes code: your Property ID, your CRM, your payment tool, and your ad platforms.
- Install the [Tracking Tag](/docs/install-anytrack-tag) one time, in the head of every page.
- Leave automatic tracking to the Tracking Tag. The Tracking Tag sends a `PageView` on each route change, so the agent adds no router code. See [Single Page App Tracking](/docs/single-page-tracking).
- Propose an event plan for your funnel, with standard events where they fit, and ask you to name your custom events. For example, the agent can name each quiz step `QuizStep - Personal details`.
- Send the visitor's email as `refId` at the first step that collects it, so later conversions can match the ad click. See [External ID as Click ID](/docs/external-id-as-click-id).
- Add the customer data that your forms collect to each event. See [Event Attributes](/docs/event-attributes).
- Send `FormSubmit` on the final form submit, and the custom event that you ask for.
- Write the Click ID to the field that your CRM uses. See [Pass the Click ID from External Forms to Your CRM](/docs/external-form-to-crm).
- List the other pixels and tag managers in your app, so you can remove the ones that send duplicate data.

<Prerequisites
  title="Before you begin"
  items={[
    { label: "You have an AnyTrack property and its Tracking Tag (Property Settings, Tracking Script)", done: true },
    { label: "You can edit the Lovable project", done: true },
    { label: "To add a workspace skill, you are a workspace owner or admin in Lovable. Any member can add a personal skill.", done: true },
  ]}
/>

## Download the skill

- [Download the skill as a ZIP file](/assets/skills/anytrack-tracking.zip) (for **Upload ZIP**).
- [Open the skill as text](/assets/skills/anytrack-tracking/SKILL.md) (for **Write manually**).

Both links contain the same skill. The skill name is `anytrack-tracking`.

## Add the skill to Lovable

Pick one of the two methods. A workspace skill is available to every project and every editor in the workspace. A personal skill is available only to you.

### Add a workspace skill (Upload ZIP)

1. Download the ZIP file.
2. In Lovable, open **Workspace settings**, then **Skills**.
3. Click **Add**, then select **Upload ZIP**.
4. Drag the ZIP file into the window, or browse to it.
5. Lovable checks the file and adds the skill to your workspace.

### Add a personal skill

1. Download the ZIP file.
2. In Lovable, open **Account settings**, then **Personal skills**.
3. Select the workspace at the top of the page.
4. Open the menu next to **Add skill**, then select **Import skills**.
5. Select the ZIP file.

### Write the skill manually

Use this method if you cannot upload a file.

1. Open the skill as text, and copy all of the text below the second `---` line.
2. In Lovable, open **Workspace settings**, then **Skills**. Click **Add**, then select **Write manually**.
3. In **Name**, enter `anytrack-tracking`.
4. In **Description**, paste the `description` line from the top of the skill.
5. In **Content**, paste the text that you copied.
6. Click **Add skill**.

## Connect the AnyTrack Docs MCP

The skill covers your app. The [AnyTrack Docs MCP](/docs/anytrack-docs-mcp) gives the Lovable agent the setup guide of each integration. The guides cover CRMs, form tools, booking tools, Stripe, and ad platforms. Connect it in Lovable too. The skill tells the agent to search the docs before it writes code for an integration. If the Docs MCP is not connected, the agent recommends it at the start of the interview, with the setup steps.

<Callout icon="❗" theme="error">
**The most common break: a form without the Click ID**

A quiz or a form sends the lead to your CRM without the Click ID. Later, the CRM sends the conversions of that lead to AnyTrack, also without the Click ID. AnyTrack cannot tie them to the ad click and the website session, and can only try an email match. The skill makes the agent carry the Click ID on every lead path, and list each path with its status before it changes code.
</Callout>

## Run the skill

1. Open your project in Lovable.
2. In the project chat, type `/` and select **anytrack-tracking**.
3. Write your request after the skill, for example: `Set up AnyTrack tracking for this app. Here is my Tracking Tag: <paste the tag>`.
4. Answer the agent's questions.
5. Review the event plan and the list of files. Ask for changes, then approve.
6. Publish the app, then verify the setup (next section).

Lovable can also apply the skill automatically when your request is about AnyTrack tracking. The skill also applies when you later ask Lovable to add a form, a quiz, a sign-up, or a checkout. To make sure, write `Apply the anytrack-tracking skill to the new form` in your request.

<Callout icon="⚠️" theme="warning">
**Remove the old pixels of connected ad platforms**

The Tracking Tag loads the pixel of each ad platform that you connect in AnyTrack, when **Enable Tracking** is on in the pixel **Settings** tab. A second copy of that pixel sends the same events again. When the AnyTrack setup goes live, remove the old pixel code and the [Google Tag Manager](/docs/google-tag-manager) tags of each ad platform that the Tracking Tag loads. Keep the pixels of ad platforms that you do not connect in AnyTrack.

If **Enable Tracking** is off, or a Meta Pixel uses **Enable Server Only Tracking**, the Tracking Tag does not load that pixel in the browser. See [Pixel Settings](/docs/facebook-ads#pixel-settings-enable-tracking-and-server-only-tracking). The agent lists the pixels and removes one only after you say yes. See [Deduplication](/docs/deduplication).
</Callout>

## Verify the setup

1. Open the published app with the [Pixel Helper](/docs/anytrack-chrome-extension) extension. The extension shows your Property ID.
2. Go to three pages of the app. The [Conversions Report](/docs/conversions-report) shows one `PageView` for each page.
3. Go through your funnel with a new email address. The Conversions Report shows each event of the event plan one time.
4. Open the lead in your CRM. The Click ID field holds a value that starts with your Property ID.
5. Make a test payment in Stripe test mode. The payment shows `atclid` in its metadata.
6. Map each custom event in [Event Mapping](/docs/event-mapping) before an ad platform uses it.
7. If your CRM is connected in AnyTrack, the CRM integration also records the lead. For example, the [HubSpot integration](/docs/hubspot) tracks each new contact as `Lead`. In each ad platform, use `FormSubmit` or the CRM `Lead` as the lead conversion, not both.

<FaqAccordion
  title="FAQ & Troubleshooting"
  items={[
    {
      question: "Does the skill install anything in my published app?",
      answer: "No. The skill is a set of instructions for the Lovable agent. The agent adds the Tracking Tag and the tracking code to your project. You review the changes before you publish."
    },
    {
      question: "Why does the skill send FormSubmit from code?",
      answer: "The skill sends FormSubmit with the visitor's email as refId and the customer data of the form. The Tracking Tag can also send an automatic FormSubmit: for a form with a --CLICK-ID-- hidden field, and for a POST form when <a href='/docs/form-tracking#tracking-unknown-forms'>Catch-all Events, Form Submit</a> is on. So the agent adds no hidden field, and it adds the class <code>at-do-not-track</code> to the form. The class stops the automatic event, and AnyTrack records each submit one time. The agent reads the Click ID with <code>AnyTrack('atclid')</code> and sends it to your backend and your CRM."
    },
    {
      question: "Why does the agent not add a PageView to my routes?",
      answer: "The Tracking Tag sends a PageView on each route change and does not remove duplicates. Router code that calls AnyTrack('PageView') records a second PageView. The one exception is a hash router, with routes after a # sign. See <a href='/docs/single-page-tracking'>Single Page App Tracking</a>."
    },
    {
      question: "I added a new quiz after the setup. Does it pass the Click ID?",
      answer: "Yes, when Lovable applies the skill to the request. The skill tells the agent to carry the Click ID from each new form, quiz, or sign-up to its destination. The agent also adds the new lead path to its list. To make sure, write <code>Apply the anytrack-tracking skill to the new quiz</code> in your request. Then submit the quiz with a new email, and open the lead in your CRM. The Click ID field holds a value that starts with your Property ID."
    },
    {
      question: "My app uses Stripe. Does the agent send Purchase from the browser?",
      answer: "No. The <a href='/docs/stripe'>Stripe integration</a> records the payment on the server. The skill contains the AnyTrack Stripe prompt. The agent applies it to your Stripe checkout, so each payment carries the Click ID. A Purchase from the browser would count each sale two times."
    },
    {
      question: "Can I use the skill with Claude Code or another AI tool?",
      answer: "The skill uses the SKILL.md format of Agent Skills, which Claude also reads. The instructions target Lovable apps. For other tools, connect the <a href='/docs/anytrack-docs-mcp'>AnyTrack Docs MCP</a>."
    }
  ]}
/>

## Related Resources

<Cards columns={2}>
  <Card title="Single Page App Tracking" href="/docs/single-page-tracking" icon="fa-file" iconColor="blue-500">
    <p>What the Tracking Tag does on its own in a single page app.</p>
  </Card>
  <Card title="AnyTrack Docs MCP" href="/docs/anytrack-docs-mcp" icon="fa-plug" iconColor="blue-500">
    <p>Connect the AnyTrack docs to Lovable and other AI tools.</p>
  </Card>
</Cards>
