chore: update version
This commit is contained in:
parent
cf75e577cb
commit
b6b3f91936
|
@ -15,6 +15,7 @@ log = logging.getLogger(__name__)
|
|||
|
||||
|
||||
def tracking_id():
|
||||
# type: () -> str
|
||||
return tk.config["googleanalytics.id"]
|
||||
|
||||
|
||||
|
@ -31,6 +32,7 @@ def download_handler():
|
|||
|
||||
|
||||
def tracking_mode():
|
||||
# type: () -> Literal["ga", "gtag"]
|
||||
type_ = tk.config.get("googleanalytics.tracking_mode")
|
||||
if type_:
|
||||
return type_
|
||||
|
@ -47,10 +49,21 @@ def tracking_mode():
|
|||
|
||||
|
||||
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()
|
||||
|
||||
|
||||
def measurement_protocol_client_id():
|
||||
# type: () -> str | None
|
||||
return tk.config.get("googleanalytics.measurement_protocol.client_id")
|
||||
|
||||
|
||||
|
|
|
@ -5,9 +5,31 @@ groups:
|
|||
- key: googleanalytics.id
|
||||
required: true
|
||||
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
|
||||
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
|
||||
|
||||
|
|
|
@ -15,8 +15,6 @@ from ckan.plugins import PluginImplementations
|
|||
|
||||
from ckanext.googleanalytics import utils, config, interfaces
|
||||
|
||||
CONFIG_HANDLER_PATH = "googleanalytics.download_handler"
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
ga = Blueprint("google_analytics", "google_analytics")
|
||||
|
||||
|
|
Loading…
Reference in New Issue