# Set up goals

> Count sign-ups, booked demos or visits to a page as goals: by path, with a data-goal attribute, or from your own code.

A goal counts what success means on your site, like a sign-up, a booked demo or a visit to your pricing page.

- [A visit to a page](https://centpath.app/docs/page-visit-goals), like your thank-you page, with no code.
- [A click or a form sent](https://centpath.app/docs/data-goal), with one attribute on the link, button or form.
- [From your own code](https://centpath.app/docs/javascript-goals), when something happens in your app.

## Before you start

[Install CentPath](https://centpath.app/docs/install) first: a goal is counted by the script the snippet loads.

## 1. Open Goals in Setup

1. In CentPath, open your site and go to **Setup** → **Goals**.
2. Click **Add a goal**. The form is open already while your site has no goal.

## 2. Choose how the goal counts

Under **Counts when…**, pick the answer that fits what success looks like.

### A page is visited

Pick **A page is visited** when reaching a page is the success, like a thank-you page.

1. In **Path**, type the page's path, like `/thank-you`. Use * for any part, like `/blog/*`.
2. Leave **Name** empty to call it after its path, like "Visit /thank-you", or give it a name of your own.

A page goal counts past visits too. [Count a visit to a page](https://centpath.app/docs/page-visit-goals) has the details.

### Your site sends an event

Pick **Your site sends an event** when the success is an action, like a sign-up form sent.

1. In **Name**, type the goal's name, like `signup`.
2. Add this attribute to the link, button or form, with your goal's name in place of `signup`:

```html
data-goal="signup"
```

3. Or call this from your own code when it happens:

```js
window.analytics.goal("signup");
```

An event goal counts from the first time it arrives. [Count clicks and form sends](https://centpath.app/docs/data-goal) and [Send goals from JavaScript](https://centpath.app/docs/javascript-goals) have the details.

## 3. Add the goal

Click **Add goal**. The goal joins the list above the form, and Setup says what it counts.

### Which goals count toward Goal conv.

**Goal conv.** is the share of visitors who reached a goal your site sends as an event, or who bought. A page goal never counts toward it: it is read from the pages a visit saw. Every event goal counts until you say otherwise. To leave one out, click **Edit** on its row in **Setup** → **Goals**, untick **Counts as a conversion**, then click **Save**. A checkout the snippet saw start never counts.

## Verify the setup

1. On your live site, visit the page, or click the link or send the form.
2. Open your dashboard: the goal is in the **Goals** card, with how many times it was reached.

## Troubleshooting

### Setup refuses the path

Type the path alone, starting with /: no domain, no ? and no #. A path can hold at most two *.

### An event goal never shows

1. Check that the page loads the CentPath snippet: the script it loads sends the goal.
2. Check that the name your site sends is the goal's name, letter for letter. `Signup` and `signup` are two goals.

### A goal shows under a name you don't want

On the goal's row in **Setup** → **Goals**, click **Edit**. Type the name the dashboard should show in **Name**, then click **Save**. What the goal counts stays the same.

### A goal you don't need fills the Conversions card

On the goal's row, click **Edit**, untick **Show on the Conversions card**, then click **Save**. Your site can keep sending it.
