Integration
Click tracking for Elementor, the block editor and other page builders
The block editor and page builders output many buttons as links styled to look like buttons. Connect for Umami recognizes them by their CSS class and sends each click to Umami as a named event. Three switches, no code.
Short answer
To track clicks in Umami on a WordPress site built with Elementor, the block editor or another page builder, install Connect for Umami and open Settings → WPUmami → Events. Switch on Button clicks, Outbound links or Link clicks. The plugin recognizes each builder's buttons by their CSS class and sends button_click, outbound_link_click or link_click to Umami, one event per click. No extra markup is needed.
The click events sent to Umami
Each event has its own switch on the Events tab. They appear in Umami under Events, with the details below attached to each one.
| Event | When it is sent | Data sent with it |
|---|---|---|
button_click | A visitor clicks a button: a real button element, or a link styled as a button by the block editor, a page builder or a theme. |
|
outbound_link_click | A visitor clicks a link that leads to another website. |
|
link_click | A visitor clicks a link that stays on your site, or a download, email or phone link. |
|
How buttons are recognized without extra markup
The block editor and most page builders output a button as a link that is styled to look like one. Each builder marks its buttons with its own CSS class, and Connect for Umami keeps a list of those classes. A click on one of them, or on something inside it such as an icon, counts as a button click.
You add nothing to your buttons and change nothing in the builder. The text sent is the button's visible label. If it has none, the plugin uses its aria-label, its title or the alt text of an image inside it.
Which buttons are recognized
Link-styled buttons are matched by the class each builder or theme gives them.
| Builder or source | What counts as a button | Selector |
|---|---|---|
| Any theme or plugin | Real button elements, submit and button inputs, and elements with a button role | button, input[type="submit"], input[type="button"], [role="button"] |
| Block editor (Gutenberg) | The Button block | .wp-block-button__link |
| Block themes | Elements the theme styles as buttons | .wp-element-button |
| Elementor | Elementor buttons | .elementor-button |
| Divi | Divi buttons | .et_pb_button |
| Beaver Builder | Beaver Builder buttons | .fl-button |
| Bricks | Bricks buttons | .bricks-button, .brxe-button |
| Kadence Blocks | Kadence button blocks | .kb-button, .kt-button |
| GenerateBlocks | GenerateBlocks buttons | .gb-button |
| Spectra | Spectra buttons | .uagb-buttons-repeater |
| Stackable | Stackable buttons | .stk-button |
| Oxygen | Oxygen link buttons | .ct-link-button |
| WPBakery | WPBakery buttons | .vc_btn3 |
| Avada | Avada buttons | .fusion-button |
| Brizy | Brizy buttons | .brz-btn |
| Thrive Architect | Thrive Architect buttons | .tcb-button-link |
| SiteOrigin | The link inside a SiteOrigin button | .ow-button-base a |
| Astra | Buttons styled by the Astra theme | .ast-button |
| Common theme classes | Links with a button or btn class | a.button, a.btn |
Disabled buttons are not counted.
Which event a click produces
The three switches are independent, and one click never produces more than one event. The plugin describes the click by the most specific thing it was, in this order:
- A link to another website. With Outbound links on, the click is sent as
outbound_link_click. If the link is also a recognized button,buttonistrue. - A button. Otherwise, with Button clicks on, a click on a recognized button is sent as
button_click. If the button is a link,urlsays where it leads. - A link within your site. Otherwise, with Link clicks on, a click on an internal link, a download, an email link or a phone link is sent as
link_clickwith itstype.
- A link is outbound when its hostname differs from your site's. A leading
www.is ignored. A subdomain such asshop.example.comcounts as another website. - A link is a download when it points to a file on your site such as a pdf, zip, docx, xlsx, pptx, csv, mp3 or mp4.
- Middle clicks, which open a link in a new tab, are counted. Right clicks are not.
Elements that already use data-umami-event
Umami has its own way to track a click: a data-umami-event attribute on the element. If an element already carries that attribute, or sits inside one that does, Connect for Umami leaves the click to Umami. You get the event you named yourself, once.
How to add your own button class
If your theme or builder uses another class for link-styled buttons, a developer can add it with the cfumami_button_selectors filter, which receives the list of CSS selectors and returns it. Put the code in a child theme's functions.php or in a code-snippets plugin.
add_filter( 'cfumami_button_selectors', function ( $selectors ) {
$selectors[] = '.my-cta-button'; // Your own button class.
return $selectors;
} );How to turn on click tracking
Connect the site to Umami
In WordPress, go to Settings → WPUmami → Tracking. Paste your Umami website ID and script URL, then save. The status panel at the top should say the tracking script is responding.
Choose which clicks to track
Open the Events tab. Under Clicks, tick Outbound links, Link clicks and Button clicks, or only the ones you want, then save.
Click around in a private window
In a private browser window, open a page made with your builder. Click a button, a link to another website and a link to another page on your site. Use a private window because logged-in administrators are not tracked by default.
Check Umami
In Umami, open your website and look at Events. You should see
button_click,outbound_link_clickandlink_click, each with the text and address of what you clicked.
What is sent and what is not
A click event carries the text of what was clicked and where it leads: the address without its query string for an outbound link, the path alone for a link within your site. Nothing about the visitor is added, and the plugin sets no cookies and uses no browser storage.
Clicks are sent from the visitor's browser through the Umami tracker, in the same session as the pageview. A visitor who blocks the Umami script is not counted, and logged-in administrators are left out by default.
Questions you can answer once it is on
- Which call-to-action buttons visitors click, by their label.
- Which outbound links visitors follow, such as partner sites, affiliate links or your social profiles.
- Which files are downloaded, using
link_clickevents withtypeset todownload. - How many visitors use your phone or email links.
Frequently asked questions
How do I track button clicks in Umami on an Elementor site?
Install Connect for Umami, go to Settings → WPUmami → Events and tick Button clicks. Elementor buttons are recognized by their elementor-button class, so each click is sent to Umami as a button_click event with the button's label and, if it is a link, where it leads. You do not change anything in Elementor.
Does Umami track clicks on Gutenberg buttons automatically?
Not by itself. Umami's own method is a data-umami-event attribute on each element you want to track. Connect for Umami recognizes the block editor's Button block by its wp-block-button__link class and sends button_click without any attributes.
How do I track outbound links in Umami on WordPress?
Tick Outbound links on the Events tab of Settings → WPUmami. Every click on a link to another website is then sent as outbound_link_click, with the address (without its query string) and the link text.
Will one click be counted twice if all three switches are on?
No. A click produces one event at most. It is an outbound_link_click if the link leaves your site, otherwise a button_click if it was a button, otherwise a link_click.
My theme or page builder is not on the list. Can its buttons be tracked?
Often, yes. Real button elements, submit inputs, elements with role="button" and links with a button or btn class are recognized on any site. For any other class, a developer can add a selector with the cfumami_button_selectors filter.
Connect WordPress to Umami in about two minutes
One plugin: the tracking script, events, store revenue and your stats inside WordPress. Plans start at $12 a year, with a 14-day money-back guarantee.