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

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

awcodes/gtm
===========

Easy integration of Google Tag Manager into your Laravel application.

v2.0.0(1y ago)51.1kMITPHPPHP ^8.2CI passing

Since Dec 12Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/awcodes/gtm)[ Packagist](https://packagist.org/packages/awcodes/gtm)[ Docs](https://github.com/awcodes/gtm)[ GitHub Sponsors](https://github.com/awcodes)[ RSS](/packages/awcodes-gtm/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (8)Versions (6)Used By (0)

Google Tag Manager for Laravel
==============================

[](#google-tag-manager-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/0502bf15f67011923730186c1874c38c085600ba40234163fbaceb5e70317057/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6177636f6465732f67746d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/awcodes/gtm)[![Total Downloads](https://camo.githubusercontent.com/9eea5fe013496ead608f2f6632f4d6e9660ec013416f778a36edcc4a5161ef1d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6177636f6465732f67746d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/awcodes/gtm)

Easy integration of Google Tag Manager into your Laravel application.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require awcodes/gtm
```

You can publish the config file with:

```
php artisan vendor:publish --tag="gtm-config"
```

This is the contents of the published config file:

```
return [
    'id' => env('GTM_ID', 'GTM-XXXXXX'),
    'enabled' => env('GTM_ENABLED', true),
];
```

Optionally, you can publish the views using

```
php artisan vendor:publish --tag="gtm-views"
```

Usage
-----

[](#usage)

1. Add your GTM\_ID to your `.env` file
2. Simply add the blade components to your base layout files.

The `enabled` attribute is optional, but can be used to control the tags integration from blade files that extend the base layout. It accepts `true/false`. This can still be controlled globally via the `.env` file should you need to disable the integration global on different environments as well.

```

```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [awcodes](https://github.com/awcodes)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance71

Regular maintenance activity

Popularity23

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Total

3

Last Release

383d ago

Major Versions

v1.1.0 → v2.0.02025-04-30

PHP version history (2 changes)v1.0.0PHP ^8.1

v2.0.0PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3596800?v=4)[Adam Weston](/maintainers/awcodes)[@awcodes](https://github.com/awcodes)

---

Top Contributors

[![awcodes](https://avatars.githubusercontent.com/u/3596800?v=4)](https://github.com/awcodes "awcodes (17 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (16 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (9 commits)")

---

Tags

laravelGoogle Tag Managergtmawcodes

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[awcodes/filament-table-repeater

A modified version of the Filament Forms Repeater to display it as a table.

262815.1k5](/packages/awcodes-filament-table-repeater)[awcodes/filament-badgeable-column

Filament Tables column to append and prepend badges.

142419.3k3](/packages/awcodes-filament-badgeable-column)[awcodes/mason

A simple block based drag and drop page / document builder field for Filament.

2279.6k4](/packages/awcodes-mason)[awcodes/drop-in-action

A form component for Filamentphp allowing actions inside of forms.

8656.0k](/packages/awcodes-drop-in-action)[awcodes/light-switch

Plugin to add theme switching (light/dark/system) to the auth pages for Filament Panels

4789.9k2](/packages/awcodes-light-switch)[awcodes/recently

Easily track and access recently viewed records in your filament panels.

4224.3k](/packages/awcodes-recently)

PHPackages © 2026

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