Docs menuTrack goals › Set up goals
Count a visit to a page
On this page
Count a goal each time a visitor reaches a page, like your thank-you page, with no code on your site.
Before you start
The page must load the CentPath snippet, as Install CentPath shows: a page goal counts the page views the script sends.
1. Open Goals in Setup
- In CentPath, open your site and go to Setup → Goals.
- Click Add a goal, and under Counts when… pick A page is visited.
2. Type the page's path
- In Path, type the path of the page, starting with /, like
/thank-you. The field suggests the paths your site has had visits on. - Leave out the domain, and anything from a ? or a #: the goal matches the path alone, so
/thank-you?plan=procounts as a visit to/thank-you. - To count several pages as one goal, use * for any part of the path, at most twice, as in the table below.
| Path | Counts a visit to |
|---|---|
/ | / alone |
/ | any page under /, like / or / |
/ | /, / and the like |
A path matches letter for letter: /Thank-you and /thank-you/ are other pages than /thank-you.
3. Name the goal
- Leave Name empty to call the goal after its path, like "Visit /thank-you". Or type a name of your own, like "Bought".
- Click Add goal.
The goal counts the visits from before you added it too, as far back as your dashboard keeps them.
Verify the setup
- On your live site, open the page.
- Open your dashboard and look at the Goals card: the goal is there, under its name, with the 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 *.
The goal counts nothing
- Open the page and check the path in your browser's address bar, letter for letter, with or without its ending /.
- Check that the page loads the snippet: Check your installation shows how.
- In a single-page app, check that the page has a path of its own. The script counts a new page each time the path changes, never a change after a #: see The script.
The goal doesn't count toward Goal conv.
Goal conv. counts the visitors who reached an event goal that counts as a conversion, or who bought: see Set up goals. A page goal is read from the pages a visit saw instead, so it isn't part of it. To count reaching a page as a conversion, send an event goal from that page, as Send goals from JavaScript shows.
You want to change the path
On the goal's row in Setup → Goals, click Edit, change Path, then click Save. The goal counts the new path, past visits included.