How to Set Up Google Search Console and Google Analytics for a New WordPress Website

Most new WordPress sites get built and launched without any measurement in place. Pages go live, content gets published, and traffic may or may not arrive — but without Google Search Console and Google Analytics connected, you have no visibility into what’s actually happening. You can’t see which pages rank, where visitors come from, or what they do when they arrive.

Setting up both tools is a one-time task that takes about twenty minutes. Once done, you’ll have ongoing data that shapes every decision you make about the site — from content priorities to technical fixes to understanding whether your SEO work is paying off.

This guide walks through setting up Google Analytics 4 and Google Search Console in WordPress, connecting them together, and confirming everything is working correctly.

Quick Answer

Create a GA4 property in Google Analytics and add the tracking code to WordPress using Site Kit by Google. Then create a Search Console property, verify your site with the Domain method, submit your sitemap, and connect Search Console to your Analytics account. Both tools are free and work alongside each other.

Why Both Tools Matter

Google Analytics and Google Search Console answer different questions, which is why you need both.

Google Analytics tracks what happens on your site after someone arrives — pages visited, time on page, bounce rate, conversions, traffic sources, and user behaviour. It tells you how visitors use your site.

Google Search Console tracks your site’s performance in Google search specifically — which keywords trigger impressions, which pages rank, click-through rates, crawl errors, and indexing status. It tells you how Google sees your site.

Used together, they give you a complete picture: Search Console shows you where organic traffic is coming from, and Analytics shows you what those visitors do when they land.

How to Set Up Google Analytics 4 in WordPress

Step 1: Create a GA4 Property

Go to analytics.google.com and sign in with your Google account. If you’re creating an account for the first time, click Start measuring and follow the prompts. If you already have an Analytics account, click the account selector at the top left and choose Create property.

Give the property a name — typically your site name. Select your country and time zone, then choose your currency. Click Next, fill in the business details, and select your primary use case. Google will then present you with a data stream setup screen.

Choose Web as the platform, enter your site URL and a stream name, and click Create and continue. You’ll then see your Measurement ID — a string starting with G-. Keep this tab open; you’ll need it in the next step.

Step 2: Add Analytics to WordPress

The simplest way to connect GA4 to WordPress is with Site Kit by Google. It handles the tracking code automatically, keeps the connection authenticated, and brings a basic analytics dashboard directly into your WordPress admin. In most sites I build, this is the approach I use — it avoids manual code edits and handles updates reliably.

To set it up:

  1. Install and activate Site Kit from Plugins → Add New.
  2. Go to Site Kit → Dashboard and click Sign in with Google.
  3. Grant the requested permissions and follow the authentication flow.
  4. When prompted to connect services, select Google Analytics and choose the GA4 property you just created.
  5. Site Kit will add the tracking code to your site automatically.

If you prefer not to use Site Kit, you can add the GA4 tracking code manually. Copy the full script tag from your GA4 data stream settings (under Tagging instructions → Add new on-page tag → Global site tag) and paste it into your theme’s header. In GeneratePress, this can be done via Appearance → Theme File Editor → header.php, or through a custom HTML plugin like WPCode. Either approach works — choose the one that suits your setup.

If you want to keep your plugin stack lean, it’s worth reviewing the essential WordPress plugins for new websites before adding more tools than you need.

How to Set Up Google Search Console

Step 3: Add Your Site as a Property

Go to Google Search Console and sign in. Click Add property and choose between two property types:

  • Domain property — covers all URLs across all subdomains and both http/https versions. Requires DNS verification. This is the recommended option.
  • URL prefix property — covers only the specific URL you enter. Offers multiple verification methods and is easier to set up quickly.

For a standard WordPress site, I recommend the Domain property. It captures everything under your domain without gaps, and DNS verification is straightforward through your hosting control panel or domain registrar.

Step 4: Verify Your Website

If you chose the Domain property, Google will give you a TXT record to add to your domain’s DNS settings. Log in to your domain registrar or hosting account, go to your DNS zone, and add the TXT record Google provides. It typically takes a few minutes to propagate, after which you can click Verify in Search Console.

If you chose the URL prefix property, verification options include adding an HTML tag to your homepage, uploading an HTML file to your server, or connecting through Google Analytics or Google Tag Manager. If you’ve already set up GA4 on your site, choose the Google Analytics verification method — it requires no additional steps and confirms ownership instantly.

Step 5: Submit Your Sitemap

Once verified, go to Sitemaps in the left sidebar and submit your sitemap URL. WordPress generates a default sitemap automatically at /wp-sitemap.xml — so for most sites, the sitemap URL will be https://yourdomain.com/wp-sitemap.xml. Enter the path (just wp-sitemap.xml in the field) and click Submit.

Submitting a sitemap doesn’t guarantee immediate indexing, but it tells Google where all your pages are and helps it discover new content faster. It also gives Search Console a baseline for reporting on coverage and indexing status.

Step 6: Connect Search Console to Analytics

Linking both tools brings your Search Console data — keyword impressions, clicks, and average position — directly into your Google Analytics reports. This connection is made in Analytics, not Search Console.

In Google Analytics, go to Admin → Property Settings → Search Console links. Click Link, select your Search Console property, choose the data stream that matches your site, and confirm. The data will start flowing within 24–48 hours.

Step 7: Confirm Everything Is Working

In Google Analytics, go to Reports → Realtime. Visit your own website in another tab or from your phone. Within a minute or two, you should see an active user appear in the Realtime report. That confirms the GA4 tracking code is firing correctly.

In Search Console, it takes a few days for data to begin populating. The Overview tab will show impressions and clicks once Google has processed enough search data. If your site is new or was recently launched, check whether Google has indexed your pages using the URL Inspection tool — or read the guide on how to check if your WordPress website is indexed by Google.

Practical Tips

  • Use the Domain property in Search Console. The URL prefix method is fine to get started, but the Domain property captures all traffic — including http, https, www, and non-www — without gaps. Mixing property types leads to incomplete data.
  • Exclude your own traffic from Analytics. If you visit your site regularly during development or review, your visits inflate the data. In GA4, you can create an internal traffic filter under Admin → Data Streams → Configure tag settings → Define internal traffic. Add your IP address and set a filter to exclude it.
  • Don’t install multiple tracking plugins. If you’ve tested a few analytics plugins, deactivate and delete the ones you’re not using. Duplicate tracking tags result in inflated session counts and skewed data.
  • Check Search Console regularly. Coverage errors, manual actions, and performance drops appear in Search Console before they affect your traffic noticeably. I usually check it once a week on established sites and more frequently after publishing new content or making structural changes.

Common Mistakes

  • Choosing the URL prefix property over Domain. This leads to split data if your site is accessible via both www and non-www, or http and https. Domain property avoids this entirely.
  • Not submitting a sitemap. Google will find your pages eventually, but a submitted sitemap speeds up discovery and gives you accurate coverage reporting from the start.
  • Expecting data to appear immediately. GA4 Realtime data is instant. Search Console performance data typically takes two to three days. Indexing data can take longer. Give it time before assuming something is wrong.
  • Ignoring indexing errors. Coverage issues flagged in Search Console — pages excluded, crawl errors, noindex tags — should be investigated promptly. Left unaddressed, they limit your organic reach.

When to Use This vs Alternatives

Google Analytics and Search Console are the default choice for most WordPress sites, and for good reason — they’re free, deeply integrated with Google’s search ecosystem, and give you more data than most sites need to act on.

If you’re building a privacy-focused site or want simpler reporting, tools like Plausible or Fathom are worth considering. They track fewer data points intentionally and don’t require cookie consent banners in most jurisdictions. The trade-off is that you lose Search Console’s keyword and ranking data, which is hard to replace with third-party tools. For the majority of WordPress sites focused on content and SEO, Google’s tools remain the practical choice.

Once your site is connected, the next step is knowing what to do with the data. This guide on how to use Google Search Console for WordPress SEO walks through the key reports and how to act on them.

For the full walkthrough, the guide to how to Add a Search Bar to a WordPress Website covers this step by step.

Conclusion

Set up Google Analytics and Search Console before your site gets any meaningful traffic. The data they collect from day one becomes more valuable over time — you’ll use it to identify content gaps, fix technical issues, and understand where growth is actually coming from. Once both are connected, you stop guessing and start making decisions based on what’s working. Once Search Console is active, it’s also worth checking your robots.txt file using the built-in tester — it’s the quickest way to confirm crawlers can access the pages you want indexed.