PHPackages                             hadiabedzadeh/laravel-gtm-load-logger - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. hadiabedzadeh/laravel-gtm-load-logger

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

hadiabedzadeh/laravel-gtm-load-logger
=====================================

Log the real loading status of Google Tag Manager directly into your Laravel database.

v1.0.0(4d ago)01MITPHP ^8.1

Since Jul 7Compare

[ Source](https://github.com/Hadi-Abedzadeh/Google-Tag-Manager-Load-Logger)[ Packagist](https://packagist.org/packages/hadiabedzadeh/laravel-gtm-load-logger)[ RSS](/packages/hadiabedzadeh-laravel-gtm-load-logger/feed)WikiDiscussions Synced today

READMEChangelogDependencies (4)Versions (2)Used By (0)

Laravel GTM Load Logger
=======================

[](#laravel-gtm-load-logger)

Log the real loading status of Google Tag Manager directly into your Laravel database.

This package helps you detect when GTM:

- loads successfully
- fails due to network, DNS, or AdBlock
- times out
- partially loads

It is useful for debugging analytics issues in countries where GTM may be blocked or unstable.

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

[](#installation)

```
composer require hadiabedzadeh/laravel-gtm-load-logger
```

Publish config and migration
----------------------------

[](#publish-config-and-migration)

```
php artisan vendor:publish --tag=gtm-load-logger-config
php artisan vendor:publish --tag=gtm-load-logger-migrations
php artisan migrate
```

Environment
-----------

[](#environment)

```
GTM_LOAD_LOGGER_ENABLED=true
GTM_LOAD_LOGGER_ID=GTM-W8W7BWH
GTM_LOAD_LOGGER_TIMEOUT=7000
GTM_LOAD_LOGGER_TABLE=gtm_load_logs
GTM_LOAD_LOGGER_ROUTE_PREFIX=gtm-load-logger
```

Usage
-----

[](#usage)

Put this inside your main Blade layout ``:

```
@include('gtm-load-logger::script')
```

Put this immediately after `` if you also want the normal GTM noscript fallback:

```
@include('gtm-load-logger::noscript')
```

Route
-----

[](#route)

The package automatically registers:

```
POST /gtm-load-logger/log
GET  /gtm-load-logger/log

```

Route name:

```
route('gtm-load-logger.log')
```

Logged fields
-------------

[](#logged-fields)

The package stores:

- GTM ID
- status: `success`, `partial`, `error`, `timeout`, `unknown`
- reason
- page URL
- user agent
- visitor IP
- noscript flag
- timestamps

Example SQL analytics
---------------------

[](#example-sql-analytics)

```
SELECT
    COUNT(*) AS total,
    SUM(CASE WHEN status = 'success' THEN 1 ELSE 0 END) AS success,
    SUM(CASE WHEN status  'success' OR status IS NULL THEN 1 ELSE 0 END) AS failed,
    ROUND(100.0 * SUM(CASE WHEN status = 'success' THEN 1 ELSE 0 END) / COUNT(*), 2) AS success_percent,
    ROUND(100.0 * SUM(CASE WHEN status  'success' OR status IS NULL THEN 1 ELSE 0 END) / COUNT(*), 2) AS failed_percent
FROM gtm_load_logs;
```

SQL Server table
----------------

[](#sql-server-table)

Laravel migration is recommended. If you want a manual SQL Server table:

```
CREATE TABLE [dbo].[gtm_load_logs](
    [id] [bigint] IDENTITY(1,1) NOT NULL,
    [gtm_id] [nvarchar](50) NULL,
    [status] [nvarchar](20) NOT NULL,
    [reason] [nvarchar](max) NULL,
    [url] [nvarchar](max) NULL,
    [user_agent] [nvarchar](max) NULL,
    [ip] [varchar](45) NULL,
    [noscript_enabled] [bit] NOT NULL CONSTRAINT [DF_gtm_load_logs_noscript_enabled] DEFAULT 0,
    [created_at] [datetime2](7) NULL,
    [updated_at] [datetime2](7) NULL,
    PRIMARY KEY CLUSTERED ([id] ASC)
);
```

Packagist publishing checklist
------------------------------

[](#packagist-publishing-checklist)

1. Create a GitHub repository, for example: `hadiabedzadeh/laravel-gtm-load-logger`
2. Push this package code.
3. Create a release tag:

```
git tag v1.0.0
git push origin v1.0.0
```

4. Submit the GitHub repository URL in Packagist.
5. Install it in Laravel projects:

```
composer require hadiabedzadeh/laravel-gtm-load-logger
```

License
-------

[](#license)

MIT

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance99

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

4d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f78e6ae52c73a4633d997d6fc70ce0a2e92eee062d522a234e0c9f4a5c3e7d44?d=identicon)[Hadi-Abedzadeh](/maintainers/Hadi-Abedzadeh)

---

Tags

laraveltrackingloggeranalyticsGoogle Tag Managergtmadblock

### Embed Badge

![Health badge](/badges/hadiabedzadeh-laravel-gtm-load-logger/health.svg)

```
[![Health](https://phpackages.com/badges/hadiabedzadeh-laravel-gtm-load-logger/health.svg)](https://phpackages.com/packages/hadiabedzadeh-laravel-gtm-load-logger)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58174.6k17](/packages/api-platform-laravel)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.6k30.2M148](/packages/laravel-cashier)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M134](/packages/laravel-pulse)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.6k](/packages/simplestats-io-laravel-client)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1235.9k21](/packages/fleetbase-core-api)

PHPackages © 2026

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