Set up and install goals
A goal measures a particular action on your website: a page view, a click, a form submission, a visible section or a custom JavaScript event. Create the goal in the Project Manager, then check the measurement in the Analytics App.
Prerequisites
- An owner or admin account with access to the correct project in the Project Manager.
- An available active-goal slot within the displayed project limit.
- The TrafficInsight tracker is installed on the relevant pages and the project is active for collection.
- For a Consent project, a banner decision is passed. Regular tracking waits until a decision is known.
Click, form and scroll goals require access to the relevant HTML elements. A manual event requires access to your website's JavaScript flow.
Create a goal in the manager
- Select the correct project and open Goals in its menu.
- Under Create a new goal, enter a unique Goal name with 3–50 characters, such as
Contact sent. The form help lists the allowed characters. - Choose a goal type from the overview below. A page goal also needs a page rule.
- Optionally add a description of up to 500 characters.
- Enable Automatically show the tracking code after creation and choose Create goal.
- Copy the generated code. You can reopen it later using Show tracking code in the goal's row.
| Goal type | Useful for | What to install |
|---|---|---|
| Page view | Visiting a confirmation page or website section | A page rule in the manager; no extra goal attribute in HTML. |
| Click (buttons and links) | Clicking a particular link or button | data-ti-click on the element. |
| Form submission | A form's submit event | data-ti-form on the form. |
| Visible section (scroll depth) | A marked section enters the viewport | data-ti-scroll on the section. |
| Manual event (JavaScript) | A custom, confirmed action | A tiTrack call in your JavaScript. |
Use the real goal key
Keys containing YOUR_GOAL_KEY in these examples are placeholders. Replace the entire value with the key generated in the manager for that specific goal. A key from another project or another goal type is not suitable.
1. Page view
Example: Your website displays a separate page at /thanks after successful processing.
- Choose Page view as the goal type.
- Enter
/thanksunder Page rule. The default is exactly comparison fits this example. - Create the goal. It needs no additional goal HTML code; the normal tracker must be installed on the destination page.
Advanced page rules offers other comparisons:
| Comparison | Example | Matches |
|---|---|---|
| is exactly | /thanks | This exact path. /thanks/ is a different path. |
| contains | /offer | Paths containing this text, such as /products/offer. |
| starts with | /blog/ | Paths in this section, such as /blog/first-post. |
| ends with | /thanks | Paths ending with this text, such as /contact/thanks. |
Regular expression is also available. Simple path rules are easier to check when getting started.
The comparison uses the currently loaded page's path. The domain, query parameters such as ?status=ok and a fragment such as #done are not part of this comparison. An exact rule for /thanks therefore cannot distinguish different query values on that page.
Test: After creating the goal, load a matching page in full and check the goal's conversions in the app. An address change within a single-page application is not a reliable substitute for this test. Page goals do not generate their own goal impressions, so their conversion rate can remain —.
2. Click on a button or link
Choose Click (buttons and links) and add the generated attribute to the existing element. For example:
<a href="/contact" data-ti-click="click_YOUR_GOAL_KEY">
Contact us
</a>Keep your link or button's actual destination and behaviour. Several elements with the same key contribute to the same goal; create separate goals for actions you want to distinguish.
Test: Reload the page in full, then click the element. The tracker can record an impression when it finds the marked element at tracking startup and a conversion when it is clicked. The click does not prove that a subsequent page loaded successfully.
3. Form submission
Choose Form submission and add data-ti-form to the existing <form> element, rather than only to its submit button:
<form action="/send-contact" method="post"
data-ti-form="form_YOUR_GOAL_KEY">
<label>
Your message
<textarea name="message" required></textarea>
</label>
<button type="submit">Send message</button>
</form>/send-contact and the fields are examples. Add only the goal attribute to your own form and keep its existing processing.
Test: Reload the page, enter valid values and submit the form normally. The tracker counts the submit event it observes. Clicking the button alone is insufficient if, for example, form validation prevents submission.
A submit event confirms neither successful storage nor a sent email. To measure only confirmed success from your own form processing, use a manual event in that success branch or an appropriate confirmation page as a page goal.
4. Visible section (scroll depth)
Choose Visible section (scroll depth) and mark the element whose visibility you want to measure:
<section data-ti-scroll="scroll_YOUR_GOAL_KEY">
<h2>Prices and services</h2>
<p>The section to measure starts here.</p>
</section>Use a reasonably small section. The goal concerns that element in the viewport, rather than a fixed percentage of the entire page.
Test: Reload a page where the element initially lies outside the viewport. Scroll to the marked section, then check the conversion. If it is already visible at startup, the goal can trigger without manual scrolling.
The impression is generated when the marked element is found, before its visibility is observed as the goal action. It does not prove that the section has already been seen.
5. Manual JavaScript event
Choose Manual event (JavaScript). Run the generated code where your website confirms the intended success:
window.tiTrack('custom_YOUR_GOAL_KEY', 'custom');For example, your own form processing confirms a successful request. Run this call in that success branch. Calling it at click time would measure that click instead.
The tracker must be loaded and regular collection active at that point. A call made before tiTrack loads is not available yet; inactive tracking does not record a goal event. The call itself does not perform your business action or confirm that the server stored the event successfully.
Test: Complete the successful action and check its conversion in the app. Also check a cancelled or failed attempt: your own code should not make the call in that flow. Manual goals do not generate their own impressions.
Check the measurement in the app
- Make sure the goal appears under Active goals and the project can collect traffic.
- Reload the test page in full after creating or installing the goal. Marked click, form and scroll elements should already exist when tracking starts; elements inserted dynamically later do not automatically receive a new impression or scroll observation.
- Perform the action described above. A tracking exception for this browser would prevent measurement.
- Choose Open in app in the manager and check the same project. For a current test, choose Today in the project time zone.
- Open Goals, refresh the values and inspect the relevant goal's impressions and conversions. Open its detail view if needed.
If a second attempt does not count again
The tracker suppresses repeats for each goal and event within the same tab session. Another click, submit or page view in that tab therefore need not produce a further conversion. Reloading alone does not automatically reset this protection.
For an independent test, use a fresh browser session and provide the required banner decision again. Privacy settings in a private browser window can also affect your test. Do not delete analytics data just to force a second test.
Edit, archive and reactivate goals
Use Edit to change the name and description. The goal type and page rule cannot currently be changed afterwards; create a new goal for a different measurement.
Archive disables the goal for new goal events and frees an active-goal slot. Recorded measurements are retained. In Archive, use Reactivate goal to enable it again if a slot is available. Then reload the website for your test.
Delete is permanent and does not offer goal recovery. Use the archive when you temporarily do not need a measurement and want to preserve its association for later analytics.
If the result is unexpected
Check the project and goal key, active goal status, installation on the correct page, banner decision and repeat protection. For a page goal, check the exact path, including any trailing /.
Conversions without impressions are not sufficient evidence of an installation fault for page or manual goals. — is expected for a rate without impressions. Goals & conversions explains these relationships; Troubleshooting provides further checks.