Skip to content

Commit

Permalink
428 ga4 analytics fix (#429)
Browse files Browse the repository at this point in the history
Fixes partial to enable display of GA-4 code in HTML header.
  • Loading branch information
dolsysmith authored Oct 25, 2023
1 parent fa7221d commit 834598e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/views/layouts/_head_tag_content.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ signed in %>
<%= render 'shared/appearance_styles' %>

<!-- Google Analytics -->
<%= render partial: 'shared/ga', formats: [:html] %>
<%= render partial: 'shared/ga4', formats: [:html] %>

<!-- for extras, e.g., a favicon -->
<%= render partial: '/head_tag_extras', formats: [:html] %>
14 changes: 8 additions & 6 deletions config/analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
# To integrate your app with Google Analytics, uncomment the lines below and add your API key information.
#
analytics:
google:
ga4:
analytics_id: <%= ENV['GOOGLE_ANALYTICS_ID'] %>
# app_name: GOOGLE_OAUTH_APP_NAME
# app_version: GOOGLE_OAUTH_APP_VERSION
# privkey_path: GOOGLE_OAUTH_PRIVATE_KEY_PATH
# privkey_secret: GOOGLE_OAUTH_PRIVATE_KEY_SECRET
# client_email: GOOGLE_OAUTH_CLIENT_EMAIL
#app_name: <%= ENV['GOOGLE_OAUTH_APP_NAME'] %>
#app_version: <%= ENV['GOOGLE_OAUTH_APP_VERSION'] %>
#privkey_path: <%= ENV['GOOGLE_OAUTH_PRIVATE_KEY_PATH'] %>
#privkey_secret: <%= ENV['GOOGLE_OAUTH_PRIVATE_KEY_SECRET'] %>
#client_email: <%= ENV['GOOGLE_OAUTH_CLIENT_EMAIL'] %>
google:
analytics_id: <%= ENV['GOOGLE_ANALYTICS_ID'] %>
2 changes: 2 additions & 0 deletions example.env
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,6 @@ FEDORA_PASSWORD=
DEV_ADMIN_USER_EMAIL='[email protected]'
DEV_ADMIN_USER_PASSWORD='password'
##------Google Analytics------------------------------------
HYRAX_ANALYTICS_PROVIDER=ga4
HYRAX_ANALYTICS=true
GOOGLE_ANALYTICS_ID=

0 comments on commit 834598e

Please sign in to comment.