Логотип Connect Ga4

Connect Ga4

Организация
Senuto
connect-ga4

Step-by-step guide to connect Google Analytics 4 so you can use fetch-ga4.js and GA4 data (pageviews, sessions, events, traffic sources). Use when user says "connect GA4," "set up Google Analytics," "GA4 setup," "connect Analytics," or "how to connect to GA4." No API cost — setup only.

Обзор

ИздательSenuto
Репозиторийnodeshub-seo-skills
Название навыкаconnect-ga4
Звёзды
41
Форки
7
Файлы в комплекте
1
Ссылки
  • Инструкции в формате Markdown

    Модель загружает файл SKILL.md по мере необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой большой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

  • Файлы в комплекте: 1

    Скрипты, шаблоны и справочные материалы, которые модель может читать во время работы. Файлы доступны только для чтения и никогда не выполняются.

  • Открытый исходный код

    Издатель навыка на GitHub — Senuto. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Connect Ga4 в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/Senuto/nodeshub-seo-skills/tree/main/.claude/skills/connect-ga4
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Добавить навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
2

Установка в другом агенте

Любой агент с поддержкой формата Agent Skills может использовать этот навык — скопируйте папку в каталог навыков этого агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Senuto/nodeshub-seo-skills.git /tmp/nodeshub-seo-skills
mkdir -p .claude/skills
cp -r /tmp/nodeshub-seo-skills/.claude/skills/connect-ga4 .claude/skills/connect-ga4
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык Connect Ga4 в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык Connect Ga4, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык Connect Ga4 не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими ключами API.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

Connect with GA4

First action: Run the banner so the blue logo and skill name appear in the terminal:

bash
python3 -c "import sys; sys.path.insert(0,'.claude/skills/nod-nodeshub-api/scripts'); from banner import print_banner; print_banner('Connect GA4')"

Then walk the user through connecting Google Analytics 4 so they can run npm run fetch-ga4 and use analytics data. Do it step by step, asking for confirmation before continuing.

⛔ CRITICAL SECURITY RULE — NEVER ASK THE USER TO PASTE CREDENTIALS INTO CHAT

Anything the user types into the chat leaves their machine — it's sent to the LLM provider, written to local session logs (~/.claude/projects/<slug>/*.jsonl) in plain text, and may appear in telemetry, backups, or IDE sync. This applies to the contents of the JSON key file (the private key inside it is a secret). It also applies to the Service Account client_email — while that email alone is not critical, combined with the private key in logs/backups it lets the holder call Google APIs under the user's project.

You MUST:

  • Never ask the user to paste the contents of ga4-credentials.json into chat.
  • Never ask the user to paste the client_email into chat. Read it yourself from local/ga4-credentials.json once the user saves the file there (see Step 4).
  • The GA4 Property ID is a non-sensitive numeric ID and may be pasted if the user wants — but it's also fine to write it directly to scripts/fetch-ga4.js themselves.
  • If the user pastes the key file contents anyway, stop, refuse to use it, tell them to revoke that Service Account key in Google Cloud Console (IAM & Admin → Service Accounts → Keys → delete the leaked key) and create a new one before continuing.

Privacy: The key file local/ga4-credentials.json is stored in a gitignored path. Tell the user: do not make this repo public if it contains the file — keep the repo private or ensure sensitive files stay out of version control.


Step 0: Check if GA4 is already connected

First, check whether the GA4 credentials file exists:

  • If local/ga4-credentials.json exists: GA4 is already set up for this repo. Ask the user: "GA4 is already connected (credentials file present). Do you want to change the current integration (replace with a different Service Account) or add another GA4 property/credentials? (Reply: change / add another / no, I'm done.)"
    • If they say change → continue with Step 1 (they will create a new Service Account and replace local/ga4-credentials.json).
    • If they say add another → explain that the current script uses one credentials file; adding another property usually means using the same Service Account and updating the property ID, or they can replace the file to point at a different project. Then continue from Step 4 or Step 5 as needed.
    • If they say no, I'm done → confirm and stop.
  • If the file does not exist: no integration yet → continue with Step 1.

Step 1: Google Cloud project and API

  1. Ask the user to open Google Cloud Console (not Analytics).
  2. Tell them: create or select a project (top bar).
  3. In the left menu: APIs & Services → Library. Search for Google Analytics Data API → open it → Enable.

Ask: "Have you enabled the Google Analytics Data API? Reply yes when done."


Step 2: Service Account

  1. In Google Cloud Console: APIs & Services → Credentials.
  2. Create Credentials → Service Account.
  3. Service account name: e.g. ga4-reader. Click Create and Continue. (No role needed — skip optional steps, then Done.)
  4. Open the new Service Account (click its name). Go to the Keys tab.
  5. Add Key → Create new key → JSON → Create. A JSON file will download.

Ask: "Have you downloaded the JSON key file? Reply yes when done."


Step 3: Save the key file in the repo

  1. Tell the user to create the folder local/ in the repo root if it does not exist.
  2. Save the downloaded JSON file as:
    local/ga4-credentials.json
  3. Remind them: local/ is in .gitignore, so the file will not be committed. Do not make the repo public — it now contains a private credentials file (even though it is gitignored, keeping the repo private is safer).

Ask: "Have you saved the file as local/ga4-credentials.json? Reply yes when done."


Step 4: Read the Service Account email from the file

Once the user confirms the key file is at local/ga4-credentials.json, read the client_email yourself — do not ask the user to paste it:

bash
python3 -c "import json; print(json.load(open('local/ga4-credentials.json'))['client_email'])"

Show the email to the user and tell them they will paste it into Google Analytics in the next step (that's a Google UI field, not this chat).


Step 5: Add the Service Account in Google Analytics

  1. Ask the user to open Google Analytics (analytics.google.com, not Cloud Console).
  2. Select the property (GA4 property) they want to connect.
  3. Open Admin (gear icon, bottom left) → Property access management.
  4. Click the + button → Add users.
  5. They should paste the Service Account email (the one from Step 4) into the email field.
  6. Role: Viewer (sufficient for read-only data access).
  7. Click Add.

Ask: "Have you added the Service Account as a user in GA4? Reply yes when done."


Step 6: Get the GA4 Property ID

  1. Ask the user to stay in Google Analytics.
  2. Open Admin → Property settings → Property details.
  3. Copy the Property ID (a numeric ID, e.g. 1234567890).
  4. Ask them to paste the Property ID here.

When they paste it, update scripts/fetch-ga4.js → CONFIG.propertyId with the value.


Step 7: Verify

Run:

bash
npm install
npm run fetch-ga4

If they use a different property or paths, point them to edit scripts/fetch-ga4.js (CONFIG.propertyId, CONFIG.outputDir). Data is written to knowledge/metrics/analytics/ by default.

Ask: "Did npm run fetch-ga4 run without errors? If you see any error, paste it here."


Summary

  • Google Cloud Console (console.cloud.google.com): enable Google Analytics Data API, create Service Account, download JSON key.
  • Google Analytics (analytics.google.com): add the Service Account email as a Viewer, note the Property ID.
  • Key file in repo: local/ga4-credentials.json (gitignored). Keep the repo private — do not publish it publicly when it contains credentials.

For more detail (e.g. metrics, dimensions, filters), see the scripts/fetch-ga4.js script or the Google Analytics Data API docs.

Файлы в комплекте

Модель читает эти файлы по мере необходимости, пока навык загружен. Они доступны только для чтения и никогда не выполняются.

Часто задаваемые вопросы

Что делает навык ИИ Connect Ga4?

Step-by-step guide to connect Google Analytics 4 so you can use fetch-ga4.js and GA4 data (pageviews, sessions, events, traffic sources). Use when user says "connect GA4," "set up Google Analytics," "GA4 setup," "connect Analytics," or "how to connect to GA4." No API cost — setup only.

Зачем использовать Connect Ga4 в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. Connect Ga4 — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить Connect Ga4 в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/Senuto/nodeshub-seo-skills/tree/main/.claude/skills/connect-ga4. TypingMind прочитает файл SKILL.md, включит сопутствующие файлы в пакет и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать Connect Ga4?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать Connect Ga4?

С любым количеством. В TypingMind вы можете использовать Connect Ga4 с любой моделью, которая поддерживает навыки, в том числе с GPT, Claude, Gemini, Grok, DeepSeek, Mistral и Llama. Для этого вы используете собственные ключи API.

Бесплатен ли навык ИИ Connect Ga4?

Навык опубликован на GitHub. Издатель — Senuto. Условия лицензии можно найти в репозитории. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это набор инструкций, которыми модель ИИ может пользоваться каждый раз, когда ей нужно выполнить конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты, которые она может вызывать: при вызове где-то выполняется код и возвращает результат. Навык ИИ, напротив, даёт модели знания и описывает порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все

Создайте своё рабочее пространство с ИИ прямо сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇