Skip to content

Commit

Permalink
Don't re-write plausible URLs with forntend prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
ffont committed Nov 17, 2023
1 parent 3e9b353 commit ffdbb7b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion freesound/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,6 @@
# -------------------------------------------------------------------------------
# Analytics
PLAUSIBLE_AGGREGATE_PAGEVIEWS = True
PLAUSIBLE_SEPARATE_FRONTENDS = True

# -------------------------------------------------------------------------------
# Rabbit MQ
Expand Down
3 changes: 1 addition & 2 deletions general/templatetags/plausible.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@
@register.inclusion_tag('templatetags/plausible_scripts.html', takes_context=False)
def plausible_scripts():
aggregate_pageviews = settings.PLAUSIBLE_AGGREGATE_PAGEVIEWS
separate_frontends = settings.PLAUSIBLE_SEPARATE_FRONTENDS
return {'aggregate_pageviews': aggregate_pageviews, 'separate_frontends': separate_frontends}
return {'aggregate_pageviews': aggregate_pageviews}
1 change: 0 additions & 1 deletion templates/molecules/plausible_scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
redactedUrl = redactedUrl.replace(/people\/(\w+)\//ig, "people/_ID_/"); // Replace usernames
redactedUrl = redactedUrl.replace(/browse\/geotags\/(\w+)\//ig, "browse/geotags/_TAG_/"); // Replace tag frm geotags
redactedUrl = redactedUrl.replace(/browse\/tags\/.*/ig, "browse/tags/_TAGS_/"); // Replace multiple tags form tags
{% if separate_frontends %}redactedUrl = redactedUrl.replace('freesound.org/', 'freesound.org/BW/'); // Alter path to indicate NG front end{% endif %}
plausible('pageview', { u: redactedUrl });
</script>
{% else %}
Expand Down

0 comments on commit ffdbb7b

Please sign in to comment.