mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-09 07:28:41 -07:00
Add Hotjar tracking code to home and dashboard/browse layouts
This commit is contained in:
parent
ce892161a4
commit
f6e6fb2b2d
4 changed files with 27 additions and 25 deletions
12
app/views/layouts/_google_analytics.html.erb
Normal file
12
app/views/layouts/_google_analytics.html.erb
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=<%= google_analytics_id %>"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
|
||||
function gtag() {
|
||||
dataLayer.push(arguments);
|
||||
}
|
||||
|
||||
gtag('js', new Date());
|
||||
gtag('config', <%= google_analytics_id.to_json.html_safe %>);
|
||||
</script>
|
||||
11
app/views/layouts/_hotjar.html.erb
Normal file
11
app/views/layouts/_hotjar.html.erb
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!-- Hotjar Tracking Code for Beta site -->
|
||||
<script>
|
||||
(function(h,o,t,j,a,r){
|
||||
h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
|
||||
h._hjSettings={hjid:2693082,hjsv:6};
|
||||
a=o.getElementsByTagName('head')[0];
|
||||
r=o.createElement('script');r.async=1;
|
||||
r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
|
||||
a.appendChild(r);
|
||||
})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
|
||||
</script>
|
||||
|
|
@ -6,18 +6,8 @@
|
|||
<%= stylesheet_link_tag 'sqm_application', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||
<%= stylesheet_link_tag 'welcome', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
|
||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=<%= @google_analytics_id %>"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
|
||||
function gtag() {
|
||||
dataLayer.push(arguments);
|
||||
}
|
||||
|
||||
gtag('js', new Date());
|
||||
gtag('config', <%= @google_analytics_id.to_json.html_safe %>);
|
||||
</script>
|
||||
<%= render partial: 'layouts/google_analytics', locals: { google_analytics_id: @google_analytics_id } %>
|
||||
<%= render 'layouts/hotjar' %>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
|
|
|||
|
|
@ -9,19 +9,8 @@
|
|||
<%= csp_meta_tag %>
|
||||
<%= stylesheet_link_tag 'sqm_application', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
|
||||
|
||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script src="https://www.googletagmanager.com/gtag/js?id=<%= @google_analytics_id %>"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
|
||||
function gtag() {
|
||||
dataLayer.push(arguments);
|
||||
}
|
||||
|
||||
gtag('js', new Date());
|
||||
gtag('config', <%= @google_analytics_id.to_json.html_safe %>);
|
||||
</script>
|
||||
<%= render partial: 'layouts/google_analytics', locals: { google_analytics_id: @google_analytics_id } %>
|
||||
<%= render 'layouts/hotjar' %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue