diff --git a/README.rst b/README.rst index db7bd72..5fb1a1e 100644 --- a/README.rst +++ b/README.rst @@ -81,7 +81,7 @@ Installation 5. Finally, there are some optional configuration settings (shown here with their default settings):: - googleanalytics.resource_prefix = /downloads/ + googleanalytics_resource_prefix = /downloads/ googleanalytics.domain = auto googleanalytics.track_events = false diff --git a/ckanext/googleanalytics/commands.py b/ckanext/googleanalytics/commands.py index 5f92cc8..4e519ad 100644 --- a/ckanext/googleanalytics/commands.py +++ b/ckanext/googleanalytics/commands.py @@ -83,7 +83,7 @@ class LoadAnalytics(CkanCommand): self.CONFIG = pylonsconfig self.resource_url_tag = self.CONFIG.get( - 'googleanalytics.resource_prefix', + 'googleanalytics_resource_prefix', DEFAULT_RESOURCE_URL_TAG) # funny dance we need to do to make sure we've got a diff --git a/ckanext/googleanalytics/plugin.py b/ckanext/googleanalytics/plugin.py index 11bb893..febcee8 100644 --- a/ckanext/googleanalytics/plugin.py +++ b/ckanext/googleanalytics/plugin.py @@ -41,11 +41,11 @@ class GoogleAnalyticsPlugin(p.SingletonPlugin): # If resource_prefix is not in config file then write the default value # to the config dict, otherwise templates seem to get 'true' when they # try to read resource_prefix from config. - if 'googleanalytics.resource_prefix' not in config: - config['googleanalytics.resource_prefix'] = ( + if 'googleanalytics_resource_prefix' not in config: + config['googleanalytics_resource_prefix'] = ( commands.DEFAULT_RESOURCE_URL_TAG) self.googleanalytics_resource_prefix = config[ - 'googleanalytics.resource_prefix'] + 'googleanalytics_resource_prefix'] self.show_downloads = converters.asbool( config.get('googleanalytics.show_downloads', True)) diff --git a/ckanext/googleanalytics/templates/base.html b/ckanext/googleanalytics/templates/base.html index 57f01f0..9e1cf09 100644 --- a/ckanext/googleanalytics/templates/base.html +++ b/ckanext/googleanalytics/templates/base.html @@ -12,7 +12,7 @@ {% block googleanalytics_event_tracking %} {% resource 'ckanext-googleanalytics/googleanalytics_event_tracking.js' %}
+ data-module-googleanalytics_resource_prefix="{{ g.googleanalytics_resource_prefix }}">
{% endblock %} {% endblock %}