mirror of
https://github.com/edcommonwealth/ecp.org.git
synced 2026-03-15 18:25:55 -07:00
Add google analytics
This commit is contained in:
parent
dd826c3e0d
commit
c24c367339
2 changed files with 14 additions and 0 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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue