Skip to content

Commit d411515

Browse files
Dave Newmanseuros
Dave Newman
authored andcommitted
Add Assembly analytics snippet
1 parent b61fb50 commit d411515

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

app/views/shared/_analytics.html.erb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,20 @@
1717
ga('send', 'pageview');
1818
</script>
1919
<% end %>
20+
21+
22+
<% if ENV['ASMLYTICS'] %>
23+
<script type="text/javascript">
24+
;(function(p,l,o,w,i){if(!p[i]){p.__asml=p.__asml||[];
25+
p.__asml.push(i);p[i]=function(){(p[i].q=p[i].q||[]).push(arguments)
26+
};p[i].q=p[i].q||[];n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1;
27+
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","https://d1uxm17u44dmmr.cloudfront.net/1.0.0/asml.js","asml"));
28+
29+
asml('create', '<%= ENV['ASMLYTICS'] %>');
30+
<% if signed_in? %>
31+
asml('track', '<%= current_user.email %>');
32+
<% else %>
33+
asml('track');
34+
<% end %>
35+
</script>
36+
<% end %>

0 commit comments

Comments
 (0)