Skip to content

Commit e9609ea

Browse files
author
Dave Newman
committed
Add asmlytics snippet
1 parent 7792c88 commit e9609ea

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

app/views/shared/_analytics.html.erb

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

0 commit comments

Comments
 (0)