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.

Last updated

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.

The embed code: the whole of the manual method
<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 headerConnect for Umami
CostNo costFrom $12 a year
Pageviews, visitors, referrersYesYes
SetupPaste one line into your theme, or a header-scripts pluginPaste two values into a settings screen
Survives a theme change or updatePartlyYes
Leaves out your own visitsNoYes
Skips draft previewsNoYes
Keeps staging and local copies out of your statsPartlyYes
Outbound link clicksNoYes
Button clicks, including page-builder buttonsNoYes
Successful form submissions, by form nameNoYes
Comments, downloads, email and phone linksNoYes
WooCommerce and FluentCart events and revenueNoYes
Core Web VitalsPartlyYes
Stats inside the WordPress dashboardNoYes
Tells you when tracking or the API stops workingNoYes

"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.disabled flag 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 getYou would writeGuide
Your own visits excludedA PHP condition around the scriptExclude your own visits
Outbound links and button clicksA JavaScript click listener, or data-umami-event attributes on each elementTrack links and buttons
Form submissionsA JavaScript listener per form plugin, each with a different eventTrack form submissions
WooCommerce revenuePHP on the order confirmation page, with protection against double countingTrack WooCommerce revenue
Core Web VitalsOne attribute added to the script tagCore Web Vitals with Umami
Stats in wp-adminA dashboard widget that calls the Umami API from the serverNot 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.

  1. Note your website ID and script URL

    Copy them from your existing snippet: the src is the script URL and data-website-id is the website ID.

  2. Install Connect for Umami and enter both values

    Go to Settings → WPUmami → Tracking, paste them and save.

  3. 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.

  4. 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.

  5. 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.

See pricing