Skip to content

Commit

Permalink
Fix a bug introduced in #25
Browse files Browse the repository at this point in the history
Setting a googleanalytics_fields key to `True` as in #25 causes the
resulting Javascript to also include the literal `True`, which is not
valid. This works around that by setting the key to `'true'` which
when evaluated in an if statement is truthy, serving the same purpose
  • Loading branch information
William Hughes committed Feb 9, 2017
1 parent 8e36a4f commit 812b6e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ckanext/googleanalytics/plugin.py
Expand Up @@ -72,7 +72,7 @@ def configure(self, config):
'googleanalytics.linked_domains', ''
).split(',')]
if self.googleanalytics_linked_domains:
self.googleanalytics_fields['allowLinker'] = True
self.googleanalytics_fields['allowLinker'] = 'true'

self.googleanalytics_javascript_url = h.url_for_static(
'/scripts/ckanext-googleanalytics.js')
Expand Down

1 comment on commit 812b6e6

@camfindlay
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GA debug tool still complains about this not being a boolean when used on a CKAN instance.

"Expected a boolean value for the field: "allowLinker". But found: "string"."

Please sign in to comment.