Register Book Analyticsのロゴ

Register Book Analytics

コミュニティ
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.

概要

公開者dmccreary
リポジトリibook-skills
スキル名register-book-analytics
スター
109
フォーク
21
同梱ファイル
指示のみ
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    dmccrearyがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Register Book Analytics」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/dmccreary/ibook-skills/tree/main/skills/archived/register-book-analytics
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

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
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでRegister Book Analyticsを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にRegister Book Analyticsを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Register Book Analyticsは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

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.

よくある質問

AIスキル「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.

TypingMindでRegister Book Analyticsを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Register Book Analyticsはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにRegister Book Analyticsをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/dmccreary/ibook-skills/tree/main/skills/archived/register-book-analyticsを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Register Book Analyticsを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Register Book Analyticsで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもRegister Book Analyticsを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Register Book Analytics」は無料ですか?

dmccrearyがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇