chore: update version
This commit is contained in:
parent
cf75e577cb
commit
b6b3f91936
|
@ -15,6 +15,7 @@ log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def tracking_id():
|
def tracking_id():
|
||||||
|
# type: () -> str
|
||||||
return tk.config["googleanalytics.id"]
|
return tk.config["googleanalytics.id"]
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,6 +32,7 @@ def download_handler():
|
||||||
|
|
||||||
|
|
||||||
def tracking_mode():
|
def tracking_mode():
|
||||||
|
# type: () -> Literal["ga", "gtag"]
|
||||||
type_ = tk.config.get("googleanalytics.tracking_mode")
|
type_ = tk.config.get("googleanalytics.tracking_mode")
|
||||||
if type_:
|
if type_:
|
||||||
return type_
|
return type_
|
||||||
|
@ -47,10 +49,21 @@ def tracking_mode():
|
||||||
|
|
||||||
|
|
||||||
def measurement_id():
|
def measurement_id():
|
||||||
|
# type: () -> str
|
||||||
|
"""Set the MeasurementID for tracking API actions. By default,
|
||||||
|
`googleanalytics.id` is used.
|
||||||
|
|
||||||
|
Use this option during migration from Universal Analytics, to track API
|
||||||
|
requests using Measurement Protocol, while tracking browser event using
|
||||||
|
Universal Analytics.
|
||||||
|
|
||||||
|
Requires `googleanalytics.measurement_protocol.client_id`.
|
||||||
|
"""
|
||||||
return tk.config.get("googleanalytics.measurement_protocol.id") or tracking_id()
|
return tk.config.get("googleanalytics.measurement_protocol.id") or tracking_id()
|
||||||
|
|
||||||
|
|
||||||
def measurement_protocol_client_id():
|
def measurement_protocol_client_id():
|
||||||
|
# type: () -> str | None
|
||||||
return tk.config.get("googleanalytics.measurement_protocol.client_id")
|
return tk.config.get("googleanalytics.measurement_protocol.client_id")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,31 @@ groups:
|
||||||
- key: googleanalytics.id
|
- key: googleanalytics.id
|
||||||
required: true
|
required: true
|
||||||
placeholder: UA-000000000-1
|
placeholder: UA-000000000-1
|
||||||
|
validators: not_empty
|
||||||
|
description: |
|
||||||
|
Google tag ID(`G-*`) for Google Analytics 4 properties or the
|
||||||
|
Tracking ID(`UA-*`) for Universal Analytics properties.
|
||||||
|
|
||||||
- key: googleanalytics.download_handler
|
- key: googleanalytics.download_handler
|
||||||
default: ckan.views.resource:download
|
default: ckan.views.resource:download
|
||||||
|
description: |
|
||||||
|
Import path of the CKAN view that handles resource downloads. It can
|
||||||
|
be used in combination with plugins that replace download
|
||||||
|
view(`ckanext-cloudstorage`, `ckanext-s3filestore`).
|
||||||
|
|
||||||
|
- key: googleanalytics.tracking_mode
|
||||||
|
experimental: true
|
||||||
|
example: gtag
|
||||||
|
description: |
|
||||||
|
Defines the type of code snippet embedded into the page. Can be set
|
||||||
|
to either `ga`(enables `googleanalytics.js`) or `gtag`(enables
|
||||||
|
`gtag.js`). The plugin will check `googleanalytics.id` and set
|
||||||
|
appropriate value depending on the prefix: `G-` enables `gtag`, while
|
||||||
|
`UA-` enables `ga` mode.
|
||||||
|
|
||||||
|
Use this option only if you know better which snippet you need. In
|
||||||
|
future, after dropping UniversalAnalytics, this option will be
|
||||||
|
removed.
|
||||||
|
|
||||||
- key: googleanalytics.account
|
- key: googleanalytics.account
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,6 @@ from ckan.plugins import PluginImplementations
|
||||||
|
|
||||||
from ckanext.googleanalytics import utils, config, interfaces
|
from ckanext.googleanalytics import utils, config, interfaces
|
||||||
|
|
||||||
CONFIG_HANDLER_PATH = "googleanalytics.download_handler"
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
ga = Blueprint("google_analytics", "google_analytics")
|
ga = Blueprint("google_analytics", "google_analytics")
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[metadata]
|
[metadata]
|
||||||
name = ckanext-googleanalytics
|
name = ckanext-googleanalytics
|
||||||
version = 2.2.2
|
version = 2.2.3
|
||||||
description = Add GA tracking and reporting to CKAN instance
|
description = Add GA tracking and reporting to CKAN instance
|
||||||
long_description = file: README.md
|
long_description = file: README.md
|
||||||
long_description_content_type = text/markdown
|
long_description_content_type = text/markdown
|
||||||
|
|
Loading…
Reference in New Issue