Analytics & Attribution

Click Tracking on Custom Buttons

3 min read

Notifal tracks clicks on built-in action buttons automatically. For custom HTML in templates, add the class notifal-track-click to any clickable element you want in analytics.

Full button guide: HTML Builder: Buttons, Close Icon, and Click Tracking.

The class to add

<a href="/sale" class="notifal-track-click">View sale</a>

or

<button type="button" class="notifal-track-click">Spin the wheel</button>

Notifal counts clicks on:

  • Elements with notifal-track-click
  • Standard links inside the notification
  • Native <button> elements
  • Elements with role="button"

Plain text or unmarked custom HTML is not tracked unless you add the class.

Action buttons already tracked

Block Editor, Elementor, and notifal-action-button in HTML Builder get notifal-track-click automatically. You do not need to add it twice.

What gets recorded

Each tracked click stores:

Clicks also feed conversion attribution when the visitor later orders. See Order Attribution in WooCommerce.

Custom HTML examples

Secondary text link:

<p>Not ready? <a href="/faq" class="notifal-track-click">Read FAQ</a></p>

Custom styled CTA div:

<div class="my-cta notifal-track-click" role="button" tabindex="0">Claim offer</div>

Use role="button" and keyboard focus for accessibility when the element is not a real <button> or <a>.

What is not tracked by default

  • Close icons (tracked as close events via notifal-close-button)
  • Clicks outside the notification on the main page
  • Elements without the class in pure custom HTML (e.g. a roulette widget unless marked)

Verify tracking

  1. Publish the notification
  2. Click your custom button on the front end
  3. Open On-Page Analytics and refresh
  4. With Pro, open per-button breakdown to see the click

In this topic

  1. On-Page Analytics Dashboard
  2. Understanding Metrics (CTR, Conversions, Revenue)
  3. Enhanced Analytics (Pro)
  4. Per-Button Click Analytics (Pro)
  5. Order Attribution in WooCommerce
  6. Click Tracking on Custom Buttons (you are here)
  7. Attribution Window and Conversion Settings