Library

Bot template tutorial

Let your bot set up Google Analytics, Tag Manager and Search Console

By Šarūnas Vaitkus · about a 6-minute read

Your bot can audit, set up and check Google Analytics 4 (GA4), Google Tag Manager (GTM) and Google Search Console for your site. You don't do the steps yourself. You just send it the prompts below, in order, and it asks you before anything goes live.

Fill once

These fields match the blanks in this tutorial only. What you type is used to fill the prompts on this page, and nowhere else. It is not saved, stored, or sent, and it is forgotten when you leave.

Left as brackets on purpose: [your Google account email], [your IP addresses], [G-XXXXXXX], [GTM-XXXXXXX]. Those can be an email, an address, or an account id. Add them in the chat yourself. Don't type them here.

Progress0 of 8

What you need

  • A Google account with access to GA4, GTM and Search Console, or a willingness to create them.
  • Access to your site's code or hosting.
  • About 10 minutes for signing in and approvals.

How it works

You send a prompt, the bot does the work, and you approve what matters.

Highlighted [brackets] are blanks. The fields above fill the ordinary ones. Anything private stays a bracket until you add it in the chat.

  1. Step 1. Audit what's there (read-only)

    Prompt to send

    Audit the analytics on [your website address]. Don't change anything. Check which tags the live site loads: GA4 measurement IDs (like G-XXXXXXX), Tag Manager containers (like GTM-XXXXXXX), old Universal Analytics leftovers and duplicates. Tell me if it's a single-page app (SPA) that changes pages without a full reload. Then review my GA4 streams, retention, filters, internal traffic, Google signals, user-provided data and enhanced measurement, and check Realtime. If you need a sign-in first, stop and tell me. Finish with a plain summary of the gaps.

    Why you're sending it

    You'll know where you stand before anything changes, and a read-only audit can't break anything.

    What you'll get

    A short list of what works, what's missing and what's counted twice, with suggested fixes.

  2. Step 2. Sign in safely

    Prompt to send

    Open a Google sign-in page in your browser so I can sign in to [your Google account email]. I'll type the password and two-factor authentication (2FA) code myself. Don't read, save or ask for either. Keep the session for the next steps.

    Why you're sending it

    The bot needs access to your Google tools, but your password should never pass through a chat.

    What you'll get

    The bot's browser stays signed in to your account for the later steps.

  3. Step 3. Configure Google Analytics 4

    Prompt to send

    Configure my GA4 property for [your website address]. Set event data retention to 14 months. Define internal traffic for my internet protocol (IP) addresses: [your IP addresses]. Switch the Internal Traffic filter to Active and add an active Developer Traffic filter. Turn off user-provided data collection. Recommend whether Google signals should be on or off, and wait for my answer. Make sure there's a web stream for my real domain, and add [your preview or staging host] to unwanted referrals. List the changes before you make them.

    Why you're sending it

    The defaults keep event data for only 2 months and count your own visits.

    What you'll get

    A tidy GA4 property that ignores your own visits, plus a list of what changed.

  4. Step 4. Set up Tag Manager

    Prompt to send

    Set up Tag Manager for [your website address], reusing my container if I have one. Add the Google tag for my measurement ID [G-XXXXXXX]. If my site is a single-page app, add a page_view tag that fires on a custom dataLayer event (a small message my site sends to Tag Manager) when the page changes. Also track outbound clicks, lead form submissions and chat opens. Publish a named version. Pause old tags and don't delete anything.

    Why you're sending it

    Tag Manager lets you change tracking later without touching your code.

    What you'll get

    A named, published version that tracks pages and key actions, with old tags paused, not gone.

  5. Step 5. Update the site code

    Prompt to send

    Update the code for [your website address] through a pull request I can review. Replace the direct gtag.js script with the Tag Manager snippet for [GTM-XXXXXXX]. Load tracking only on the production domain, not on preview or development copies. Add a ?notrack=1 opt-out for my own visits. Add an automated check that fails if a page loads two tags. Don't go live until I approve.

    Why you're sending it

    A pull request is a proposed change you read first, so nothing goes live without your OK.

    What you'll get

    A pull request to review, with a plain note on what changed and how to test it.

  6. Step 6. Search Console and SEO

    Prompt to send

    Add [your website address] to Google Search Console and verify it. If that needs a domain name system (DNS) change, ask me first. Submit my sitemap and remove stale ones. Check every page has its own canonical address and title. Link Search Console to GA4, then request indexing for [your key pages].

    Why you're sending it

    Search Console shows how Google sees your site, and search engine optimisation (SEO) basics like canonicals decide which pages appear in search.

    What you'll get

    A verified site, a fresh sitemap, duplicate canonicals or titles fixed, and key pages queued for indexing.

  7. Step 7. Verify in a real browser

    Prompt to send

    Open [your website address] in a real browser and watch the network traffic. Confirm there's exactly one page_view per page load and per in-app page change. Load it again with ?notrack=1 and confirm nothing is sent. Then check the visits show up in GA4 Realtime.

    Why you're sending it

    Settings can look right and still send wrong data, so you want proof from a real visit.

    What you'll get

    A pass or fail for each check, with a fix for anything that failed.

  8. Step 8. Set up a weekly health check

    Prompt to send

    Set up a weekly routine that checks [your website address]: one GA4 tag, one Tag Manager container, one page_view per page, the opt-out working and data arriving in Realtime. Only message me if something's wrong.

    Why you're sending it

    Tags break quietly when a site changes, and nobody notices until the reports look odd.

    What you'll get

    A weekly check that stays quiet until something breaks, then tells you what.

All in one (optional)

Prefer one prompt? Send this instead.

Prompt to send

Set up analytics for [your website address] from start to finish, in this order: a read-only audit, a safe sign-in where I type my own password and 2FA code, GA4 settings, Tag Manager, a code change through a pull request, Search Console and SEO, a real-browser check, and a weekly health check. Pause after each step to show me what you did. Ask me before anything goes live, changes DNS, deletes something, spends money or sends anything outside.

What your bot will always ask you first

  • Going live on your production site.
  • Changing DNS records.
  • Deleting properties, streams, containers or tags.
  • Spending money, for example on Google Ads.
  • Sending anything externally.

It bundles its questions, so you're not pinged all day.

Tap a pumpkin. Hold it to show how strongly.

0 answered