lektor-google-analytics
This plugin adds support for Google analytics to Lektor CMS.
Once the plugin is enabled, a generate_google_analytics() function is available to be included in target template which automatically include Google-Analytics 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-analytics = 0.1
Configuring the Plugin
The plugin needs a config file with your Google analytics code in it.
Just create a file named google-analytics.ini into ./configs folder in your Lektor project’s base directory. And, put the GOOGLE_ANALYTICS_ID key with target property ID of form UA-XXXXXXXX-Y which you obtained from:
GOOGLE_ANALYTICS_ID = UA-XXXXXXXX-Y
Using in Templates
Now you can add a Google analytics code-snippet in your templates by just calling the generate_google_analytics function inside its <body> </body> tags.
<div class="ga-script">{{ generate_google_analytics() }}</div>
That’s it. All the HTML files that rendered from that template will include Google-Analytics code automatically.
Advanced
- You can use GOOGLE_ANALYTICS_PROPERTY property to include your
custom-built Google Analytics tracking code. In that case, your ./configs/google-analytics.ini will look like this:
GOOGLE_ANALYTICS_ID = UA-XXXXXXXX-Y
GOOGLE_ANALYTICS_PROPERTY = 'my custom code'
Don’t use this property unless you know what are you doing. By default, it is set to auto.
To go deeper than this, please refer to Google-Analytics documentation.
Copyright (c) 2015, Khaled Monsoor
All rights reserved.
Licensed under BSD license.
Metadata
Release files for lektor-google-analytics 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lektor-google-analytics-0.1.3.tar.gz | 3.7 kB | Without provenance | Details for lektor-google-analytics-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lektor_google_analytics-0.1.3-py2-none-any.whl | Python 2 | none | any | Details for lektor_google_analytics-0.1.3-py2-none-any.whl |
Total release size: 9.2 kB
Release files / lektor-google-analytics-0.1.3.tar.gz
| Download URL | lektor-google-analytics-0.1.3.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3a527bc854371f4ab1aab971749824148f5d9bd18284eaa0ee0eaf7be34009fb
|
|
BLAKE2b-256 checksum How to use checksums |
3aa3f3b3557a7a6e2fc6cb05d7e5ff73bf94d6f67a5ff7e32ec4471654d735e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / lektor_google_analytics-0.1.3-py2-none-any.whl
| Download URL | lektor_google_analytics-0.1.3-py2-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
48535eb12baecd0826012b25feae5d54ffe791988115c30c663b95abe910de6a
|
|
BLAKE2b-256 checksum How to use checksums |
a54f9ed946e6539ab1874285b27698695ae1238e3438a298f445aa3d6989c2ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for lektor-google-analytics 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.