{"id":19623856,"url":"https://github.com/appleple/acms-google-analytics4","last_synced_at":"2026-02-14T19:04:01.913Z","repository":{"id":66341119,"uuid":"531828555","full_name":"appleple/acms-google-analytics4","owner":"appleple","description":"Google Analytics 4（GA4）と連携するための拡張アプリです。","archived":false,"fork":false,"pushed_at":"2026-01-22T09:33:16.000Z","size":10112,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-01-22T23:11:24.430Z","etag":null,"topics":["a-blog-cms","google-analytics-4"],"latest_commit_sha":null,"homepage":"https://developer.a-blogcms.jp/blog/custom/google-analytics4.html","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appleple.png","metadata":{"files":{"readme":"docs/README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-02T07:38:14.000Z","updated_at":"2026-01-22T09:33:18.000Z","dependencies_parsed_at":"2024-01-22T03:48:12.941Z","dependency_job_id":null,"html_url":"https://github.com/appleple/acms-google-analytics4","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/appleple/acms-google-analytics4","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleple%2Facms-google-analytics4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleple%2Facms-google-analytics4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleple%2Facms-google-analytics4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleple%2Facms-google-analytics4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appleple","download_url":"https://codeload.github.com/appleple/acms-google-analytics4/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleple%2Facms-google-analytics4/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29452614,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["a-blog-cms","google-analytics-4"],"created_at":"2024-11-11T11:35:53.061Z","updated_at":"2026-02-14T19:04:01.906Z","avatar_url":"https://github.com/appleple.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Analytics 4\nGoogle Analytics 4（GA4）と連携するための拡張アプリです。\n\n## 動作環境\n\n- a-blog cms: Ver. 3.2.x (3.3+ not tested yet)\n- PHP: 8.1 – 8.4 (8.5+ not tested yet)\n- BC Math （PHP Extension）\n\n## ダウンロード\n\n[Google Analytics 4](https://github.com/appleple/acms-google-analytics4/raw/master/build/GoogleAnalytics4.zip)\n\n## インストール方法\n\n拡張アプリをダウンロード後、zipファイルを解凍して `extension/plugins/`に設置します。\n\n設置が完了すると、「管理画面 \u003e 拡張アプリ」に`GoogleAnalytics4`という名前で拡張アプリが表示されるので、インストールをクリックしインストールします。\n\n\n## 事前準備\nGoogle Analytics 4 拡張アプリを使用して Google Analytics 4 と連携するためには Google Cloud Platform と Google Analytics 4 それぞれでいくつか準備が必要になります。\n\n### 1. Google Cloud Platform\n\n#### 1-1. プロジェクトの作成\n\n[Google Cloud Platform](https://console.cloud.google.com/)からプロジェクトを作成します。作成手順は[公式のガイド](https://cloud.google.com/resource-manager/docs/creating-managing-projects?hl=ja)を参考にしてください。\n\n#### 1-2. Google Analytics Data API を有効にする\n\nGoogle Cloud Platform のダッシュボード \u003e API とサービス \u003e API ライブラリ より **Google Analytics Data API** を有効にします。\n\n#### 1-3. サービス アカウントを作成する\n\n[公式のガイド](https://cloud.google.com/iam/docs/creating-managing-service-accounts#creating)を参考にサービスアカウントを作成します。\n\n#### 1-4. サービス アカウント キーを作成・ダウンロードする\n\n[公式のガイド](https://cloud.google.com/iam/docs/creating-managing-service-account-keys#creating)を参考にサービス アカウント キーを作成してダウンロードします。\n\n### 2. Google Analytics 4\n[Google Analytics 4](https://www.google.com/analytics/web/?hl=ja) \u003e 管理 \u003e プロパティのアクセス管理 を開き、ユーザーを追加します。\n\nこのとき、メールアドレスは先程 Google Cloud Platform で追加したサービスアカウントのメールアドレスを設定します。また、アクセス権は「閲覧者」以上を設定してください。\n\n## 使用方法\n\n### Service Account Key を設定する\n\n拡張アプリがインストールされ、有効化されると、a-blog cms の管理画面の拡張メニューに GoogleAnalytics4 という項目が表示されるようになります。こちらから Google Analytics 4 拡張アプリの設定ページに移動することができます。\n\nGoogle Analytics 4 拡張アプリの設定ページにて、Google Cloud Platform で発行した JSON ファイルのパスを入力して保存します。\n\n### GoogleAnalytics4_Ranking モジュールを設置する\n\n以下スニペットを参考に、テンプレートにGoogleAnalytics4_Ranking モジュールを設置します。\n\n```html\n\u003c!-- BEGIN_MODULE GoogleAnalytics4_Ranking --\u003e\n  \u003c!-- BEGIN notFound --\u003e\n  \u003cp\u003eNot Found.\u003c/p\u003e\n  \u003c!-- END notFound --\u003e\n\n  \u003c!-- BEGIN error --\u003e\n  \u003cp\u003eエラーが発生したためランキングを取得できませんでした。\u003c/p\u003e\n  \u003c!-- END error --\u003e\n\n  \u003cul\u003e\u003c!-- BEGIN ranking:loop --\u003e\n    \u003cli\u003e\n      \u003ca href=\"{path}\"\u003e[{views} views] {title}\u003c/a\u003e\n    \u003c/li\u003e\u003c!-- END ranking:loop --\u003e\n  \u003c/ul\u003e\n\u003c!-- END_MODULE GoogleAnalytics4_Ranking --\u003e\n```\n\n### モジュールIDを設定する\n\nモジュールIDの設定を行います。GoogleAnalytics4_Ranking モジュールでは Property ID, 表示件数, 集計開始日, 集計終了日, 絞り込み条件 などが設定できます。\n\nProperty ID に、Google Analytics4で作成した [Property ID](https://support.google.com/analytics/answer/9304153#property) を設定することで、設定したプロパティのデータを表示することが可能です。\n\n## モジュールについて\n\nGoogle Analytics 4 拡張アプリをインストールすることで利用できるモジュールについて説明します。\n### GoogleAnalytics4_Ranking モジュール\n\nGoogleAnalytics4_Ranking モジュールは、ディメンションに `pageTitle` と `pagePath` を指定し、メトリクス（指標）に `screenPageViews` を指定し取得したデータを表示するモジュールです。\n\n絞り込み条件には、↑の条件で指定できる項目を指定する必要がありますのでご注意ください。\n\n例えば、↓画像のように設定することで、ランキングに表示するコンテンツを詳細ページのみに限定する事ができます。\n\n![ランキングに表示するコンテンツを詳細ページのみに限定する設定](images/dimension-filters-example.png)\n\n## 同梱のサンプルテーマについて\n\nthemesディレクトリには、Google Analytics 4 拡張アプリの実装例を通じて拡張アプリの使い方を学ぶことができるサンプルテーマが同梱されています。是非参考にしてみてください。\n\n## トラブルシューティング\n\n### Error occurred during parsing: Fail to push limit. エラーが発生する\n\nFTPソフトなどを活用して本拡張アプリをサーバーにアップロードしている場合、転送モードの設定によってはアップロード時にファイルが破損してしまい以下のエラーが発生する場合があります。\n\n```sh\nError occurred during parsing: Fail to push limit. in /path/to/extension/plugins/GoogleAnalytics4/vendor/google/protobuf/src/Google/Protobuf/Internal/CodedInputStream.php line: 339\n```\n\nその場合、FTPソフトの転送モードの設定を「バイナリ」モードに設定し、拡張アプリを再アップロードしてください。\n\n\n### Unable to read the credential file specified by GOOGLE_APPLICATION_CREDENTIALS: file Service Account Key does not exist in エラーが発生する\n\nGoogleAnalytics4 設定で設定するService Account Key（JSON）のパスが間違っています。Service Account Key（JSON）のパスはサーバーのルートディレクトリからのパスを設定してください。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappleple%2Facms-google-analytics4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappleple%2Facms-google-analytics4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappleple%2Facms-google-analytics4/lists"}