Skip to content

Google Analytics & Custom Tags

Adds tracking codes and custom scripts to your site without editing theme files — so they survive theme updates and don't need a child theme.

Only add code you trust

Anything entered here executes on your website, in every visitor's browser. Treat these fields like theme file access: paste only code from sources you trust, and review third-party snippets before adding them.

Google Analytics

SettingFormatNotes
GA4 Measurement IDG-XXXXXXXXXXRecommended for all sites
Universal Analytics Tracking IDUA-XXXXXXXX-XLegacy — Universal Analytics stopped collecting data in July 2023

Use GA4. The Universal Analytics field exists for sites that still reference an old property; it will not collect new data.

Google Tag Manager

SettingFormat
GTM Container IDGTM-XXXXXXX

Entering a container ID adds both the head snippet and the body snippet — you don't need to place anything manually.

GTM or GA4, not usually both

If you're already loading GA4 through Tag Manager, don't also enter the GA4 Measurement ID here — you'll load the tag twice and double-count pageviews.

Custom Tags & Scripts

Three slots, each injected at a different point in the page:

SettingInjected
Custom Head TagsInside <head>
Custom Body TagsImmediately after the opening <body> tag
Custom Footer TagsBefore the closing </body> tag

Include the full markup, <script> tags and all — the content is output as entered.

Which slot to use:

  • Head — verification meta tags, and scripts that must run before the page renders
  • Body — noscript fallbacks and tags a vendor specifies must come first in the body
  • Footer — everything else. Scripts here don't block rendering, so prefer it unless the vendor says otherwise.

Code Preview

The settings screen shows a preview of the generated GA4 and Tag Manager code, so you can confirm what will be output before saving.

Troubleshooting

Tracking isn't recording

  • Confirm the ID format — GA4 is G-, Tag Manager is GTM-, Universal is UA-
  • Check the page source for the tag; if it's absent, the setting didn't save
  • Clear any page cache — cached HTML predating the change won't include the tag
  • Check for an ad blocker or consent banner suppressing it in your own browser

Pageviews are doubled

The tag is loading twice — usually GA4 entered here and fired through Tag Manager, or also present in a theme setting or another plugin. Pick one source.

The site breaks after adding a script

Malformed custom code can break page rendering. Clear the field that you added last. If you're locked out of the admin, the settings live in the options table and can be cleared directly.

Built by Code Wattz.