> For the complete documentation index, see [llms.txt](https://docs.hockeystack.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hockeystack.com/marketing-intelligence/goals/finding-out-a-buttons-css-selector.md).

# Finding Out a Button's CSS Selector

## Why define goals using the selector? <a href="#block-10764b9f845a4990b67f53ba7ec53208" id="block-10764b9f845a4990b67f53ba7ec53208"></a>

Although defining goals using the button text is much easier, sometimes it is not feasible.

1. If there isn't a text on the element you want to define as a goal
2. If the same text is used by multiple different elements on the same page and you only want to select one.

In other cases, we advise non-technical users to define their goals using text.

## How to get the CSS selector of a button <a href="#block-4deb64e8fb3749afb7000d473eee9c86" id="block-4deb64e8fb3749afb7000d473eee9c86"></a>

1. Hover the cursor over the button you want to define as a goal and right-click the mouse to select **Inspect**
2. ![image](https://images.spr.so/cdn-cgi/imagedelivery/j42No7y-dcokJuNgXeA0ig/1eea72a4-4873-49b8-b564-58a45d79c227/Screen_Shot_2021-11-12_at_16.18.58/w=1080,quality=90,fit=scale-down)
3. Right-click on the highlighted code. Select **Copy** > **Copy selector**
4. ![image](https://images.spr.so/cdn-cgi/imagedelivery/j42No7y-dcokJuNgXeA0ig/9f3815c0-91c2-4a46-b01f-2001f09a6ffa/Screen_Shot_2021-11-12_at_16.19.25/w=1080,quality=90,fit=scale-down)
5. Paste it into the 'Click with Selector' input in the Goals tab of your dashboard
6. ![image](https://images.spr.so/cdn-cgi/imagedelivery/j42No7y-dcokJuNgXeA0ig/b4e6ff61-c275-4bb3-9f27-bc67cd2a5069/Screen_Shot_2021-11-12_at_16.20.22/w=1920,quality=90,fit=scale-down)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.hockeystack.com/marketing-intelligence/goals/finding-out-a-buttons-css-selector.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
