> Content index: https://quillly.com/docs/llms.txt
> Canonical page: https://quillly.com/docs/analytics-goals

---
title: Track goals and conversions with qa() and data-qa-goal
description: Track goals with qa('goal') or a data-qa-goal attribute, mark the ones that count as conversions, and identify users so customers show by name.
keywords: track goals, conversion rate, identify users
published: 2026-09-24
updated: 2026-09-25
url: https://quillly.com/docs/analytics-goals
word_count: 1193
---

# Track goals and conversions

> Track goals with qa('goal') or a data-qa-goal attribute, mark the ones that count as conversions, and identify users so customers show by name.

Canonical: https://quillly.com/docs/analytics-goals
Published: 2026-09-24

## Related Pages

- [Install analytics on your website](https://quillly.com/docs/analytics-install)
- [Analytics JavaScript API](https://quillly.com/docs/analytics-api)
- [Analytics limits, retention and excluding traffic](https://quillly.com/docs/analytics-limits)
- [MCP tool reference](https://quillly.com/docs/mcp-tools)
- [Build a conversion funnel](https://quillly.com/docs/analytics-funnels)
- [Visitor journeys and the Users list](https://quillly.com/docs/analytics-visitors)

Track goals to count the actions that matter on your site, such as a signup, a trial or a purchase. By the end, your goals show in the **Goal** tab with a conversion rate, and people who complete a conversion goal show as Customers.

**Before you start**, you need:

- **The analytics tag on your pages.** See [Install analytics on your website](https://quillly.com/docs/analytics-install).

- **A place to add code**: a line of JavaScript in your app, or an attribute on a button in your HTML or site builder.

![The Goal tab in Quillly Analytics, with a chart of goal completions, the ranked goal list and the Add goals button highlighted.](https://quillly.com/serve/v1/019c64a2-a62f-7793-aa68-2c78316d3309/images/b9c17076f96ee6c62aa602d53a38a42d19b27476.webp)

## Track goals from JavaScript

Call `qa('goal', …)` when the action happens, for example after a signup form succeeds. Pass the goal's name, and optionally an object of metadata.

```js
qa('goal', 'signup', { plan: 'pro' });
```

[The `qa` function](https://quillly.com/docs/analytics-api) comes from the first line of the tag, so it exists on every page that has the tag. Calls made before the script finishes loading wait in its queue, and none are lost. `qa('event', …)` does the same thing, if you prefer that word.

## Track goals from HTML

Add `data-qa-goal` to a button or link, and each click sends the goal. A click on anything inside the element counts too.

```html
<button data-qa-goal="signup" data-qa-plan="pro">Sign up</button>
```

These are standard [HTML data attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/data-%2A), so they don't change how the element looks or works. Every other `data-qa-*` attribute on the element becomes metadata. `data-qa-plan="pro"` sends `plan: "pro"`, and dashes turn into underscores, so `data-qa-billing-cycle` sends `billing_cycle`. Attribute values always arrive as text.

## Rules for goal names and metadata

These rules apply however you track goals, and the [Analytics JavaScript API](https://quillly.com/docs/analytics-api) shows what happens to a call that breaks one.

- **Names** use lowercase letters, digits, `-` and `_`, up to 64 characters. Capital letters are lowercased, and a name with any other character is dropped.

- **Reserved names** start with `qy_`. Quillly uses them for its own goals and drops them when your tag sends them.

- **Metadata** holds up to 10 keys of letters, digits and `_`, each up to 32 characters. Values are text up to 255 characters, numbers or `true` and `false`.

- **Up to 500 names per site.** After that, new names are dropped, while names you already send keep counting.

- **Browser only.** Goals come from the tag in the browser, and each one counts as an event toward your [monthly allowance](https://quillly.com/docs/analytics-limits).

## Read the Goal tab

Once you track goals, open **Analytics** and scroll to the visitors card, then click the **Goal** tab. A new goal appears there on its own the first time your site sends it, so there's nothing to create first.

[Open Analytics](https://quillly.com/dashboard/analytics)

- **The chart** shows completions over the range for up to six of your busiest goals. Click a goal in the list to highlight its line.

- **Each row** shows how many times the goal was completed, by how many visitors, and its conversion rate.

- **The conversion rate** is the visitors who completed the goal, divided by the visitors who viewed a page in the range.

- **Search goals** filters the list when you have many.

Pages Quillly serves send goals of their own, labelled like **Blog · read to the end**, **Blog · CTA clicked** and **Blog · went to your site**. New completions show within a few minutes.

## Mark a goal as a conversion

Conversion goals are the ones that make a visitor a Customer, much like what Google Analytics calls [key events](https://support.google.com/analytics/answer/13128484). `payment`, `purchase` and `subscribe` count as conversions from the start, and you can add any goal of your own.

### 1. Open the goal's settings

In the **Goal** tab, click the pencil beside the goal. For a goal your site doesn't send yet, click **Add goals**, then **Goal settings**, and type its name under **Event name**.

### 2. Add a label

Type a **Display label**, such as "Paid order", if you want the list to show a friendlier name than the event. The label is optional.

### 3. Turn on the conversion switch

Turn on **Counts as a conversion**, then click **Save**. From then on, completing the goal marks the visitor as a Customer, and the **Users** list shows a **Customer** badge beside them.

![The Goal settings dialog for the purchase event, with a Paid order label and the Counts as a conversion switch turned on.](https://quillly.com/serve/v1/019c64a2-a62f-7793-aa68-2c78316d3309/images/16f5913801734fcb6f45e47145543204f184bb9d.webp)

> [!WARNING]
> If you open the settings of `payment`, `purchase` or `subscribe`, check that **Counts as a conversion** is on before you click **Save**. Saving with the switch off stops that goal from counting as a conversion.

The trash icon beside a goal removes its label and conversion setting. The goal itself keeps counting. A site can keep settings for up to 50 goals, with labels of up to 80 characters.

## Identify users and customers

When someone signs up or logs in, call `qa('identify', …)` so the **Users** list shows who they are instead of a generated name.

```js
qa('identify', {
  userId: 'u_4821',
  email: 'maya@acme.com',
  name: 'Maya',
  plan: 'pro',
});
```

- **`userId` or `email` is required.** Without either one, the call sends nothing.

- **`name`** is the name the **Users** list shows. The list also shows the email under it.

- **Extra fields**, such as `plan`, are stored with the person: up to 10 of them, as text up to 200 characters, numbers or `true` and `false`.

- **`isCustomer: true`** marks the person as a Customer, the same as completing a conversion goal.

- **`revenue`**, a positive number, also marks them as a Customer and adds to their revenue total. Funnels show it per visitor as **Step value**.

`userId` can be up to 128 characters, `email` up to 254 and `name` up to 120. Calling `identify` again with the same details is safe, but each call counts as one event toward your allowance.

To mark a Customer from your server instead, such as from a payment webhook, record the conversion with an API key and the same `userId`, as the [Analytics JavaScript API](https://quillly.com/docs/analytics-api) shows under **Record a conversion from your server**.

> [!WARNING]
> Every `revenue` value adds to the person's total. Send it once for each payment, not on every page load.

## Ask your AI about goals

Your AI assistant reads goal completions and conversion rates with `get_website_analytics`. With `manage_analytics_goal`, it can list your goal settings, add a label or mark a conversion for you. The [MCP tool reference](https://quillly.com/docs/mcp-tools) lists both tools.

## Common questions

### Do I have to create a goal before I send it?

No. A goal appears in the **Goal** tab the first time your site sends it. You only open **Goal settings** to add a label or to mark it as a conversion.

### Can a goal count only once per visitor?

The completion count includes every time a goal fires, while the visitor count and conversion rate count each person once. Use the conversion rate when repeats would mislead you.

### Why doesn't my goal show up?

Check that the page has the tag and that your code calls `qa('goal', …)` when the action happens. Names with other characters than lowercase letters, digits, `-` and `_`, or starting with `qy_`, are dropped, and new completions take a few minutes to appear.

## Related

- [Build a conversion funnel](https://quillly.com/docs/analytics-funnels): see where people drop off between goals.

- [Visitor journeys and the Users list](https://quillly.com/docs/analytics-visitors): follow the people who completed a goal.

- [Install analytics on your website](https://quillly.com/docs/analytics-install): the tag that sends your goals.

- [MCP tool reference](https://quillly.com/docs/mcp-tools): every tool your AI can use, including the analytics tools.
