Create actions with the toolbar
Point at a button or link on your live site to turn clicks on it into an action you can use in insights.
An action gives a name to something people do on your site, such as "Clicked sign up" or "Opened pricing". Once an action exists, you can use it in insights, funnels and cohorts like any event, and it also counts the matching clicks captured before you created it.
The toolbar is the quickest way to create an action for a click: you select the element on your live site instead of writing CSS selectors by hand. Actions built this way match clicks recorded by autocapture, so autocapture must be turned on.
Create an action
- Launch the toolbar on your site.
- Select Actions (the lightning bolt), then New action.
- Under What did your user do?, give the action a name, for example "Clicked sign up".
- Select Select Element, then click the element on your page.
- Check the matching rules the toolbar fills in, and change them if you need to.
- Select Create action.
The action is saved to your project straight away and appears in the app with your other actions.
You can also start from the app: open your project's actions, choose New action, then Inspect element on site.
Matching rules
After you select an element, the toolbar fills in some of these rules. An element must match every rule that is set:
| Rule | Matches |
|---|---|
| Selector | The CSS selector that identifies the element |
| Link target | Where the link goes, if the element is a link (its href) |
| Text | The text inside the element |
| Page URL | The page the click happened on, matched as Contains, Exact or Regex |
Keep only the rules that describe what you mean. For example, remove Page URL if the same sign-up button on every page should count, or remove Text if the button's wording changes.
Select Edit the selector to change the selector by hand.
Make selectors last
If the toolbar warns about a Fragile selector, the action may stop matching when your site changes. Give the element a data- attribute and list it under Settings → Project → Autocapture → Data attributes, as described in element filters.
Match more than one element
An action can match clicks on several elements, for example a "Sign up" button in the header and another in the footer. Select Add Another Element and choose the next element. A click on any of them counts towards the action.
Edit an action
Open Actions in the toolbar and select the action to change its name or rules, then Save action. To see which actions already include an element, inspect the element: the toolbar lists its actions.
Can't find what you need? Contact support