> For the complete documentation index, see [llms.txt](https://docs.humblytics.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.humblytics.com/how-to-track-custom-click-events.md).

# How to Track Custom Click Events

{% hint style="info" %}
Humblytics automatically tracks click events and form events—no setup required. In your dashboard you'll see **Site Traffic**, **Pages**, and **Clicks & forms**. Add custom attributes only when you want to assign specific labels to click events (e.g., to distinguish a particular CTA button from other links).
{% endhint %}

**Automatic Tracking**

Click events and form events are tracked automatically once you install the Humblytics script. You can view:

* **Site Traffic** — overall visitor and session metrics
* **Pages** — page view data
* **Clicks & forms** — click events on links and buttons, and form submission events

**When to Add Custom Attributes**

Add custom attributes when you want to label specific click events with meaningful names (e.g., `hero-cta`, `pricing-button`) so you can identify them in **Clicks & forms** and use them in funnels or A/B tests. Without custom attributes, clicks are still tracked—you just won't have custom labels for specific elements.

**How Humblytics Names a Click**

When an element is clicked, Humblytics looks for a label in this order:

1. A `data-humblytics` attribute on the clicked element **or any of its parents**. The shorter aliases `data-humble`, `data-hmbl`, `humblytics`, `humble`, and `hmbl` work the same way.
2. The element's Framer layer name (`data-framer-name`) or a `data-qa-id` attribute.
3. `Link`, if nothing else is found.

Because parents count, you can put the attribute on a wrapper and every click inside it is reported under that name. The full list of attributes and script methods is in the [Tracking Script Reference](https://docs.humblytics.com/tracking-script-reference.md).

**How to Add Custom Click Tracking**

Humblytics supports custom attributes on any site. Pick your platform:

* [Webflow](https://docs.humblytics.com/how-to-track-custom-click-events/how-to-add-custom-event-tracking-for-webflow-sites.md)
* [Framer](https://docs.humblytics.com/how-to-track-custom-click-events/how-to-add-custom-event-tracking-for-framer-sites.md)
* [Custom / self-hosted](https://docs.humblytics.com/how-to-track-custom-click-events/how-to-track-click-events-on-custom-self-hosted-site.md) (WordPress, Shopify, static HTML, and more)

In short:

1. **Access the Designer Tool**
   * For Webflow: Open your project in the Webflow Designer.
   * For Framer: Open your project in Framer.
2. **Select the Element**
   * Choose the element you want to track (e.g., a button or link).
3. **Add Tracking Attributes**
   * For Webflow: Add a custom attribute such as `humblytics="your-event-name"` in the element settings panel.
   * For Framer: Humblytics natively tracks layer names, so no additional attributes are needed. You can add custom attributes via code overrides for more precise naming.
4. **View in Humblytics**
   * Log in to your Humblytics dashboard.
   * Navigate to **Observe → Analytics → Clicks & forms** to see your click events. Custom attribute events will appear once they have been triggered at least once.
5. **Monitor and Analyze**
   * Use Humblytics' real-time insights and reports to monitor clicks and optimize your site accordingly.

**Tracking a Click with Code**

If you'd rather record a click from your own JavaScript (for example after your own validation runs), call:

```javascript
window.Humblytics.trackClickEvent("purchase-button", "Buy now");
```

The first argument is the name you'll see in the dashboard. The second is optional label text (for example the button's caption) and can be an empty string.

**Cross-Domain Click Tracking**

Track click events across multiple domains with unified reporting in your main dashboard. Pass your main domain in the third argument to attribute clicks from an external domain:

```javascript
// On the external domain: attribute the click to yourmainsite.com
window.Humblytics.trackClickEvent("purchase-button", "", {
  domain: "yourmainsite.com",
});
```

This is especially useful for:

* Ecommerce sites with separate checkout domains
* Multi-domain company websites
* Third-party integration tracking

The external domain must be whitelisted on your main site first, otherwise these events are dropped. For complete cross-domain setup instructions, see our [Cross-Domain Tracking & Whitelisting](https://docs.humblytics.com/cross-domain-tracking-and-whitelisting.md) guide.

**Additional Features**

* **Track FAQ Click Events**
  * Specifically for Framer, track your most-clicked FAQs without any custom code or attributes. This feature helps you understand which questions your visitors find most engaging.

**Resources and Support**

* For detailed instructions and visual guidance, refer to the specific guides for Webflow and Framer:
  * [How to Add Custom Click Tracking for Webflow Sites](https://docs.humblytics.com/how-to-track-custom-click-events/how-to-add-custom-event-tracking-for-webflow-sites.md)
  * [How to Add Custom Click Tracking for Framer Sites](https://docs.humblytics.com/how-to-track-custom-click-events/how-to-add-custom-event-tracking-for-framer-sites.md)
  * [Video Tutorials](https://www.humblytics.com/video-tutorials)
