Skip to content

Google Tag Manager tracking module for Laravel

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
license.md
Notifications You must be signed in to change notification settings

Cyber-Duck/Laravel-Google-Tag-Manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚨 Discontinued 🚨

Please consider using https://github.com/spatie/laravel-googletagmanager.

Laravel Google Tag Manager

Latest Stable Version Total Downloads License

Google tag manager features including events, ecommerce, and dataLayer support

Authors: Andrew Mc Cormack, Simone Todaro

Installation

Composer

Require this package with composer:

composer require cyber-duck/laravel-google-tag-manager

Framework

Add the following to the list of service providers in your config/app.php file

'CyberDuck\LaravelGoogleTagManager\GTMServiceProvider',

Add the following alias to your config/app.php file

'GTM' => 'CyberDuck\LaravelGoogleTagManager\Facades\GTM',

Publish configuration file:

php artisan vendor:publish --provider="CyberDuck\LaravelGoogleTagManager\GTMServiceProvider"

Configure your GTM-XXXXX ID in config/gtm.php

Usage

Within your main blade layout template include the GTM blade template

@include('tracking::gtm')

Pushing additional data

\GTM::data('paramName', 'paramValue')

Pushing an event

\GTM::event('eventName')

Flashing data for the next request

\GTM::flash()
return redirect()->action('...');

Enhanced Ecommerce

Coming soon!!!