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. [Utility &amp; Helpers](/categories/utility)
4. /
5. harugon/gtm

ActiveMediawiki-extension[Utility &amp; Helpers](/categories/utility)

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

Google Tag Manger

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

Since Oct 17Pushed 10mo agoCompare

[ Source](https://github.com/harugon/Gtm)[ Packagist](https://packagist.org/packages/harugon/gtm)[ RSS](/packages/harugon-gtm/feed)WikiDiscussions master Synced 3w 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

28

—

LowBetter than 52% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity54

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

1497d 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

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.5k10](/packages/helsingborg-stad-municipio)[mediawiki/maps

Adds various mapping features to MediaWiki

84152.3k3](/packages/mediawiki-maps)[starcitizentools/citizen-skin

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

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

A highly flexible MediaWiki skin using Bootstrap 5

12585.7k2](/packages/mediawiki-chameleon-skin)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

19251.4k3](/packages/civicrm-civicrm-drupal-8)[altis/core

Core module for Altis

19228.0k3](/packages/altis-core)

PHPackages © 2026

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