Track traffic and conversions on your WordPress site with Google Analytics 4 (GA4) or Google Tag Manager (GTM).
G-XXXXXXXXXX).Google’s setup guide: Set up Analytics for a website.
If your theme has a “Custom code” or “Header/Footer scripts” option (e.g. in the Customizer or theme settings), you can paste the GA4 gtag snippet there. Get the snippet from Analytics: Admin → Data Streams → your stream → View tag instructions → Install manually.
Use this only if you’re comfortable editing theme settings; a plugin is easier to update and doesn’t depend on the theme.
GTM lets you manage multiple tags (GA4, ads, other scripts) from one place without editing theme code.
<head>, one for <body>).Once GTM is on your site, you can add or change GA4 and other tags from the GTM dashboard without touching WordPress.
If your plan includes it, you can connect your GA4 property to the platform’s monitoring dashboard so you see traffic (pageviews, sessions) alongside uptime and response times in one view. Ask support or check your site’s monitoring page for “Connect Google Analytics” when that’s available.