Download the PHP package stefandoorn/google-tag-manager-plugin without Composer
On this page you can find all versions of the php package stefandoorn/google-tag-manager-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download stefandoorn/google-tag-manager-plugin
More information about stefandoorn/google-tag-manager-plugin
Files in stefandoorn/google-tag-manager-plugin
Package google-tag-manager-plugin
Short Description Google Tag Manager plugin for Sylius.
License MIT
Informations about the package google-tag-manager-plugin
Google Tag Manager plugin for Sylius eCommerce Platform
Related plugins
- Enhanced Ecommerce plugin: allows you a smooth integration with Google Analytics Enhanced Ecommerce.
Installation
1. Composer
2. Load bundle
Add to the bundle list (config/bundles.php
):
3. Follow installation instructions of required sub bundle (https://github.com/xyNNN/GoogleTagManagerBundle)
Add to your configuration:
And also configure the features you would like to use from this plugin:
In case you set autoAppend
to false & also disable the inject
setting inside this plugin, you have to manage loading of the GTM container yourself.
In case you set autoAppend
to false & set inject
to true, be aware of the following:
Required output to your HTML (head, body & footer) are done through Sylius Twig Hooks. The following Sylius Twig Hooks are used:
sylius_shop.base.head
sylius_shop.base.header
sylius_shop.base.offcanvas
sylius_shop.base#javascripts
You can dump the default configuration using:
5. Install assets (optional: only if you want to use events feature)
Features
environment
: Send Symfony/Sylius environment to GTMroute
: Send Symfony/Sylius route to GTMcontext
: Send Sylius context information to GTM (currency, locale, channel)events
: See below - allows you to register events easily from inside HTML using JS.
Usage
Register events from JS
Make sure also to listen for this specific event inside your GTM configuration.