Build and Launch a Website with AI
How to track visits to an AI website (2026): GA4 setup, Realtime and duplicate pageviews
Set up a GA4 web stream for an AI-built website, install the current tag once and verify production visits. Check React navigation, duplicate views, zero data and the difference from search clicks.

Your AI-built website is live. To find out whether anyone visits, start by installing Google Analytics 4 (GA4) and verifying one visit you can reproduce. Then use the collected data to see which pages people open and how they arrive.
This guide covers a web data stream, tag installation, production publishing, Realtime verification and duplicate pageviews. It suits portfolios, small tools and websites with editable code or an analytics integration. No VPS is required. The procedure was checked against official documentation on November 20, 2026; it does not claim measured traffic for your site.
| Question | Where to look |
|---|---|
| Did the installation receive my test visit? | GA4 Realtime and Tag Assistant |
| Which pages were viewed and which channels brought visits? | GA4 page and acquisition reports |
| Which Google searches produced impressions and clicks? | Search Console's search performance report |
| Was a lead saved or an order paid? | Your business system, checked against the relevant event |
Search clicks and browser-collected pageviews cover different activity. They should not be expected to match exactly. To set up search visibility checks, use the Search Console and indexing guide.
Sign in to Google Analytics with the account that will manage the website. Start measuring if this is your first account; otherwise create a property from Admin.
- Name the property so you can identify the site. Choose the reporting time zone and currency.
- Complete the requested business details and select a Web data stream.
- Enter the production website address and a recognizable stream name. Use the address visitors will open, rather than the AI editor's preview URL.
- Open the stream details. Note the measurement ID and Google tag information, then find installation instructions.
Keep track of the selected property and stream. If data seems missing later, check the property selector before creating another one. See Google's setup instructions.
Open the stream's Google tag installation instructions and choose Install manually, or follow the website platform's supported analytics integration. Copy the entire generated snippet. Where a platform requests an ID, supply the specific type it asks for.
Google announced Google tag and Tag Manager unification on November 17, 2026. New snippets can differ from older tutorials. Use your current installation instructions; an older working installation does not need to be replaced simply because its code looks different. See the release notes and tag installation guide.
| Website setup | Installation point |
|---|---|
| Separate static HTML pages | Follow the supplied instructions immediately after the opening <head> on each measured page |
| React + Vite SPA | Usually the root index.html, loaded once for the application |
| Framework layout or analytics component | One shared entry, following that integration's documentation |
| Website builder with an Analytics field | Use that integration and verify the generated tag |
| Existing Tag Manager implementation | Check the GA4 destination and triggers in the existing container |
Search for the measurement ID, googletagmanager, gtag and analytics components before adding code. Do not add a second installation in every page component. Keep any consent management in control of when analytics is allowed to run. Avoid sending email addresses, phone numbers or message text, including through page URLs and titles. See Google's PII guidance.
You can give an AI coding tool the actual snippet and this request:
Check the website's existing analytics integrations and Tag Manager containers. Reuse the existing integration or install this GA4 web stream once at the appropriate shared entry. Preserve consent handling. List changed files and publishing steps. Explain how to verify the initial page_view and one internal navigation before adding manual pageview events.
Publish the change to the production project. For React + Vite, the Vercel deployment guide covers the build and release steps. Editing a local preview does not update the live domain.
Open Reports → Realtime in the correct GA4 property. In another browser window, open your production website and use its consent interface to permit analytics for this test. Visit the homepage, a real inner page and then return. Note the time and paths, and check for the corresponding activity. Realtime confirms collection; use acquisition reports for fuller source analysis. See the Realtime guide.
For event-level checks, connect your production address in Tag Assistant. Confirm the expected tag and GA4 destination. Then open Admin → Data display → DebugView, select your debug device and inspect page_view and page_location.
Use Tag Assistant to enable debugging for your own device. There is no need to leave debug_mode enabled for every visitor. Privacy controls, consent state and blocked scripts can affect what appears. See DebugView instructions.
Many regular reports and explorations take 24–48 hours to process data. Use Realtime and DebugView for installation checks instead of adding another tag because today's report is empty. See collection and processing guidance.
A SPA may load HTML once and change routes in the browser. Test the initial load, internal navigation, back and forward. For a direct Google tag installation using the History API, inspect Enhanced measurement's pageview options in the web stream, including page loads and changes based on browser history. See Google's SPA measurement guide.
If Tag Manager history triggers or application code already send pageviews, keep one deliberate approach. Adding automatic history measurement can double-count. Applications that change components without updating a suitable URL need measurement designed around their actual routing behavior.
Check the first page's page_view, then navigate once and inspect whether page_location changes to the new route. Count pageview events, rather than all events. Two identical views for one action suggest overlapping platform integrations, tags, containers or route listeners.
If developers choose fully manual measurement, a legacy config call with send_page_view: false does not by itself disable enhanced measurement's history events. Inspect those settings too. For dashboard-managed tags, review the actual initialization and triggers rather than removing commands blindly. See the pageview documentation.
| Symptom | Next check |
|---|---|
| Production page lacks the installation | Whether the change was deployed to the right project |
| Tag exists but points elsewhere | Connected GA4 destination and selected property |
| Browser blocks the script | Extensions, network, content security policy and consent state |
| Homepage works, route changes do not | SPA route measurement |
| Realtime works but a date report is empty | Installation time, date range, time zone and processing |
| Each action produces duplicate views | Overlapping installations or automatic and manual tracking |
Use Console and Network to inspect loading and collection requests. A successful script download alone does not prove that the intended GA4 property received an event. A clean test browser can help isolate an extension issue; retain visitors' privacy choices.
Once collection works, select a consistent date range and examine pageviews, active users and sources. Multiple views can belong to the same visitor, and user metrics are not a verified count of individual people. See user metric definitions.
For a new tutorial, check whether people reach it and then continue to your product page. For leads, define success after the business system confirms submission, separately from a button click. That gives the traffic numbers a concrete purpose.