Comparison
Umami plugin vs embed code on WordPress
You can run Umami on WordPress with one line of code in your header. For many sites that is enough. This page sets out, without spin, what that line does and does not do, and what Connect for Umami adds.
Short answer
Pasting Umami's tracking code into your WordPress header is free and counts pageviews, referrers and visitors. It does not exclude your own visits, track outbound links, buttons or form submissions, send WooCommerce revenue, show stats inside WordPress, or warn you when tracking stops. A plugin such as Connect for Umami does all of those without code. Choose the embed code if pageviews are all you need.
<script defer src="https://cloud.umami.is/script.js" data-website-id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"></script>Side by side
| Embed code in the header | Connect for Umami | |
|---|---|---|
| Cost | No cost | From $12 a year |
| Pageviews, visitors, referrers | Yes | Yes |
| Setup | Paste one line into your theme, or a header-scripts plugin | Paste two values into a settings screen |
| Survives a theme change or update | Partly | Yes |
| Leaves out your own visits | No | Yes |
| Skips draft previews | No | Yes |
| Keeps staging and local copies out of your stats | Partly | Yes |
| Outbound link clicks | No | Yes |
| Button clicks, including page-builder buttons | No | Yes |
| Successful form submissions, by form name | No | Yes |
| Comments, downloads, email and phone links | No | Yes |
| WooCommerce and FluentCart events and revenue | No | Yes |
| Core Web Vitals | Partly | Yes |
| Stats inside the WordPress dashboard | No | Yes |
| Tells you when tracking or the API stops working | No | Yes |
"Partly" means it is possible with the embed code, but only by editing the snippet or your theme by hand. For example, you can add data-domains or data-performance to the tag yourself.
When the embed code is enough
Use the embed code and skip the plugin if all of these are true:
- You only want to know how many people visit, which pages they read and where they came from.
- You do not sell anything on the site, or you do not need revenue next to your traffic sources.
- You do not mind your own visits being counted, or you are happy to set Umami's
umami.disabledflag in each browser you use. - You are comfortable adding a script to your theme and remembering it is there when you change themes.
That is a perfectly good setup. The guide to adding Umami to WordPress shows how to do it properly, including a version that skips logged-in administrators.
What the embed code cannot see
Umami's tracker records a pageview when a page loads. Anything a visitor does on the page, or anything that happens on your server, is invisible to it unless your site sends an event. On a WordPress site the gaps are usually these:
Leads
A contact form submitted through Gravity Forms, WPForms or Contact Form 7 usually does not load a new page, so nothing is recorded. You see visits to the contact page, not how many people actually wrote to you.
Sales
Umami's Revenue report stays empty unless your site sends a purchase event carrying revenue and currency. WooCommerce does not do that. Without it you can see that 400 people visited from a newsletter, but not that they spent $1,900.
Clicks that leave the site
Affiliate links, "book a call" buttons that open another site, links to your documentation or app store page. A visitor who leaves through one is recorded only as having viewed the page.
Whether it is still running
A theme update, a caching change or a mistyped ID can stop tracking, and the first you hear of it is a flat line in Umami days later.
What it takes to match the plugin by hand
Everything the plugin does can be built with code. These are the pieces, with the guide that shows the manual way for each.
| To get | You would write | Guide |
|---|---|---|
| Your own visits excluded | A PHP condition around the script | Exclude your own visits |
| Outbound links and button clicks | A JavaScript click listener, or data-umami-event attributes on each element | Track links and buttons |
| Form submissions | A JavaScript listener per form plugin, each with a different event | Track form submissions |
| WooCommerce revenue | PHP on the order confirmation page, with protection against double counting | Track WooCommerce revenue |
| Core Web Vitals | One attribute added to the script tag | Core Web Vitals with Umami |
| Stats in wp-admin | A dashboard widget that calls the Umami API from the server | Not covered: this one is a plugin in itself |
How to switch from the embed code to the plugin
The order matters: if the old snippet stays in place, every visit is counted twice.
Note your website ID and script URL
Copy them from your existing snippet: the
srcis the script URL anddata-website-idis the website ID.Install Connect for Umami and enter both values
Go to Settings → WPUmami → Tracking, paste them and save.
Remove the old snippet
Delete it from wherever you added it: your theme's
header.php, a header-scripts plugin, or your theme's custom code setting. Clear your page cache afterwards.Check there is exactly one script
Open your site in a private window, view the page source and search for
data-website-id. It should appear once.Turn on the events you want
On the Events and Store tabs, switch on what you want to track. Your existing Umami data and website stay as they are.
Frequently asked questions
Do I need a plugin to use Umami on WordPress?
No. Umami works on WordPress with its tracking code pasted into your site's head. A plugin is only needed if you want more than pageviews: excluding your own visits, tracking clicks, forms or store revenue, or seeing stats in wp-admin.
Is the embed code faster than a plugin?
Both load the same Umami script with defer, so pageview tracking performs the same. Connect for Umami adds one small deferred script only when you switch on event tracking.
Can I track form submissions with just the embed code?
Not without extra code. You can add Umami's data-umami-event attribute to a submit button, but that counts clicks, including ones that fail validation. Counting successful submissions needs JavaScript that listens to your form plugin. The form tracking guide shows how.
Will I lose my Umami data if I switch to the plugin?
No. Your data lives in Umami and is tied to your website ID. Using the same website ID in the plugin continues the same history.
Can I use the plugin and the embed code together?
You should not. Two copies of the tracker count every pageview twice. Remove the old snippet when you install the plugin.
Is Connect for Umami made by Umami?
No. It is an independent plugin made by WPUmami, built to connect with the open-source Umami project at umami.is.
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.