Works with your stack
Cookie consent for GA Google Analytics
the tag prints straight in
GA Google Analytics prints the Google tag straight into your pages. It sets no consent default and does not read WP Consent API. Cookie Rocks holds the tag until the visitor agrees.
By Jeff Starr · perishablepress.com · WordPress.org
Is this your product? Tell us if anything here is out of date. Write to us
GA Google Analytics
WordPress plugin
- Tested version
- 20260810
- How
- Tested automatically around each Cookie Rocks version
- Last test
- 7 November 2026
- Latest version
- 20260810 tested
- Active installs
- 400,000+
What GA Google Analytics adds to your visitors’ browser
Trackers it loads
- Google Analytics / Google Ads (gtag.js) →Statistics, Marketing1 browser storage key
Cookies seen in our test
_ga_<ID>_ga
What matters for consent with GA Google Analytics
No consent of its own
The plugin prints the Google tag in the page directly. It sets no Consent Mode default, and its custom code field comes after the tag, too late for one.
Held until the choice
Cookie Rocks holds the tag before the choice and loads it after Accept all, without a reload. Google Analytics then sets its cookies.
Boxes that do nothing with GA4
Display advertising, link attribution, IP anonymization and force SSL only apply to the old codes. With a GA4 ID they have no effect. Hiding tracking from logged-in users only covers administrators.
Cookie Rocks with GA Google Analytics
- Holds the scripts it adds to your pages, such as tags, pixels or a chat, until the visitor consents. In advanced Consent Mode, Google’s tags load with consent denied instead.
What our tests found on GA Google Analytics
Good to know · GA Google AnalyticsCookie Rocks holds the GA Google Analytics tag until Accept all
On a test WordPress with GA Google Analytics in gtag mode and a dummy G- ID, Cookie Rocks holds gtag.js before the choice and loads it after Accept all, without a reload; Google Analytics then sets _ga and _ga_<ID>.
Seen in our tests, 17 October 2026, GA Google Analytics 20260810.
Depends on a setting · GA Google AnalyticsSome GA Google Analytics boxes have no effect with GA4
setting “disable_admin, gap_anonymize, gap_display_ads, link_attr”
Display advertising, link attribution, IP anonymization and force SSL apply only to the old codes. Hiding tracking from logged-in users covers administrators only.
Read in its code, 16 October 2026, GA Google Analytics 20260810.
Full detail
In GA Google Analytics' gtag (GA4) mode, the display advertising, link attribution, IP anonymization and force SSL boxes have no effect; they apply only to the Universal and legacy codes. Its option to hide tracking from logged-in users only covers the administrator role.
Set before the choice · GA Google AnalyticsGA Google Analytics loads gtag.js with no consent default
It sets no cookie itself and does not use WP Consent API. A consent default can only be added in its custom code field, which is printed after gtag.js.
Read in its code, 16 October 2026, GA Google Analytics 20260810.
Full detail
GA Google Analytics prints gtag.js and its inline config directly in wp_head (or wp_footer), without a script handle or any data-cfasync or no-optimize attribute. It sets no Consent Mode default, does not use WP Consent API and sets no cookie itself; the only way to add a consent default is its custom code field, printed after the async gtag.js tag. Its attribute filters escape quotes with esc_attr, so they cannot add type="text/plain".
How we test it
Around each version, with its latest release
Around each Cookie Rocks version, a fresh WordPress installs its latest version from WordPress.org next to Cookie Rocks and runs the same checks. A new version joins the next run on its own.
- GA Google Analytics 20260810, tested on 7 November 2026.
- The banner shows, the trackers of the test page wait for consent and load after it, and Cookie Rocks raises no PHP error.
- Its own tags, set with a test ID, do not load before the choice and load after “Accept all”.
- Settings of the test: Google Analytics 4 ID (test value), gtag.js mode.
- Last run: GA Google Analytics 20260810 on 7 November 2026, with WordPress 7.1.3.
Other plugins of the same kind.
Questions
What happens after the 30-day trial?
The banner, your visitors’ choices and your proofs of consent keep working. Without a key, most settings lock, updates and support stop. Take a key at any time and everything opens again.
For GA Google Analytics users
Keep the plugin, hold the tag.
the tag waits
Every feature of the complete plugin for 30 days, no card. GA Google Analytics keeps working as it does today.
- During the trial: everything, including the full settings and the scans
- After 30 days without a key: the banner, your visitors’ choices and your proofs of consent keep working
- What waits for a key: most settings, updates and support

Get your trial key
Your e-mail and your site. Your key arrives as soon as you confirm your e-mail.