1

Am integrating Wagtail and Google Analytics with the app wagalytics gives me /admin/analytics/token/ 500 () and the settings i used as indicated on the ReadMe

GA_KEY_FILEPATH = 'project-6408cf73f290.json'

GA_KEY_CONTENT = 'key content'

GA_VIEW_ID = 'ga:173531812'

Kindly where am i going wrong ?

This is the only error shown when i put the JSON key contents with GA_KEY_CONTENT = '{"type": "service_account",...'

    AttributeError at /admin/analytics/token/
'dict' object has no attribute 'replace'
Request Method: GET
Request URL:    http://127.0.0.1:8000/admin/analytics/token/
Django Version: 1.11.11
Exception Type: AttributeError
Exception Value:    
'dict' object has no attribute 'replace'
danielmwai
  • 305
  • 1
  • 6
  • 24

1 Answers1

1

The value of GA_KEY_CONTENT should be the contents of your JSON key, not a reference to the location.

tomd
  • 1,373
  • 1
  • 8
  • 12
  • do you have an example as i am getting 'dict' object has no attribute 'replace' error – danielmwai Apr 17 '18 at 17:39
  • You still need to surround the value in quotes to make it a string: `GA_KEY_CONTENT = '{"web":{"client_id":".....}'` – gasman Apr 17 '18 at 21:39
  • @gasman i get this error Error at /admin/analytics/token/ [('PEM routines', 'PEM_read_bio', 'no start line')] , kindly how do i resolve it – danielmwai Apr 18 '18 at 11:21