Download the PHP package norsys/google-tag-manager-bundle without Composer

On this page you can find all versions of the php package norsys/google-tag-manager-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package google-tag-manager-bundle

Google Tag Manager Bundle

Package version Total Downloads Build Status Scrutinizer Coverage Scrutinizer Code Quality License

SensioLabsInsight

This project is a bundle which eases the configuration and handling of Google Tag Manager.

It provides a bunch of base classes to extend from.

Installation

Step 1: Add the repository & download the Bundle

Open a command console, enter your project directory and execute the following commands:

This command requires you to have composer installed globally, as explained in the installation chapter of the Composer documentation.

Step 2: Register the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php file of your project:

Step 3: Configuration & Implementation

The GTM bundle allows you to define google tag manager parameters, providing a default values management.

Basic integration

Template integration

To ease quick integration, the bundle provides a twig partial and a javascript file to include in your template:

Example:

Controlling GTM loading

By default, GoogleTagManager is initialized at the point the javascript file is included.

You can also tied it to a specific DOM event:

DataLayer configuration

The GoogleTagManager Bundle handles 2 distinct types of parameters:

Static parameters

Here is a very basic config example:

The bundle will merge defaults and per-route static parameters, and issue the resulting data layer.

The dataLayer sent for the page responding to the faq route will be:

Dynamic parameters

On some situations, it can be useful to have some parameters value changing dynamically upon the context.

For this purpose, the bundle provides support for dynamic parameters.

Each dynamic parameter consists of a service implementing NorsysGoogleTagManagerBundle\Dynamic\ParameterInterface.

The custom dynamic parameter class will have to implement the 2 following methods:

Each dynamic parameter class refered to in the bundle config must be registered, hence declared using the appropriate tag:

Now we can use the parameter in the bundle config, referencing to it via the alias defined by its getName() method.

Even if rarely ever needed for most cases, it is possible to pass the parameter an initialization string, and then fetch it in the associated service.

As an example, let's say we want to pass a C-like template string:

We can then easily fetch this init value for further processing inside the getValue() method:

Dynamic parameters can also be overriden, on a per-route basis:

Dynamic parameters aliases

Additionnally this bundle also supports aliases for dynamic parameters.

Let's consider using an alias of the previously created acmeDynamicParam:

Now we can use the aliased name to refer directly to its target:

Conclusion

Now, taking for granted the 2 above static and dynamic configured parameters, the resulting generated dataLayer for the faq route would be something like:

Credits

Developped by :heart: with Norsys

License

This project is licensed under the MIT license.


All versions of google-tag-manager-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
symfony/dependency-injection Version ^3.1.0
symfony/config Version ^3.1.0
symfony/http-kernel Version ^3.1.0
twig/extensions Version ^1.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package norsys/google-tag-manager-bundle contains the following files

Loading the files please wait ....