PHPackages                             helick/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. helick/gtm

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

helick/gtm
==========

The Helick Google Tag Manager plugin

v1.2.0(6y ago)1169[1 issues](https://github.com/helick/gtm/issues)MITPHPPHP &gt;=7.1

Since Jul 31Pushed 6y agoCompare

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

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

Helick Google Tag Manager
=========================

[](#helick-google-tag-manager)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b931657c4c7dd11b5a5dda76b78a13d017e0fce1ac483e95a1c3a7c0b915ce24/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68656c69636b2f67746d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/helick/gtm)[![Total Downloads](https://camo.githubusercontent.com/ef1af35e5c9922725e70a94698f654b81e71a88c03a15225b1b406e4bb00e817/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f68656c69636b2f67746d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/helick/gtm)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Quality Score](https://camo.githubusercontent.com/1d4b624647616caf2d476902861a04426ef4aca8050756e3ed1215228ac81753/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f68656c69636b2f67746d2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/helick/gtm)

Google Tag Manager integration.

Requirements
------------

[](#requirements)

Make sure all dependencies have been installed before moving on:

- [PHP](http://php.net/manual/en/install.php) &gt;= 7.1
- [Composer](https://getcomposer.org/download/)

Install
-------

[](#install)

Install via Composer:

```
$ composer require helick/gtm
```

Update your application config by declaring the following:

```
Config::define('GTM_CONTAINER_ID', env('GTM_CONTAINER_ID'));
```

Update your env variables by declaring the following:

```
GTM_CONTAINER_ID=GTM-XXXX
```

Usage
-----

[](#usage)

To support the fallback iframe for devices without javascript add the following code just after the opening `` tag in your theme:

```

```

### Data layer

[](#data-layer)

Google Tag Manager offers a [data layer](https://developers.google.com/tag-manager/devguide) which allows you pass arbitrary data that can be used to modify which tags are added to your site.

This plugin adds some default information such as post, tags and categories and provides a simple filter for adding in your own custom data.

```
add_filter('helick_gtm_data_layer', function (array $dataLayer) {
    $dataLayer['foo'] = 'bar';

    return $dataLayer;
});
```

### Event tracking

[](#event-tracking)

To deactivate the event tracking you may declare the following:

```
add_filter('helick_gtm_enable_event_tracking', '__return_false');
```

By default the event listener script will look for the elements on the page with special data attributes in your markup and listen for the specified event to push to the data layer.

The data attributes are:

- `data-gtm-variable` *string* Optionally override the default data layer variable name for this event.
- `data-gtm-on` *enum* \[click|submit|keyup|focus|blur\] The JS event to listen for, defaults to 'click'.
- `data-gtm-event` *string* The event name.
- `data-gtm-category` *string* Optional group the event belongs to.
- `data-gtm-label` *string* Optional human readable label for the event.
- `data-gtm-value` *number* Optional numeric value associated with the event.
- `data-gtm-fields` *string* Optional extra data provided as encoded JSON.

Example:

```

  Play video

```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Evgenii Nasyrov](https://github.com/nasyrov)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

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 ~7 days

Total

4

Last Release

2457d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2d5180ba0cd30309ada4562457c6337069906fea97f827f1c24b82fddb1bdc9a?d=identicon)[nasyrov](/maintainers/nasyrov)

---

Tags

composerwordpresswordpress-pluginwordpressGoogle Tag Managerhelick

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[roots/bedrock

WordPress boilerplate with Composer, easier configuration, and an improved folder structure

6.5k441.8k2](/packages/roots-bedrock)[cedaro/gravity-forms-iframe

Embed a Gravity Form on any site using an iframe.

1563.0k](/packages/cedaro-gravity-forms-iframe)

PHPackages © 2026

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