Skip to content

Commit

Permalink
Merge pull request #1084 from GSA/ckanext-googleanalytics
Browse files Browse the repository at this point in the history
remove ckanext-googleanalyticsbasic, add ckanext-googleanalytics
  • Loading branch information
robert-bryson authored Oct 3, 2023
2 parents 3081225 + f17eb12 commit dfb8d86
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ CKAN_SMTP_MAIL_FROM=ckan@localhost
# Extensions
# TODO: Reenable pending https://github.com/GSA/data.gov/issues/3986
# qa archiver
CKAN__PLUGINS=envvars image_view text_view recline_view metrics_dashboard report ckan_harvester datajson_validator datajson_harvest geodatagov datagovtheme datagov_harvest geodatagov_miscs z3950_harvester arcgis_harvester geodatagov_geoportal_harvester waf_harvester_collection geodatagov_csw_harvester geodatagov_doc_harvester geodatagov_waf_harvester spatial_metadata spatial_query spatial_harvest_metadata_api googleanalyticsbasic dcat dcat_json_interface structured_data datagovcatalog
CKAN__PLUGINS=image_view text_view recline_view metrics_dashboard report ckan_harvester datajson_validator datajson_harvest geodatagov datagovtheme datagov_harvest geodatagov_miscs z3950_harvester arcgis_harvester geodatagov_geoportal_harvester waf_harvester_collection geodatagov_csw_harvester geodatagov_doc_harvester geodatagov_waf_harvester spatial_metadata spatial_query spatial_harvest_metadata_api googleanalytics dcat dcat_json_interface structured_data datagovcatalog envvars

# Extensions that exist but are not used in dev:
# - ckanext-saml2
Expand All @@ -71,7 +71,7 @@ CKAN__SPATIAL__SRID=4326
CKAN__SPATIAL__VALIDATOR__PROFILES=iso19139ngdc
CKANEXT__SPATIAL__SEARCH_BACKEND=solr-bbox

CKAN___GOOGLEANALYTICS__IDS=UA-1010101-1 UA-1010101-2
CKAN___GOOGLEANALYTICS__ID=UA-00000000-0
CKAN__TRACKING_ENABLED=true


Expand Down
9 changes: 8 additions & 1 deletion ckan/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
ckan==2.10.1
git+https://github.com/ckan/ckanext-dcat@master#egg=ckanext-dcat
-e git+https://github.com/ckan/ckanext-harvest.git@master#egg=ckanext-harvest
-e git+https://github.com/ckan/ckanext-googleanalytics.git@master#egg=ckanext-googleanalytics
-e git+https://github.com/GSA/ckanext-spatial.git@v2-0-0-gsa#egg=ckanext-spatial
git+https://github.com/GSA/ckanext-saml2auth.git@create_user_via_saml.log_210#egg=ckanext-saml2auth
# -e git+https://github.com/ckan/ckanext-qa.git@master#egg=ckanext-qa
Expand All @@ -13,7 +14,6 @@ ckanext-datagovtheme
ckanext-datajson
ckanext-envvars>=0.0.3
ckanext-geodatagov
ckanext-googleanalyticsbasic
ckanext-metrics-dashboard

# Pin for saml2auth to work
Expand All @@ -26,6 +26,13 @@ pika>=1.1.0,<1.3.0
# requests>=2.11.1 # included in ckan core
# six>=1.12.0 # included in dcat

# ckanext-googleanalytics
# https://github.com/ckan/ckanext-googleanalytics/blob/master/requirements.txt
gdata>=2.0.0
google-api-python-client>=1.6.1, <1.7.0
pyOpenSSL>=16.2.0
rsa>=4.7

# ckanext-archiver
# https://github.com/ckan/ckanext-archiver/blob/master/requirements.txt
progressbar2==3.53.3
Expand Down
18 changes: 13 additions & 5 deletions ckan/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Babel==2.10.3
Beaker==1.11.0
bleach==3.3.0
blinker==1.5
boto3==1.28.52
botocore==1.31.52
boto3==1.28.54
botocore==1.31.54
certifi==2023.7.22
cffi==1.15.1
chardet==5.2.0
Expand All @@ -18,7 +18,7 @@ ckanext-datajson==0.1.21
ckanext-dcat @ git+https://github.com/ckan/ckanext-dcat@93bf901684b729ccca474c970b7f47309ebace5b
ckanext-envvars==0.0.3
ckanext-geodatagov==0.2.7
ckanext-googleanalyticsbasic==0.2.1
-e git+https://github.com/ckan/ckanext-googleanalytics.git@3402d747e726fb8eb1d793da703b5a3249432c0a#egg=ckanext_googleanalytics
-e git+https://github.com/ckan/ckanext-harvest.git@9fb44f79809a1c04dfeb0e1ca2540c5ff3cacef4#egg=ckanext_harvest
ckanext-metrics-dashboard==0.1.6
-e git+https://github.com/ckan/ckanext-report.git@3588577f46d17e5f6ef163bb984d0e7016daef71#egg=ckanext_report
Expand All @@ -37,13 +37,16 @@ Flask-Login==0.6.1
flask-multistatic==1.0
Flask-WTF==1.0.1
future==0.18.3
gdata==2.0.18
GeoAlchemy2==0.5.0
geojson==3.0.1
geomet==1.0.0
gevent==23.9.1
google-api-python-client==1.6.7
greenlet==2.0.2
gunicorn==21.2.0
html5lib==1.1
httplib2==0.22.0
idna==3.4
importlib-metadata==6.8.0
importlib-resources==5.13.0
Expand All @@ -63,6 +66,7 @@ mypy-extensions==1.0.0
newrelic==9.0.0
nose==1.3.7
numpy==1.26.0
oauth2client==4.1.3
OWSLib==0.29.2
packaging==23.1
passlib==1.7.4
Expand All @@ -75,6 +79,8 @@ polib==1.1.1
progressbar==2.5
progressbar2==3.53.3
psycopg2==2.9.3
pyasn1==0.5.0
pyasn1-modules==0.3.0
pycparser==2.21
PyJWT==2.4.0
pyOpenSSL==23.2.0
Expand All @@ -84,7 +90,7 @@ pysaml2==7.0.1
pysolr==3.9.0
python-dateutil==2.8.2
python-magic==0.4.27
python-utils==3.7.0
python-utils==3.8.0
pytz==2023.3.post1
pytz-deprecation-shim==0.1.0.post0
PyUtilib==6.0.0
Expand All @@ -95,6 +101,7 @@ redis==5.0.0
requests==2.31.0
rfc3987==1.3.8
rq==1.11.0
rsa==4.9
s3transfer==0.6.2
sansjson==0.3.0
setuptools==67.1.0
Expand All @@ -108,14 +115,15 @@ tomli==2.0.1
typing_extensions==4.8.0
tzdata==2023.3
tzlocal==4.2
uritemplate==3.0.1
urllib3==1.26.16
webassets==2.0
webencodings==0.5.1
Werkzeug==2.0.0
wheel==0.41.2
WTForms==3.0.1
xlrd==2.0.1
xmlschema==2.4.0
xmlschema==2.5.0
zipp==3.17.0
zope.event==5.0
zope.interface==6.0
4 changes: 2 additions & 2 deletions ckan/setup/ckan.ini
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ ckan.cors.origin_whitelist = https://data.gov https://www.data.gov
# same origin policy
# TODO: Re-enable pending https://github.com/GSA/data.gov/issues/3986
# qa archiver
ckan.plugins = image_view text_view recline_view metrics_dashboard report ckan_harvester datajson_validator datajson_harvest geodatagov datagovtheme datagov_harvest geodatagov_miscs z3950_harvester arcgis_harvester geodatagov_geoportal_harvester waf_harvester_collection geodatagov_csw_harvester geodatagov_doc_harvester geodatagov_waf_harvester spatial_metadata spatial_query spatial_harvest_metadata_api googleanalyticsbasic dcat dcat_json_interface structured_data datagovcatalog saml2auth envvars
ckan.plugins = image_view text_view recline_view metrics_dashboard report ckan_harvester datajson_validator datajson_harvest geodatagov datagovtheme datagov_harvest geodatagov_miscs z3950_harvester arcgis_harvester geodatagov_geoportal_harvester waf_harvester_collection geodatagov_csw_harvester geodatagov_doc_harvester geodatagov_waf_harvester spatial_metadata spatial_query spatial_harvest_metadata_api googleanalytics dcat dcat_json_interface structured_data datagovcatalog saml2auth envvars

# Define which views should be created by default
# (plugins must be loaded in ckan.plugins)
Expand Down Expand Up @@ -264,7 +264,7 @@ ckanext.saml2auth.requested_authn_context = http://idmanagement.gov/ns/assurance
ckanext.saml2auth.enable_ckan_internal_login=false

# Google Analytics
googleanalytics.ids = UA-42145528-2 G-WP7FK9QXZD
googleanalytics.id = UA-00000000-0

# ckanext-geodatagov settings

Expand Down
2 changes: 1 addition & 1 deletion ckan/test-catalog-next.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use = config:test-core.ini

ckan.site_title = My Test CKAN Site
ckan.site_description = A test site for testing my CKAN extension
ckan.plugins = envvars image_view text_view recline_view datastore datagov_harvest ckan_harvester geodatagov datajson datajson_harvest geodatagov_miscs z3950_harvester arcgis_harvester geodatagov_geoportal_harvester waf_harvester_collection geodatagov_csw_harvester geodatagov_doc_harvester geodatagov_waf_harvester spatial_metadata spatial_query report qa archiver datagovtheme datagovcatalog googleanalyticsbasic dcat dcat_json_interface structured_data
ckan.plugins = envvars image_view text_view recline_view datastore datagov_harvest ckan_harvester geodatagov datajson datajson_harvest geodatagov_miscs z3950_harvester arcgis_harvester geodatagov_geoportal_harvester waf_harvester_collection geodatagov_csw_harvester geodatagov_doc_harvester geodatagov_waf_harvester spatial_metadata spatial_query report qa archiver datagovtheme datagovcatalog googleanalytics dcat dcat_json_interface structured_data
ckan.harvest.mq.type = redis
ckan.tracking_enabled = true
googleanalytics.ids = UA-1010101-1
Expand Down
2 changes: 1 addition & 1 deletion e2e/cypress/integration/ckan_extensions.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('CKAN Extensions', () => {
expect(installed_extensions).to.include('spatial_metadata');
expect(installed_extensions).to.include('spatial_query');
expect(installed_extensions).to.include('spatial_harvest_metadata_api');
expect(installed_extensions).to.include('googleanalyticsbasic');
expect(installed_extensions).to.include('googleanalytics');
expect(installed_extensions).to.include('dcat');
expect(installed_extensions).to.include('dcat_json_interface');
expect(installed_extensions).to.include('structured_data');
Expand Down
2 changes: 1 addition & 1 deletion e2e/cypress/integration/main_page.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('Main Page', () => {

it('google tracker injected', () => {
cy.request('/dataset').then((response) => {
expect(response.body).to.have.string('UA-1010101-1');
expect(response.body).to.have.string('UA-00000000-0');
});
});
});
1 change: 1 addition & 0 deletions manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ applications:
NEW_RELIC_HOST: gov-collector.newrelic.com
NEW_RELIC_MONITOR_MODE: ((new_relic_monitor_mode))
CKAN_SITE_URL: https://((route-public))
CKAN___GOOGLEANALYTICS__ID: ((googleanalytics_id))

- name: ((app_name))-admin
buildpacks:
Expand Down
2 changes: 2 additions & 0 deletions vars.development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ saml2_certificate: |
-----BEGIN CERTIFICATE-----
placeholder
-----END CERTIFICATE-----
googleanalytics_id: UA-00000000-1
2 changes: 2 additions & 0 deletions vars.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ saml2_certificate: |
-----BEGIN CERTIFICATE-----
placeholder
-----END CERTIFICATE-----
googleanalytics_id: G-WP7FK9QXZD
2 changes: 2 additions & 0 deletions vars.staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ saml2_certificate: |
-----BEGIN CERTIFICATE-----
placeholder
-----END CERTIFICATE-----
googleanalytics_id: UA-00000000-2

0 comments on commit dfb8d86

Please sign in to comment.