Basic extension to add google analytics tracking code in page header
Project description
ckanext-googleanalyticsbasic
Puts the Google Analytics asynchronous tracking code into your page headers for basic Google Analytics page tracking.
Installation
-
Install the extension as usual, e.g. (from an activated virtualenv) ::
$ pip install -e git+https://github.com/GSA/ckanext-googleanalyticsbasic#egg=ckanext-googleanalyticsbasic
-
Edit your development.ini (or similar) to provide space separated list of google ids ::
googleanalytics.ids = UA-1010101-1 UA-1010101-2
-
Edit again your configuration ini file to activate the plugin with: ::
ckan.plugins = googleanalyticsbasic
Compatibility
This extension is compatible with these versions of CKAN.
CKAN version | Compatibility |
---|---|
<=2.8 | no |
2.9 | yes |
Tests
All the tests live in the /ckanext/geodatagov/tests folder.
Using the Docker Dev Environment
Build Environment
To start environment, run:
docker-compose build
docker-compose up
CKAN will start at localhost:5000
To shut down environment, run:
docker-compose down
To docker exec into the CKAN image, run:
docker-compose exec app /bin/bash
Testing
They follow the guidelines for testing CKAN extensions.
To run the extension tests, start the containers with make up
, then:
$ make test
Lint the code.
$ make lint
Matrix builds
The development environment drops as many dependencies as possible. It is not meant to have feature parity with GSA/catalog.data.gov. Tests should mock external dependencies where possible.
In order to support multiple versions of CKAN, or even upgrade to new versions
of CKAN, we support development and testing through the CKAN_VERSION
environment variable.
$ make CKAN_VERSION=2.9 test
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
Hashes for ckanext-googleanalyticsbasic-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5266b4f1e8f6df86a813624f5e5e0bd0896954195dfce6aae0744e23a4887e6d |
|
MD5 | ee36855ce92eac0e8ff81bf899e336de |
|
BLAKE2b-256 | 9d2ce68c81303d0923f8db08a2d8f6526c200067ac6ac5835c4c7dc9ef79e007 |
Hashes for ckanext_googleanalyticsbasic-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3614597661d92996bd788643cb2a04166e8cd25b3d44d01d5a05536e9c55bd3b |
|
MD5 | 75893ea249b39ab2135cdbb006e98370 |
|
BLAKE2b-256 | 2899a923beb6200b72045a849c5f81c415c922ef327646b6619e793a8221cc1d |