PHPackages                             harugon/gtm - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. harugon/gtm

ActiveMediawiki-extension

harugon/gtm
===========

Google Tag Manger

1.03(4y ago)010MITPHPPHP &gt;=7.2CI failing

Since Oct 17Pushed 8mo agoCompare

[ Source](https://github.com/harugon/Gtm)[ Packagist](https://packagist.org/packages/harugon/gtm)[ RSS](/packages/harugon-gtm/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (6)Dependencies (5)Versions (7)Used By (0)

Gtm (MediaWiki Extension)
=========================

[](#gtm-mediawiki-extension)

MediaWiki に **Google Tag Manager (GTM)** のコンテナスニペットを追加する拡張機能です。

[Google タグ マネージャー](https://tagmanager.google.com/?hl=ja#/home)

[![MediaWiki Google Tag Manager](https://repository-images.githubusercontent.com/304636384/d496c1b9-b259-4b2b-bb3e-318484b52dcb)](https://repository-images.githubusercontent.com/304636384/d496c1b9-b259-4b2b-bb3e-318484b52dcb)

概要
--

[](#概要)

この MediaWiki 拡張は、すべてのページに **Google タグ マネージャーのコンテナスニペット**を自動挿入します。

- `` タグは `` 内に追加されます
- `` タグは `` の末尾に追加されます（※無効化可能）
- 1st-party Tag Gateway 経由の配信にも対応

ダウンロード
------

[](#ダウンロード)

[Releases · harugon/Gtm](https://github.com/harugon/Gtm/releases)
から `Gtm-vX.X.X.tar.gz` をダウンロードし、`extensions/` フォルダに展開してください。

インストール
------

[](#インストール)

`LocalSettings.php` に以下を追記してください。

```
wfLoadExtension( 'Gtm' );

// GTM コンテナ ID
$wgGtmId = "GTM-XXXXXXX";

// dataLayer に追加する MediaWiki 変数
$wgGtmData = [
    'wgPageName',
    'wgUserId',
];
```

設定項目
----

[](#設定項目)

Config名説明例**$wgGtmId**GTM コンテナ ID`$wgGtmId = "GTM-XXXXXX";`**$wgGtmBeforeTag**gtm.js の **上**に追加する任意タグ`$wgGtmBeforeTag = "/* custom */";`**$wgGtmAfterTag**gtm.js の **下**に追加する任意タグ`$wgGtmAfterTag = "/* custom */";`**$wgGtmData**`OutputPage::getJSVars()` から dataLayer に追加するキー`$wgGtmData = ['wgPageName','wgUserId'];`**$wgGtmNoScript**`` タグを追加するかどうか`$wgGtmNoScript = false;`**$wgGtmAttribs**`` タグの属性（連想配列で指定）`$wgGtmAttribs = ["data-cookieconsent"=>"ignore"];`**$wgGtmTagGatewayPath**Google タグゲートウェイのパス（例 `/metrics`）`$wgGtmTagGatewayPath = "/metrics";`**$wgGtmTagGateway**タグゲートウェイを有効化するかどうか（true で有効）`$wgGtmTagGateway = true;`関連資料
----

[](#関連資料)

- [Manual:Interface/JavaScript - MediaWiki](https://www.mediawiki.org/wiki/Manual:Interface/JavaScript/ja#All_pages_%28user/page-specific%29)
- [Google Tag Manager 公式ヘルプ](https://support.google.com/tagmanager/)

ライセンス
-----

[](#ライセンス)

MIT

Author
------

[](#author)

[harugon](https://github.com/harugon)

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance42

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~117 days

Recently: every ~146 days

Total

6

Last Release

1450d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3e2b9a8d3b478fb5f5a85265bba4d2d373b1a4d5b7be6daefc6328799c23862b?d=identicon)[harugon](/maintainers/harugon)

---

Top Contributors

[![harugon](https://avatars.githubusercontent.com/u/23746312?v=4)](https://github.com/harugon "harugon (25 commits)")

---

Tags

google-tag-managermediawikimediawiki-extensionmediawikiGoogle Tag Manger

### Embed Badge

![Health badge](/badges/harugon-gtm/health.svg)

```
[![Health](https://phpackages.com/badges/harugon-gtm/health.svg)](https://phpackages.com/packages/harugon-gtm)
```

###  Alternatives

[mediawiki/semantic-media-wiki

An extension to MediaWiki that lets you store and query structured data within wiki pages

586361.8k33](/packages/mediawiki-semantic-media-wiki)[starcitizentools/citizen-skin

A beautiful, usable, responsive MediaWiki skin with in-depth extension support. Originally developed for the Star Citizen Wiki.

3164.5k](/packages/starcitizentools-citizen-skin)[mediawiki/chameleon-skin

A highly flexible MediaWiki skin using Bootstrap 4

12481.8k2](/packages/mediawiki-chameleon-skin)[mediawiki/maps

Adds various mapping features to MediaWiki

84145.0k3](/packages/mediawiki-maps)[mediawiki/semantic-result-formats

Provides additional result formats for queries using Semantic MediaWiki

51180.7k1](/packages/mediawiki-semantic-result-formats)[mediawiki/mermaid

Provides a parser function to generate diagrams and charts with the help of the mermaid script language

4660.9k1](/packages/mediawiki-mermaid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
