Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/heimrichhannot/contao-google-tag-manager-bundle
https://github.com/heimrichhannot/contao-google-tag-manager-bundle
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/heimrichhannot/contao-google-tag-manager-bundle
- Owner: heimrichhannot
- Created: 2018-06-05T07:02:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-05-08T07:35:42.000Z (over 1 year ago)
- Last Synced: 2024-10-02T06:52:03.142Z (3 months ago)
- Language: PHP
- Size: 198 KB
- Stars: 2
- Watchers: 6
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Contao Google Tag Manager Bundle
![](https://img.shields.io/packagist/v/heimrichhannot/contao-google-tag-manager-bundle.svg)
![](https://img.shields.io/packagist/dt/heimrichhannot/contao-google-tag-manager-bundle.svg)
[![](https://img.shields.io/travis/heimrichhannot/contao-google-tag-manager-bundle/master.svg)](https://travis-ci.org/heimrichhannot/contao-google-tag-manager-bundle/)
[![](https://img.shields.io/coveralls/heimrichhannot/contao-google-tag-manager-bundle/master.svg)](https://coveralls.io/github/heimrichhannot/contao-google-tag-manager-bundle)## Setup
1. Install with composer or contao manager
composer require heimrichhannot/contao-google-tag-manager-bundle
1. Update your database
1. Adjust your fe_page template
* Add `= $this->googleTagManagerHead ?>` to your head section
* Add `= $this->googleTagManagerBody ?>` to before the body closing tag## Advanced usage
### add data layer variables to a page
`System::getContainer()->get('huh.google_tag_manager.data_layer')->setContent(['key' => 'value']);`
### add an a tag with data layer event handler
`System::getContainer()->get('huh.google_tag_manager.tag_manager')->getLink(class, link, linkText, ['event': 'button1-click'])`
This will output: `linkText`