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.
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.
- Why use Plausible Analytics with GTM?
- Before you begin
- Get started with Plausible Analytics
- Install the Plausible template in GTM
- Create a new Tag
- Add Custom Properties (Optional)
- Track Custom Events (Optional)
- Test your setup
- 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:
You will see the following screen, where you can select “Tag Manager” from the 4 tabs depicting the 4 different installation methods.
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.
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.
From the list of available tag templates, choose the Plausible Analytics tag template you just installed.
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.”
Other optional configuration options are described below in the section “Tag Configuration.”
For the tag trigger, you should select “All Pages - “Page View”, which will ensure that Plausible will capture data on all pages.
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.
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.
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:
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:
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:
- Click the blue Preview button in your GTM dashboard.
- A new tab will open showing your website with the GTM container active.
- 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:
- Get the most out of your Plausible experience
- Connect your Google Search Console to Plausible for seeing the search terms driving you traffic directly in the Plausible dashboard
- Customize your reporting by connecting with Looker Studio
Enjoy Plausible!