Tracking button clicks in Elementor, Divi and the block editor

Every page builder lets you add a class to a button. It's just in a different place in each one.

Click tracking works best when each button you care about has its own class or ID. Every major page builder lets you add one, and it doesn’t change how the button looks.

Pick a short, descriptive name using lowercase letters and hyphens, such as hero-book-now or pricing-buy. If the same button appears on several pages and you want them counted together, give them all the same class.

WordPress block editor (Gutenberg)

  1. Click the button block.
  2. In the right-hand sidebar, open Advanced at the bottom.
  3. Enter your class in Additional CSS class(es), for example hero-book-now. Don’t type the dot.
  4. Click Update.

Your tracker selector is then .hero-book-now.

The block editor also has an HTML anchor field in the same place. That becomes the button’s ID, so hero-book-now there means the selector #hero-book-now.

Elementor

  1. Edit the page with Elementor and click the button widget.
  2. Open the Advanced tab.
  3. Fill in CSS Classes (without a dot) or CSS ID.
  4. Click Update.

Elementor puts these on the widget’s wrapper rather than the link itself. That’s fine: WP Click Tracker counts clicks inside the matched element too, so .hero-book-now still catches clicks on the button.

Divi

  1. Open the button module’s settings.
  2. Go to the Advanced tab and open CSS ID & Classes.
  3. Fill in CSS Class or CSS ID and save.

Beaver Builder

  1. Click the button module to edit it.
  2. Open the Advanced tab and scroll to HTML Element.
  3. Fill in Class or ID and save.

Theme and menu buttons

You can add a class to a menu item too. Go to Appearance → Menus, open Screen Options at the top and tick CSS Classes. Each menu item then gets a CSS Classes field.

On block themes, menu items are edited in the Site Editor: select the link, open Advanced and add the class there.

Can’t edit the button?

Match it by its link instead. a[href*="/book/"] counts clicks on any link pointing to your booking page, wherever it is. There are more examples in how to find the CSS class or ID of any button.

Check it’s working

After saving, open the page in a private window, click the button and look at the live feed on the Click Tracker dashboard. The click should appear within a few seconds.