Adds support for Google Tag Manager to Lektor CMS
Project description
This plugin adds support for Google Tag Manager <http://www.google.com/analytics/tag-manager//> to Lektor CMS <https://github.com/lektor/lektor>.
Once the plugin is enabled, a generate_google_tag_manager() function is available to be included in target template which automatically include Google Tag Manager code in final HTML files rendered by Lektor.
Basic Usage
Enabling the Plugin
To enable the plugin add this to your project file:
[packages]
lektor-google-tag-manager = 0.1
Configuring the Plugin
The plugin needs a config file with your Google Tag Manager code in it.
Just create a file named google-tag-manager.ini into ./configs folder in your Lektor project’s base directory. And, put the GOOGLE_TAG_MANAGER_ID key with target property ID of form GTM-XXXXXX which you obtained from:
GOOGLE_TAG_MANAGER_ID = GTM-XXXXXX
Using in Templates
Now you can add a Google Tag Manager code-snippet in your templates by just calling the generate_google_tag_manager function in its <body></body> tag as below.
<div class="gtm-script">{{ generate_google_tag_manager() }}</div>
That’s it. All the HTML files that rendered from that template will include Google Tag Manager code automatically.
License
This plugin is released under the BSD license. For more information read the License.
Acknowledgements
This plugin is inspired by lektor-google-analytics
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file lektor-google-tag-manager-0.1.tar.gz
.
File metadata
- Download URL: lektor-google-tag-manager-0.1.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f495de502302a192e0656278ffd97d8783625742286ad9ae37b249a2d0afac35 |
|
MD5 | 1a99a33dcad00d930554ccb338ba4a05 |
|
BLAKE2b-256 | 61776bd3ee482e9ebef5e8cb1bc06f7c9c69912688ac7e996b4aafeca95ca281 |
File details
Details for the file lektor_google_tag_manager-0.1-py2-none-any.whl
.
File metadata
- Download URL: lektor_google_tag_manager-0.1-py2-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 852b7f240193d7fbddb1dd722a717de0c2f48a9c7d5add9a6465e4578c193f5f |
|
MD5 | 9a714f9622c34f4cdb4e32a03c4b1404 |
|
BLAKE2b-256 | 7bac5b9236b909ad482721d49cafd9f35c7d07baf2400f81ca9ee3b60c18d151 |