https://github.com/heimrichhannot/contao-google-tag-manager-bundle
https://github.com/heimrichhannot/contao-google-tag-manager-bundle
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/heimrichhannot/contao-google-tag-manager-bundle
- Owner: heimrichhannot
- Created: 2018-06-05T07:02:12.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-05-08T07:35:42.000Z (almost 3 years ago)
- Last Synced: 2025-06-22T02:43:10.181Z (9 months ago)
- Language: PHP
- Size: 198 KB
- Stars: 2
- Watchers: 5
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Contao Google Tag Manager Bundle


[](https://travis-ci.org/heimrichhannot/contao-google-tag-manager-bundle/)
[](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`