Register Book Analytics logo

Register Book Analytics

Community
dmccreary
register-book-analytics

Wires Google Analytics 4 into an MkDocs Material site — creates a GA4 property, writes the Measurement ID into mkdocs.yml, verifies the tag, and deploys. Use when adding analytics to a textbook for the first time.

Overview

Publisherdmccreary
Repositoryibook-skills
Skill nameregister-book-analytics
Stars
109
Forks
21
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by dmccreary on GitHub. Read the source before you install it.

Installation

Install the Register Book Analytics AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/dmccreary/ibook-skills/tree/main/skills/archived/register-book-analytics
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dmccreary/ibook-skills.git /tmp/ibook-skills
mkdir -p .claude/skills
cp -r /tmp/ibook-skills/skills/archived/register-book-analytics .claude/skills/register-book-analytics
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Register Book Analytics in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Register Book Analytics on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Register Book Analytics is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Register a Book with Google Analytics (MkDocs Material)

This skill registers a new MkDocs Material site as a Google Analytics 4 (GA4) property, captures the Measurement ID, writes it into mkdocs.yml, verifies the tag is injected, and commits/deploys.

Inputs to gather first

Read these from the repo and/or confirm with the user:

  • Repo path – local folder containing mkdocs.yml (e.g. ~/Documents/ws/<book>).
  • Site URL – usually site_url: in mkdocs.yml (e.g. https://dmccreary.github.io/<book>/).
  • GA settings (defaults below, override if the user says otherwise):
    • Reporting time zone: US / Chicago (GMT-05:00 Chicago Time)
    • Business size: Small – 1 to 10 employees
    • Industry category: Jobs & Education (GA4 has no literal "Education and Training" option; "Jobs & Education" is the correct closest match — use it unless told otherwise)
    • Business objective: Understand web and/or app traffic (best fit for a docs site)

Open mkdocs.yml and confirm there is no existing extra.analytics block before starting.

Step 1 — Create the GA4 property (Claude in Chrome)

Requires the Claude in Chrome extension connected and the user logged into Google Analytics.

  1. Navigate to https://analytics.google.com/analytics/web/ and wait for it to load.
  2. Open Admin → Create property (or the "Create property" card on Home). This launches a 4-step wizard: Property creation → Business details → Business objectives → Data collection.
  3. Property creation: enter the property name (match the book's site_name). Change the Reporting time zone — click the time-zone dropdown, type Chicago, select "(GMT-05:00) Chicago Time". Leave currency as USD. Click Next.
  4. Business details: open the Industry category dropdown, type Education, select Jobs & Education. Select Small - 1 to 10 employees. Click Next.
  5. Business objectives: check both the following:
    1. Understand web and/or app traffic
    2. View user engagement & retention

The action button on this step is labeled Create (not "Next") — click it to create the property.

Step 2 — Create the Web data stream and capture the Measurement ID

The number shown in the stream list (e.g. 15014865793) is the Stream ID, NOT the Measurement ID. The Measurement ID (format G-XXXXXXXXXX) only appears in the Google tag.

  1. On the Data collection step choose Web as the platform.
  2. In "Set up your web stream": set Website URL (protocol https:// + host/path, e.g. dmccreary.github.io/<book>/) and a Stream name (the book name). Leave Enhanced measurement on. Click Create & continue.
  3. The "Set up a Google tag" panel appears. Read the Measurement ID from the snippet — it appears as gtag/js?id=G-XXXXXXXXXX and gtag('config', 'G-XXXXXXXXXX').
  4. Verify the exact characters by zooming into the code block (don't trust a quick glance; 0/O, 1/I, Q/O are easy to misread). Record the G-... value.

Step 3 — Add the ID to mkdocs.yml

MkDocs Material reads analytics from extra.analytics. If an extra: block already exists, merge into it rather than adding a second extra: key (duplicate top-level keys break YAML).

yaml
extra:
  analytics:
    provider: google
    property: G-XXXXXXXXXX
  # ...keep any existing schema/social/etc. keys here...

Step 4 — Build and verify the tag (do this before deploying)

Build to a temporary directory and confirm the ID is injected into the HTML:

bash
cd <repo>
mkdocs build -q -d /tmp/site_verify        # mkdocs-material must be installed
grep -c "G-XXXXXXXXXX" /tmp/site_verify/index.html   # expect >= 1
grep -o "googletagmanager.com/gtag/js?id=G-XXXXXXXXXX" /tmp/site_verify/index.html

A non-zero count confirms Material picked up the analytics config.

Step 5 — Commit, push, deploy

bash
cd <repo>
git add mkdocs.yml
git commit -m "Add Google Analytics property G-XXXXXXXXXX to mkdocs.yml"
git push origin main
mkdocs gh-deploy      # builds and pushes the site to the gh-pages branch

After deploy, optionally confirm the live tag: curl -s https://dmccreary.github.io/<book>/ | grep -o "G-XXXXXXXXXX".

Environment notes / known limitations

These matter when running inside the Cowork sandbox (vs. the user's own terminal):

  • GitHub credentials: the Cowork Linux sandbox has no push credentials. git push and mkdocs gh-deploy (which pushes to gh-pages) will fail with "could not read Username for https://github.com". When this happens, do the GA registration, the mkdocs.yml edit, the build-verify, and the local git commit, then hand the user the exact git push / mkdocs gh-deploy commands to run in their own terminal.
  • Mount delete restrictions: the sandbox mount may forbid deleting files. This can (a) break mkdocs build into the existing site/ dir (build to a temp dir instead, as in Step 4), and (b) leave stale .git/*.lock files after a commit. If you see unable to unlink .git/HEAD.lock / index.lock, tell the user to run rm -f .git/HEAD.lock .git/index.lock .git/objects/maintenance.lock before their next git command.
  • Theme: verification requires pip install mkdocs-material if the sandbox only has base mkdocs.

Frequently asked questions

What does the Register Book Analytics AI skill do?

Wires Google Analytics 4 into an MkDocs Material site — creates a GA4 property, writes the Measurement ID into mkdocs.yml, verifies the tag, and deploys. Use when adding analytics to a textbook for the first time.

Why use Register Book Analytics on TypingMind?

Because you install it once and use it with any model. Register Book Analytics is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Register Book Analytics in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/dmccreary/ibook-skills/tree/main/skills/archived/register-book-analytics. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Register Book Analytics?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Register Book Analytics?

As many as you like. As long as a model supports skills, you can use Register Book Analytics with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Register Book Analytics AI skill free?

It is published on GitHub by dmccreary. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇