How to set up Plausible Analytics with our Google Tag Manager template

Plausible Analytics is an easy-to-use, lightweight, and privacy-friendly Google Analytics alternative.

If you already use Google Tag Manager (GTM) to manage scripts on your site, you can integrate Plausible with it — no need to touch your website’s code. GTM lets you keep all your scripts organized in one place and makes it easy to update or remove tags later on.

We’ve built a Plausible GTM template to make this setup even smoother.

Plausible Analytics Google Tag Manager template

This GTM integration method is optional. You can always use the direct Plausible setup instead — it’s even simpler and only takes a few lines of code to get started. If you’re using another platform, check out our integration guides for instructions specific to your setup.

  1. Why use Plausible Analytics with GTM?
  2. Before you begin
  3. Get started with Plausible Analytics
  4. Install the Plausible template in GTM
  5. Create a new Tag
    1. Configure Your Plausible Tag
  6. Add Custom Properties (Optional)
  7. Track Custom Events (Optional)
  8. Test your setup
  9. What’s next?

Why use Plausible Analytics with GTM?

Plausible is built to give you privacy-friendly, lightweight analytics with a clean, modern dashboard and minimal overhead.We don’t collect personal data, so you can avoid many GDPR/CCPA consent headaches.

The Plausible script is lightweight — it won’t bloat your page or slow down load times.Unlike feature-heavy tools, Plausible surfaces the key metrics you care about (engagement, top pages, referral sources, conversions) on one clean interface.

Better control and flexibility with GTM
By combining Plausible with Google Tag Manager:

  • You don’t need to edit your site’s source code.
  • You can manage, update, or disable tags centrally.
  • You get the power of GTM’s variable system to send custom properties or conditional triggers.
  • You can gradually evolve your analytics setup (e.g. starting simple, then adding events) without rebuilding your base config.

Before you begin

Make sure you have:

  • Access to your Google Tag Manager account.
  • A Plausible Analytics account (you can create one as shown below).
  • The ability to edit or publish containers in GTM.

Get started with Plausible Analytics

To use Plausible Analytics, you need to register an account if you haven’t already. To help explore Plausible, we offer a free 30-day trial (no credit card required). Click here to register.

Once you have:

  1. Registered for an account,
  2. Added your site details

You will see the following screen, where you can select “Tag Manager” from the 4 tabs depicting the 4 different installation methods.

tag manager installation method in plausible

You can also always come back to this screen if you have an existing account, in the “Site installation” area under “General” in your site settings.

Once on this screen, copy the displayed site’s script ID and save it for later as you’ll need it in a couple of minutes.

Install the Plausible template in GTM

The simplest way to install the custom template is to locate it in the Google Tag Manager template gallery where you can install it directly from your Google Tag Manager dashboard. Here’s the direct link to the Plausible Analytics GTM template.

Plausible GTM Template

Create a new Tag

Once you’ve installed the template, you should create a new “Tag” that uses it. To do this:

In the main Google Tag Manager dashboard, browse to “Tags” and click “New” to create a new tag.

Plausible GTM Template New Tag

From the list of available tag templates, choose the Plausible Analytics tag template you just installed.

Plausible GTM Template New Tag Template

The only required field in the tag configuration is “Script ID” that you saved earlier. To repeat, you can find it in Plausible during site onboarding under the “Tag Manager” tab or later in “Site Settings” → “General” → “Site Installation” → “Tag Manager.

Plausible GTM Template New Tag Script ID

Other optional configuration options are described below in the section “Tag Configuration.

Plausible GTM Template New Tag Configuration options

For the tag trigger, you should select “All Pages - “Page View”, which will ensure that Plausible will capture data on all pages.

Plausible GTM Template New Tag Trigger

Configure Your Plausible Tag

The tag has the following optional configuration options:

Optional Configuration Explanation
File Downloads Whether to automatically track file downloads 
Form Submissions Whether to automatically track form submissions
Outbound Links Automatically track clicks on outbound links
Hash Based Routing Automatically track page paths that use a # in the URL, described here
Custom Properties Allows you to attach custom properties (also known as custom dimensions in Google Analytics) when sending a pageview event. These can be configured using Google Tag Manager variables.
Capture on Localhost Whether to capture events on localhost
Logging Whether to log on ignored events. When enabled, any ignored events are logged to the browser console with a warning
Auto Capture Pageviews Whether to automatically capture pageviews. If this is unchecked, the script will be loaded and ready to receive events but no pageviews will be sent. You would need to recreate pageview events by creating another tag with the trigger “Page View” or similar to send the event manually

Add Custom Properties (Optional)

The Plausible GTM tag lets you send custom properties (extra data) with every pageview. To add them:

  • Click ‘Add Custom Property’
  • Select a GTM variable — this defines the value to send.
  • Type in the name of the Plausible custom prop under the field ‘Plausible Custom Property’

For example, to send the full page URL with each pageview:

  • Choose the built-in GTM variable Page URL.
  • Name it page_url in Plausible.

built in variable gtm

You can take things a step further by defining your own custom GTM variables. For instance, to send the page title as a property:

Instead of selecting Built-In Variable, instead create a New Variable by selecting the next option.

You can then give this variable a name, like Page Title and select Javascript Variable.

js variable gtm

Then, when asked to enter “Global Variable name”, you simply enter ‘document.title’.  This will automatically take the title of the page using Javascript and make it available as your GTM variable.

Finally, to send this to Plausible you would just need to give it a name like ‘page_title’.

With both of those variables set-up, your final custom props configuration would look like this:

custom props in gtm

Track Custom Events (Optional)

You can also use Google Tag Manager to send custom events to Plausible. You just need to create a new tag and select Custom HTML. Then in the Custom HTML paste the following:

<script type="text/javascript">window.plausible("EVENT_NAME");</script>

Where EVENT_NAME is the name of the custom event that you’ve set up in Plausible.

You then just need to select a Trigger. Two of the most useful triggers are the the ‘Clicks - All Elements’ trigger that fires any time someone clicks an element on your site and ‘Clicks - Just Links’ which fires any time someone clicks a link on your site.

As an example, if we wanted to send an event called “Login Click” every time that someone clicked the button that had text “Login”, we would have a tag that looks like this:

<script type="text/javascript">window.plausible("Login Click");</script>

And a trigger set up as ‘Click - All Elements’ that looks like this:

click - all elements

For the trigger, we are looking for the clicks where the target of the click is Equal to ‘Login’.

Note: we are currently testing enhancements to our Google Tag Manager template to make the process of sending custom events to Plausible even easier and completely code-free.

Test your setup

Before publishing, always verify that everything works as expected. To test:

  1. Click the blue Preview button in your GTM dashboard.
  2. A new tab will open showing your website with the GTM container active.
  3. In the Tag Assistant Preview panel, confirm that the Plausible tag fires correctly. You can see additional information about the events that trigger the tag and the data that is being sent.

If you see the tag firing and data appearing in your Plausible dashboard — your setup is complete!

What’s next?

Now that your site is tracking with Plausible via GTM, you can:

Enjoy Plausible!

Ready to dive in?
Start your free trial today.

Cloudflare Web Analytics vs Plausible Analytics

Cloudflare Web Analytics is a new player on the simple, privacy-first and de-Googled web analytics market.

Plausible: GDPR, CCPA and cookie law compliant site analytics

Even though the purpose of Plausible Analytics is to track the usage of a website, this can still be done without collecting any personal data or personally identifiable information (PII), without using cookies and while respecting the privacy of the website visitors.

What makes Plausible a great Google Analytics alternative

Many site owners have the habit of installing the Google Analytics tracking script on their sites as one of the first actions they take after the launch.

How to offer a white label web analytics dashboard powered by Plausible

We’ve made it easy for you to provide or resell a white label version of our simple and privacy-centric web analytics dashboard to your customers. We’ve built several features to make it easy to integrate web analytics powered by Plausible (but without our branding) directly into your user interface.

Plausible: Lightweight web analytics tool that doesn't slow down your site

Plausible Analytics script is lightweight. It’s much smaller than the Google Analytics Global Site Tag. Plausible will reduce your page weight and will prevent your site from loading slow.

Plausible: Open source Google Analytics alternative

Plausible Analytics is an open source, simple, lightweight and privacy-friendly Google Analytics alternative. One aspect that makes Plausible different from many of the other web analytics tools such as Google Analytics is the fact that Plausible is open source software. Let’s take a look at what that means exactly.

Plausible: Privacy-first web analytics plugin for WordPress

Plausible Analytics is an open source web analytics plugin for WordPress that is an easy to use, lightweight and privacy-friendly Google Analytics alternative.

Plausible: Privacy focused Google Analytics alternative

Even though the purpose of Plausible Analytics is to track the usage of a website, this can still be done without collecting any personal data or personally identifiable information (PII), without using cookies and while respecting the privacy of your website visitors.

Plausible: Self-Hosted Google Analytics alternative

Plausible Analytics is an open source web analytics tool. Our mission is to reduce corporate surveillance by making a useful and privacy-friendly website analytics tool that doesn’t come from the adtech world.

Plausible: The more accurate alternative to Google Analytics

“Every number in your Google Analytics account is wrong.” That is exactly what an independent study recently done by Orbit Media found. 

Easy to use, actionable and privacy-compliant analytics for ecommerce and startups

Plausible Analytics helps ecommerce and SaaS startups get some actionable data to make better decisions. At the same time, their visitors keep having a privacy-friendly and enjoyable experience.

Plausible: Simple web analytics tool you can use to measure site traffic

The goal of Plausible Analytics is to provide you all the valuable and actionable website traffic metrics at a glance in a simple and modern web analytics dashboard.

What makes Plausible a great Matomo alternative

Matomo, formerly known as Piwik, was founded in 2007 and has long been the most well known open source alternative to Google Analytics. Matomo is installed on 1.9% of all websites and this is an amazing success for a great open source web analytics project.

We've collected $78,000 in the two years of our donation fund

We’ve managed to collect $78,000 over the two years of this initiative and have made donations to different projects including the Red Cross, the Erlang Ecosystem Foundation, the Sea Shepherd, the Ocean Cleanup and the Mossy Earth.

Website analytics platform for bloggers and content creators

Many people create content on their personal websites and blogs. There are many motivations behind this. Some use it like a diary, some as a hobby, or as a way to connect to other people, as a way to build an audience, make money and even improve their career opportunities.

Website analytics platform for freelancers and agencies

One of the use cases Plausible Analytics was specifically designed for are the freelancers and agencies who work with clients developing their websites, communication and marketing practices.

Plausible: Powerful audience segmentation and visitor analysis

The one thing that has always helped Plausible grow is sticking to the needs of a specific set of audience. When we started as a simple-enough and privacy-first way of tracking website traffic, we automatically started appealing to individual creators.

Why pay for an analytics tool when Google Analytics is free?

Google Analytics has been the staple of the digital marketing industry. It’s the most commonly adopted web analytics tool on the internet, that it’s a habit–a no-brainer–for site owners to install and use it for tracking site performance. And because it’s always been free to use, that is part of the habit as well.