Logo: Register Book Analytics

Register Book Analytics

Communautéit
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.

Iwwersiicht

Editeurdmccreary
Repositoryibook-skills
Skill-Nummregister-book-analytics
Stären
109
Forks
21
Matgeliwwert Dateien
Nëmmen Instruktiounen
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    dmccreary huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Register Book Analytics an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/dmccreary/ibook-skills/tree/main/skills/archived/register-book-analytics
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

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
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Register Book Analytics an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Register Book Analytics automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Register Book Analytics net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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.

Heefeg gestallte Froen

Wat mécht de KI-Skill 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.

Firwat Register Book Analytics op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Register Book Analytics besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Register Book Analytics an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/dmccreary/ibook-skills/tree/main/skills/archived/register-book-analytics an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Register Book Analytics benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Register Book Analytics benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Register Book Analytics domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Register Book Analytics gratis?

dmccreary huet de Skill op GitHub publizéiert. Kuckt am Repository no de Lizenzbedéngungen. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇