Skip to content

Commit 2b471d9

Browse files
Merge pull request #293 from NYULibraries/g4a
2 parents f337f68 + de3713f commit 2b471d9

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

app/views/layouts/application.html.erb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@
99
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
1010
<%= javascript_tag '$.fx.off = true;' if Rails.env.test? %>
1111
<%= javascript_importmap_tags %>
12+
<!-- Google tag (gtag.js) -->
13+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-JWGGYRXL2K"></script>
14+
<script>
15+
window.dataLayer = window.dataLayer || [];
16+
function gtag(){ dataLayer.push(arguments); }
17+
gtag('js', new Date());
18+
19+
const config = {};
20+
<% if Settings.analytics_debug %>
21+
config.debug_mode = true
22+
<% end %>
23+
24+
gtag('config', 'G-JWGGYRXL2K', config)
25+
</script>
1226
</head>
1327

1428
<body>

config/settings.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,3 +275,6 @@ HELP_TEXT:
275275
SIDEBAR_STATIC_MAP:
276276
- 'iiif'
277277
- 'iiif_manifest'
278+
279+
# GOOGLE ANALYTICS HANDLING
280+
analytics_debug: true

0 commit comments

Comments
 (0)