# Google Analytics 4 for WordPress

> Add GA4 without another plugin. The tracking script is cached on your own server, waits for cookie consent if enabled, and skips logged-in staff. Part of…

TW-MKT-03 Marketing


Add GA4 without another plugin. The tracking script is cached on your own server, waits for cookie consent if enabled, and skips logged-in staff.

[Get it from $26 a year](https://togglework.app/pricing/#plans) [Try it in the demo](https://togglework.app/demo/)

Google Analytics 4

**Part number**
: TW-MKT-03
**Section**
: [Marketing](https://togglework.app/features/marketing/)
**Settings**
: 5 (3 on/off)
**Starts**
: Switched off
**In plans**
: Every plan

## Why it matters

Adding Google Analytics 4 usually means another plugin or pasting a tag into the theme. Doing it well also means waiting for cookie consent, not counting your own visits, and tracking purchases.

### What it does

- Adds GA4 with your Measurement ID.
- Serves gtag.js from your own site, refreshed daily, with Google’s copy as fallback.
- Waits for [cookie consent](https://togglework.app/features/core/cookie-consent/) when that part is on.
- Skips the roles you choose, and sends WooCommerce purchase events.

![Google Analytics 4 settings screen in the Toggleworks WordPress plugin, showing Measurement ID, Serve gtag.js from this site, Wait for Cookie Consent, Do not track these roles](https://togglework.app/wp-content/themes/toggleworks-site/assets/img/parts/marketing-analytics.webp?v=1795524200)

The Google Analytics 4 screen in wp-admin, where you switch it on and change its settings.

## Set it up

1. Paste your GA4 Measurement ID (it starts with G-).
2. Exclude administrators and shop managers.
3. Check the Realtime report in Google Analytics.

## What you can set

Switch Google Analytics 4 on in Toggleworks → Marketing, then adjust any of these. Each one starts with a default, so you can switch the part on first and fine-tune later.

- Measurement ID
- Serve gtag.js from this site
- Wait for Cookie Consent
- Do not track these roles
- Send WooCommerce purchase events

## Good to know

- Don’t add GA4 here and in another plugin; you would count every visit twice.
- Want simple stats without cookies? See [Visitor Stats](https://togglework.app/features/marketing/visitor-stats/).

## One less plugin to install

Google Analytics 4 does a job people often install a separate plugin for:

- Adding a Google Analytics tagOften done with WPCode

## Comes with 187 more parts

Google Analytics 4 is one part of Toggleworks, a single plugin for security, speed, SEO, backups, email and store tools. Switch on what your site needs; the rest stays off and loads nothing.

[All 9 Marketing parts](https://togglework.app/features/marketing/)

### People also look for it as

- google analytics
- ga4
- gtag
- tracking
- statistics
- measurement id

## Often switched on with it

- [Visitor Stats](https://togglework.app/features/marketing/visitor-stats/) — TW-MKT-09 · Simple, cookie-free visitor statistics in your dashboard — daily views, top pages, referrers and devices — with no consent banner… · 3 settings
- [Lead Source Tracking](https://togglework.app/features/marketing/utm-tracking/) — TW-MKT-08 · See which campaign, ad or website every lead and order came from: UTM tags, referrer and landing page are saved with form entries… · 2 settings
- [AI Connection](https://togglework.app/features/ai/connection/) — TW-AI-09 · Pick your AI provider and model — Claude, ChatGPT, Gemini, Mistral, DeepSeek, Grok, Groq, OpenRouter or any OpenAI-compatible… · 41 settings
- [Cookie Consent](https://togglework.app/features/core/cookie-consent/) — TW-COR-06 · A small, fast consent banner (no external service). Tracking scripts marked for consent only run after the visitor accepts. · 7 settings
- [Header & Footer Code](https://togglework.app/features/core/header-footer-code/) — TW-COR-12 · Add analytics tags, pixels, meta tags or custom CSS to every page without editing the theme. · 5 settings
- [Search Log](https://togglework.app/features/core/search-log/) — TW-COR-21 · See what visitors type into your site search and which searches find nothing: a direct list of content to write and products to… · 2 settings

## Questions

**Is Google Analytics 4 included in every Toggleworks plan?**

Yes. Every plan includes all 188 parts, Google Analytics 4 among them. Plans differ only in how many sites you can use them on, and staging or local copies of a site don’t count.

**Does Google Analytics 4 slow my site down when it’s switched off?**

No. Every part starts switched off, and a part that is off loads none of its code. Switch on Google Analytics 4 only if your site needs it.

**What if a setting locks me out?**

Add `define( 'TOGGLEWORKS_SAFE_MODE', true );` to wp-config.php. It pauses every part until you remove the line, and Tools → Recent changes lets you undo a change.

**Can I try Google Analytics 4 before I buy?**

Yes. The [live demo](https://togglework.app/demo/) runs a WordPress site with Toggleworks in your browser, and every plan has a 14-day refund.

## Switch off the plugin pile.

All 188 parts, one license, updates and support. 14-day refund.

[Choose a plan](https://togglework.app/pricing/#plans) [Try the live demo](https://togglework.app/demo/)

---

Source: https://togglework.app/features/marketing/analytics/
