> For the complete documentation index, see [llms.txt](https://attr.sygnal.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://attr.sygnal.com/sa5-track/webflow-cookies-and-storage-tracking/tracking-button-clicks.md).

# Tracking Button Clicks

Track when a user clicks a specific button on your site

## Overview

Track when the user clicks a button, and use that to show/hide elements on other pages throughout your site.

## Implementing

Place this code inside the BODY custom code area of your page or site.

If the button is only on one page, it's best to put it on that page only, to prevent ID conflicts with elements on other pages.

If the button is on all pages, such as a nav or footer button, it's best to place it in the site-wide BODY custom code, under site settings.&#x20;

{% code overflow="wrap" %}

```html

<script>
// Handle button tracking 
$("#button").click(function() {
  window.tracker.track("button-clicked");
  updateTracked();
}); 
</script>
```

{% endcode %}
