Skip to content

Commit

Permalink
Merge branch 'feature/3723_remove_ga_tracking' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven-Eardley committed Nov 22, 2023
2 parents 95bdccb + f4cbb66 commit 15c93d7
Show file tree
Hide file tree
Showing 15 changed files with 99 additions and 292 deletions.
1 change: 0 additions & 1 deletion cms/pages/legal/privacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ Volunteer records must include a name and an email address so that we can assign

When you use DOAJ, cookies are set on your machine. The cookies we set are:

* Google Analytics - we track usage of this site using Google Analytics. We do not track individuals but general paths through the site. (Being retired as of August 2023.)
* jquery - we use jquery.com to load the javascript framework.
* doaj.org - a small number of required cookies for the application to function, for example when you log in and when you click away the cookie consent banner.
* schema - if you upload article metadata to us via the Upload Article XML tab, we place a cookie on your machine which allows us to remember which XSD schema you used the last time you uploaded XML to us: doaj or Crossref
Expand Down
2 changes: 1 addition & 1 deletion docs/featuremap/terminals.csv
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ FieldDescriptions:Documentation
Flask:Technology
FlaskMail:Library
GeneratedDocsIndex:Script
GoogleAnalytics:ExternalService
GuideToApplying:Fragment
Huey:Technology
Java:Technology
Expand All @@ -26,6 +25,7 @@ LCC:SourceData
OpenURL:Fragment
Plagiarism:FieldSet
PlagiarismDetection:FormField
PlausibleAnalytics:ExternalService
Privacy:Fragment
Promo:Data
PublisherSupporters:Data
Expand Down
5 changes: 2 additions & 3 deletions portality/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@ def custom_static(path):
return send_from_directory(os.path.dirname(target), os.path.basename(target))
abort(404)


# Configure the Google Analytics tracker
# ~~-> GoogleAnalytics:ExternalService~~
# Configure Analytics
# ~~-> PlausibleAnalytics:ExternalService~~
from portality.lib import plausible
plausible.create_logfile(app.config.get('PLAUSIBLE_LOG_DIR', None))

Expand Down
172 changes: 0 additions & 172 deletions portality/lib/analytics.py

This file was deleted.

72 changes: 33 additions & 39 deletions portality/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1218,48 +1218,51 @@


######################################################
# Google Analytics configuration
# specify in environment .cfg file - avoids sending live analytics
# events from test and dev environments
# ~~->GoogleAnalytics:ExternalService~~
# Analytics configuration
# specify in environment .cfg file - avoids sending live analytics events from test and dev environments

GOOGLE_ANALYTICS_ID = ''

# Where to put the google analytics logs
GOOGLE_ANALTYICS_LOG_DIR = None
# ~~->PlausibleAnalytics:ExternalService~~
# Plausible analytics
# root url of plausible
PLAUSIBLE_URL = "https://plausible.io"
PLAUSIBLE_JS_URL = PLAUSIBLE_URL + "/js/script.outbound-links.file-downloads.js"
PLAUSIBLE_API_URL = PLAUSIBLE_URL + "/api/event"
# site name / domain name that used to register in plausible
PLAUSIBLE_SITE_NAME = BASE_DOMAIN
PLAUSIBLE_LOG_DIR = None

# Google Analytics custom dimensions. These are configured in the GA interface.
GA_DIMENSIONS = {
'oai_res_id': 'dimension1', # In GA as OAI:Record
# Analytics custom dimensions. These are configured in the interface. #fixme: are these still configured since the move from GA?
ANALYTICS_DIMENSIONS = {
'oai_res_id': 'dimension1', # In analytics as OAI:Record
}

# GA for OAI-PMH
# Plausible for OAI-PMH
# ~~-> OAIPMH:Feature~~
GA_CATEGORY_OAI = 'OAI-PMH'
ANALYTICS_CATEGORY_OAI = 'OAI-PMH'

# GA for Atom
# Plausible for Atom
# ~~-> Atom:Feature~~
GA_CATEGORY_ATOM = 'Atom'
GA_ACTION_ACTION = 'Feed request'
ANALYTICS_CATEGORY_ATOM = 'Atom'
ANALYTICS_ACTION_ACTION = 'Feed request'

# GA for JournalCSV
# Plausible for JournalCSV
# ~~-> JournalCSV:Feature~~
GA_CATEGORY_JOURNALCSV = 'JournalCSV'
GA_ACTION_JOURNALCSV = 'Download'
ANALYTICS_CATEGORY_JOURNALCSV = 'JournalCSV'
ANALYTICS_ACTION_JOURNALCSV = 'Download'

# GA for OpenURL
# Plausible for OpenURL
# ~~->OpenURL:Feature~~
GA_CATEGORY_OPENURL = 'OpenURL'
ANALYTICS_CATEGORY_OPENURL = 'OpenURL'

# GA for PublicDataDump
# Plausible for PublicDataDump
# ~~->PublicDataDump:Feature~~
GA_CATEGORY_PUBLICDATADUMP = 'PublicDataDump'
GA_ACTION_PUBLICDATADUMP = 'Download'
ANALYTICS_CATEGORY_PUBLICDATADUMP = 'PublicDataDump'
ANALYTICS_ACTION_PUBLICDATADUMP = 'Download'

# GA for API
# Plausible for API
# ~~-> API:Feature~~
GA_CATEGORY_API = 'API Hit'
GA_ACTIONS_API = {
ANALYTICS_CATEGORY_API = 'API Hit'
ANALYTICS_ACTIONS_API = {
'search_applications': 'Search applications',
'search_journals': 'Search journals',
'search_articles': 'Search articles',
Expand All @@ -1279,10 +1282,10 @@
}


# GA for fixed query widget
# Plausible for fixed query widget
# ~~->FixedQueryWidget:Feature~~
GA_CATEGORY_FQW = 'FQW'
GA_ACTION_FQW = 'Hit'
ANALYTICS_CATEGORY_FQW = 'FQW'
ANALYTICS_ACTION_FQW = 'Hit'

#####################################################
# Anonymised data export (for dev) configuration
Expand Down Expand Up @@ -1380,15 +1383,6 @@
# Editorial Dashboard - set to-do list size
TODO_LIST_SIZE = 48

#######################################################
# Plausible analytics
# root url of plausible
PLAUSIBLE_URL = "https://plausible.io"
PLAUSIBLE_JS_URL = PLAUSIBLE_URL + "/js/script.outbound-links.file-downloads.js"
PLAUSIBLE_API_URL = PLAUSIBLE_URL + "/api/event"
# site name / domain name that used to register in plausible
PLAUSIBLE_SITE_NAME = BASE_DOMAIN
PLAUSIBLE_LOG_DIR = None

#########################################################
# Background tasks --- monitor_bgjobs
Expand Down
9 changes: 0 additions & 9 deletions portality/templates/_js_includes.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@
<!-- Plausible Analytics -->
<script defer data-domain="{{ config.get('PLAUSIBLE_SITE_NAME')}}"
src="{{ config.get('PLAUSIBLE_JS_URL') }}"></script>

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-46560124-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-46560124-1');
</script>
{%- endif -%}

{# FIXME: do we need these any more? #}
Expand Down
Loading

0 comments on commit 15c93d7

Please sign in to comment.