---
# System prepended metadata

title: 'OD-1201: fix ckanext-googleanalytics incompatibility with CKAN 2.9'

---

# OD-1201: fix ckanext-googleanalytics incompatibility with CKAN 2.9

This is tested with [the `ed-2.9` branch](https://github.com/datopian/ckanext-googleanalytics/tree/ed-2.9) of [datopian/ckanext-googleanalytics](https://github.com/datopian/ckanext-googleanalytics/tree/ed-2.9) and with ckan 2.9.4

## References to ckanext showacse in ckanext-ed extension

### Resources are now assets

The [googleanalytics_event_tracking.js](https://github.com/datopian/ckanext-googleanalytics/blob/ed-2.9/ckanext/googleanalytics/assets/googleanalytics_event_tracking.js) file is being referenced [here in ckanext-ed](https://github.com/CivicActions/ckanext-ed/blob/v1.13.0/ckanext/ed/templates/base.html#L73). In ckan 2.9, resources are now assets, see the docs [here](https://docs.ckan.org/en/2.9/contributing/frontend/assets.html#assets).

This line here https://github.com/CivicActions/ckanext-ed/blob/v1.13.0/ckanext/ed/templates/base.html#L73:

```html
{% resource 'ckanext-googleanalytics/googleanalytics_event_tracking.js' %}
```

in the ckanext-ed repo would need to be changed to: 
```html
{% asset 'ckanext-googleanalytics/googleanalytics_event_tracking.js' %}
```

## Code updates

### Fix file_cache error

This error occured when trying to run the `ckan --config=$CKAN_INI googleanalytics load credentials.json` command:
```txt
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/googleapiclient/discovery_cache/__init__.py", line 41, in autodetect
    from . import file_cache
  File "/usr/lib/python3.8/site-packages/googleapiclient/discovery_cache/file_cache.py", line 40, in <module>
    raise ImportError(
ImportError: file_cache is unavailable when using oauth2client >= 4.0.0
```
This error was fixed with [this commit](https://github.com/datopian/ckanext-googleanalytics/commit/b3974528ade74787d98871ddec07dc898e9ff9e2) on the `ed-2.9` branch