{"id":15172935,"url":"https://github.com/harugon/gtm","last_synced_at":"2026-01-26T19:26:14.384Z","repository":{"id":62514836,"uuid":"304636384","full_name":"harugon/Gtm","owner":"harugon","description":"MediaWikiにGoogle Tag Managerを追加します","archived":false,"fork":false,"pushed_at":"2022-06-04T21:09:20.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-12-29T09:42:37.626Z","etag":null,"topics":["google-tag-manager","mediawiki","mediawiki-extension"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/harugon.png","metadata":{"files":{"readme":"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}},"created_at":"2020-10-16T13:32:49.000Z","updated_at":"2022-05-11T11:42:12.000Z","dependencies_parsed_at":"2022-11-02T10:17:18.379Z","dependency_job_id":null,"html_url":"https://github.com/harugon/Gtm","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harugon%2FGtm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harugon%2FGtm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harugon%2FGtm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harugon%2FGtm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harugon","download_url":"https://codeload.github.com/harugon/Gtm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239686502,"owners_count":19680538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["google-tag-manager","mediawiki","mediawiki-extension"],"created_at":"2024-09-27T10:24:07.478Z","updated_at":"2026-01-26T19:26:14.378Z","avatar_url":"https://github.com/harugon.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gtm (MediaWiki Extension)\n\nMediaWiki に **Google Tag Manager (GTM)** のコンテナスニペットを追加する拡張機能です。\n\n[Google タグ マネージャー](https://tagmanager.google.com/?hl=ja#/home)\n\n![MediaWiki Google Tag Manager](https://repository-images.githubusercontent.com/304636384/d496c1b9-b259-4b2b-bb3e-318484b52dcb)\n\n\n\n## 概要\n\nこの MediaWiki 拡張は、すべてのページに **Google タグ マネージャーのコンテナスニペット**を自動挿入します。\n\n- `\u003cscript\u003e` タグは `\u003chead\u003e` 内に追加されます  \n- `\u003cnoscript\u003e` タグは `\u003cbody\u003e` の末尾に追加されます（※無効化可能）  \n- 1st-party Tag Gateway 経由の配信にも対応  \n\n\n\n## ダウンロード\n\n[Releases · harugon/Gtm](https://github.com/harugon/Gtm/releases)  \nから `Gtm-vX.X.X.tar.gz` をダウンロードし、`extensions/` フォルダに展開してください。\n\n\n\n## インストール\n\n`LocalSettings.php` に以下を追記してください。\n\n```php\nwfLoadExtension( 'Gtm' );\n\n// GTM コンテナ ID\n$wgGtmId = \"GTM-XXXXXXX\";\n\n// dataLayer に追加する MediaWiki 変数\n$wgGtmData = [\n    'wgPageName',\n    'wgUserId',\n];\n````\n\n\n\n## 設定項目\n\n| Config名                      | 説明                                             | 例                                                    |\n| ---------------------------- | ---------------------------------------------- | ---------------------------------------------------- |\n| **\\$wgGtmId**                | GTM コンテナ ID                                    | `$wgGtmId = \"GTM-XXXXXX\";`                           |\n| **\\$wgGtmBeforeTag**         | gtm.js の **上**に追加する任意タグ                        | `$wgGtmBeforeTag = \"\u003cscript\u003e/* custom */\u003c/script\u003e\";` |\n| **\\$wgGtmAfterTag**          | gtm.js の **下**に追加する任意タグ                        | `$wgGtmAfterTag = \"\u003cscript\u003e/* custom */\u003c/script\u003e\";`  |\n| **\\$wgGtmData**              | `OutputPage::getJSVars()` から dataLayer に追加するキー | `$wgGtmData = ['wgPageName','wgUserId'];`            |\n| **\\$wgGtmNoScript**          | `\u003cnoscript\u003e` タグを追加するかどうか                       | `$wgGtmNoScript = false;`                            |\n| **\\$wgGtmAttribs**           | `\u003cscript\u003e` タグの属性（連想配列で指定）                      | `$wgGtmAttribs = [\"data-cookieconsent\"=\u003e\"ignore\"];`  |\n| **\\$wgGtmTagGatewayPath**    | Google タグゲートウェイのパス（例 `/metrics`）               | `$wgGtmTagGatewayPath = \"/metrics\";`                 |\n| **\\$wgGtmTagGateway** | タグゲートウェイを有効化するかどうか（true で有効）                   | `$wgGtmTagGateway = true;`                    |\n\n\n\n## 関連資料\n\n* [Manual\\:Interface/JavaScript - MediaWiki](https://www.mediawiki.org/wiki/Manual:Interface/JavaScript/ja#All_pages_%28user/page-specific%29)\n* [Google Tag Manager 公式ヘルプ](https://support.google.com/tagmanager/)\n\n\n\n## ライセンス\n\nMIT\n\n\n\n## Author\n\n[harugon](https://github.com/harugon)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharugon%2Fgtm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharugon%2Fgtm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharugon%2Fgtm/lists"}