Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade analytics CKAN extension #1406

Open
1 of 14 tasks
avdata99 opened this issue Feb 26, 2020 · 0 comments
Open
1 of 14 tasks

Upgrade analytics CKAN extension #1406

avdata99 opened this issue Feb 26, 2020 · 0 comments

Comments

@avdata99
Copy link
Contributor

avdata99 commented Feb 26, 2020

Description

As a part of a plan to upgrade CKAN extensions in use, and in order to improve the way that we manage forks we need to upgrade the Analytics extension in use. (This is part of the reduce/simplify fork epics.)

Acceptance Criteria

  • We remove the fork(ie copy) and upgrade extension for catalog & inventory and we have tested environment (needs to be signed off by GSA before proceeding)
  • When there's a new release upstream, we can get onto it in under an hour
  • When there's a new release upstream, we see a notification in a Slack channel
  • If the upstream maintainers don't already use versioning, there's an issue in their tracker requesting they do.
  • If the upstream maintainers don't already have tests, there's an issue in their tracker requesting they add them.
  • We have tests for this extension running in CI (upstream have tests but no CI)

Tasks

  • Define if we really need multiple tracker IDs. If we need this should be added as a new feature to upstream and create a PR for it.
  • If the US Digital Analytics Program requires to use the Universal-Federated-Analytics-Min.js file, it should be added as extra code in a different HTML file or maybe it should live in a new CKAN extension.
  • Create an issue in upstream to add CI to run tests in each commit and PR: here
  • Make a recommendation to GSA to re analytics CKAN extension
  • Connect our Slack channel with new release news in upstream
  • Apply this new URL in requirement files
    • Catalog
    • Inventory

Analysis & notes

We're using a copy-based (not a fork) Google Analytics extension
We consider as upstream the ckan/ckanext-googleanalytics repo

GSA/ckanext-googleanalyticsbasic is a simple implementation of a single feature from ckan/ckanext-googleanalytics. It adds Google Analytics asynchronous tracking code to your page headers for page tracking.

It looks like most of the code in plugin.py from ckanext-googleanalyticsbasic (a good portion of the code) is identical to what's found in ckanext-googleanalytics. If it doesn't work out of the box, it shouldn't take much work to migrate to ckan/ckanext-googleanalytics, and it will add a lot of optional functionality. The extra functionality would include resource download tracking, some API usage tracking, custom event tracking for extensions, and editing user profiles.

More detailed code analysis is here

Two key points:

  1. Is to understand if they need multiple tracking ids... Main point of the fork/copy is to manage multiple ids but that doesn't seem in use
  2. There is a small script for the Open Analytics

Recommendation

Recomendation is to use the community version with an GSA extension to customise (eg apply google analytics id(s)). In theory it could be handled with a GSA fork but would be better to upstream this.

This extension would be a super small script if 1 tracking id is needed. If multiple tracking ids are needed would send a PR to upstream to include this ability... if not we'd need to include this in the extension (needs further analysis).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

1 participant