Download the PHP package helick/gtm without Composer
On this page you can find all versions of the php package helick/gtm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package gtm
Helick Google Tag Manager
Google Tag Manager integration.
Requirements
Make sure all dependencies have been installed before moving on:
Install
Install via Composer:
Update your application config by declaring the following:
Update your env variables by declaring the following:
Usage
To support the fallback iframe for devices without javascript add the following code just after the opening <body>
tag in your theme:
Data layer
Google Tag Manager offers a data layer 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.
Event tracking
To deactivate the event tracking you may declare the following:
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:
Contributing
Please see CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Evgenii Nasyrov
- All Contributors
License
The MIT License (MIT). Please see License File for more information.