2026年11月13日

2026年11月13日

MonsterInsights Setup: Connect GA4, Exclude Users and Send Events

This article is a localized edition of the Japanese original. Read the Japanese original

MonsterInsights is a plugin that adds the Google Analytics 4 (GA4) tracking tag to WordPress and lets you view traffic reports inside the admin screen. The free version (MonsterInsights Lite) is published on wordpress.org, and some features, such as eCommerce tracking, are available in the paid version (Pro).

Screen names in this article match MonsterInsights Lite 11.3 as of November 2026. According to wordpress.org, it requires WordPress 5.6 or later and PHP 7.2 or later.

Before you start, create a GA4 property and a web data stream in Google Analytics.

Step 1: Install the plugin

In the admin screen, go to "Plugins" → "Add New Plugin", search for "MonsterInsights", then click "Install Now" and "Activate". The wordpress.org slug is google-analytics-for-wordpress, so with WP-CLI you install it like this:

wp plugin install google-analytics-for-wordpress --activate

Once activated, an "Insights" item is added to the left admin menu.

Step 2: Connect to Google Analytics

There are two ways to connect. If you want to see reports in the admin screen, use the first one, the connection wizard.

Method 1: Connect with the wizard (recommended)

  1. Open "Insights" → "Settings", and in the "Google Authentication" section of the "General" tab, click the connect button (such as "Connect Google Analytics + WordPress" or "Connect MonsterInsights"; the wording differs by version). The first time, starting from "Launch Setup Wizard" leads to the same connection steps.
  2. You are taken to the MonsterInsights site. Sign in with your Google account and allow MonsterInsights to access your Google Analytics data.
  3. Choose the GA4 property (data stream) to use for tracking and finish.

After connecting, the tracking tag is output on your site, and the overview report becomes available under "Insights" → "Reports". Until data builds up in GA4, it takes a while for numbers to appear in the reports.

Method 2: Enter the GA4 Measurement ID manually

You can also skip the wizard and enter only the GA4 Measurement ID. In the "Or manually enter GA4 Measurement ID" field on the "General" tab, enter the Measurement ID that starts with G- and save.

According to the notice on the MonsterInsights screen, with a manual ID the reporting features and some tracking features are not available. That is enough if you only need the tag, but use Method 1 if you want reports in the admin screen.

You can find the GA4 Measurement ID in Google Analytics under "Admin" → "Data collection and modification" → "Data streams" by opening the web stream.

Step 3: Review the tracking settings

The settings are split into tabs under "Insights" → "Settings". The main items are:

Tab Item What it does
Advanced Exclude These User Roles From Tracking Users logged in with the selected roles are not tracked. The default is Administrator and Editor
Advanced Allow These User Roles to See Reports / Allow These User Roles to Save Settings Decide who can see reports in the admin screen and who can change the settings
Engagement Extensions of Files to Track as Downloads Set the file extensions that are tracked as downloads. The default is doc,pdf,ppt,zip,xls,docx,pptx,xlsx
Engagement Enable Enhanced Link Attribution Lets you tell apart multiple links on the same page
Publisher Affiliate Links Register the URL paths and labels treated as affiliate links. The defaults are /go/ and /recommend/

To exclude your own or your team's visits, check that the roles you normally log in with are in the exclusion setting on the "Advanced" tab. The exclusion only applies while you are logged in, so pages viewed after logging out or in another browser are tracked. To exclude traffic from your office network, define internal traffic in GA4 under "Admin" → "Data streams" → "Tag settings" and activate the data filter.

Match the Affiliate Links field to the path of links shortened with ThirstyAffiliates, Pretty Links and similar tools (such as /go/). MonsterInsights lists affiliate link tracking as a Pro feature, so check on your version's screen whether it works in the free version.

After changing settings, click "Save Changes" on the screen.

Step 4: Send your own events

If you want to send an event to GA4 in a specific situation, such as when a form's thank-you page is shown, you can use the gtag() that MonsterInsights outputs. The example below sends an event named contact_form_complete when the page with the slug contact-complete is shown. Put it in your child theme's functions.php or in your own plugin.

<?php
add_action( 'wp_footer', function () {
	// Do nothing if MonsterInsights is inactive
	if ( ! function_exists( 'monsterinsights_get_v4_id' ) ) {
		return;
	}
	// Send only on the thank-you page
	if ( ! is_page( 'contact-complete' ) ) {
		return;
	}
	?>
	<script>
	if ( typeof gtag === 'function' ) {
		gtag( 'event', 'contact_form_complete', { form_name: 'contact' } );
	}
	</script>
	<?php
} );
  • Event names should start with a letter and use only letters, numbers and underscores.
  • To use a custom parameter such as form_name in reports, register it as a custom dimension in GA4 under "Admin" → "Data display" → "Custom definitions".
  • To count completed inquiries as an outcome, mark the incoming event as a key event in GA4 under "Admin" → "Data display" → "Events".

If you test while logged in as an excluded user, the event is not sent. Test while logged out or in another browser.

Step 5: Check that tracking works

  1. Open your site while logged out or in another browser, and check that the page source has a line starting with googletagmanager.com/gtag/js?id=G-.
  2. Open "Reports" → "Realtime" in GA4 and check that your visit and events show up.
  3. For the event from Step 4, check in the event count card of the Realtime report that the event name has arrived.

You can also do the first check from the command line (replace example.com with your site). If the Measurement ID is printed, the tag is being output.

curl -s https://example.com/ | grep -o 'gtag/js?id=G-[A-Z0-9]*'

If you use a page cache, old HTML may be served after you change settings, so tag changes will not show. Clear the cache before checking.

Notes

  • If the tag for the same GA4 property is output twice, by MonsterInsights and another plugin (such as Site Kit by Google) or a theme setting, pageviews are counted twice. Let only one of them output the tag. For choosing between this and Site Kit, see how to set up Site Kit by Google.
  • eCommerce tracking is not available in the free version (the settings screen shows an upgrade notice).
  • If your site gets visitors from regions that require cookie consent, set up a way to track only after consent is given (such as a consent management plugin).
  • For how to think about conversion tracking in GA4, see how to track GA4 conversions in WordPress.

Summary

  • Connect MonsterInsights to GA4 from the "General" tab under "Insights" → "Settings". Use the wizard if you want reports; a manual Measurement ID only adds the tag
  • Administrators and Editors are excluded from tracking by default. Exclude other roles and your office network with their own settings
  • Send your own events with gtag( 'event', … ), and set up parameters as custom dimensions and outcomes as key events in GA4
  • When checking, log out and look at the page source and GA4's Realtime report
  • Do not output the tag for the same property from more than one plugin

Questions about WordPress? The publisher of this site is based in Japan and replies in Japanese. Contact (Japanese)

お気軽にご相談ください

お見積りへ お問い合わせへ
▲