Skip to content

Commit

Permalink
Merge pull request #2268 from DOAJ/feature/3576_plausible_public_data…
Browse files Browse the repository at this point in the history
…_dump

add new plausible event `PublicDataDump`
  • Loading branch information
Steven-Eardley authored Jul 11, 2023
2 parents a7878ce + b75d9d1 commit 6f3a86e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions portality/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,11 @@
# ~~->OpenURL:Feature~~
GA_CATEGORY_OPENURL = 'OpenURL'

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

# GA for API
# ~~-> API:Feature~~
GA_CATEGORY_API = 'API Hit'
Expand Down
2 changes: 2 additions & 0 deletions portality/view/doaj.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ def sitemap():

@blueprint.route("/public-data-dump/<record_type>")
@api_key_required
@plausible.pa_event(app.config.get('GA_CATEGORY_PUBLICDATADUMP', 'PublicDataDump'),
action=app.config.get('GA_ACTION_PUBLICDATADUMP', 'Download'))
def public_data_dump_redirect(record_type):
if not current_user.has_role(constants.ROLE_PUBLIC_DATA_DUMP):
abort(404)
Expand Down

0 comments on commit 6f3a86e

Please sign in to comment.