Skip to content

Commit bd25a23

Browse files
committed
add google tag
1 parent 00d94c2 commit bd25a23

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
_<% if tag_id = ENV.fetch("GOOGLE_TAG_MANAGER", nil) %>
2+
<!-- Global site tag (gtag.js) - Google Analytics -->
3+
<script type="text/plain" data-consent="marketing" async src="https://www.googletagmanager.com/gtag/js?id=<%= tag_id %>"></script>
4+
<script type="text/plain" data-consent="marketing">
5+
window.dataLayer = window.dataLayer || [];
6+
function gtag(){dataLayer.push(arguments);}
7+
gtag('js', new Date());
8+
9+
gtag('config', '<%= tag_id %>');
10+
</script>
11+
<% end %>

0 commit comments

Comments
 (0)