analytics/lib/plausible_web/views/site_view.ex

18 lines
506 B
Elixir
Raw Normal View History

2019-09-02 14:29:19 +03:00
defmodule PlausibleWeb.SiteView do
use PlausibleWeb, :view
def snippet() do
"""
<script>
(function (w,d,s,o,f,js,fjs) {
w[o] = w[o] || function () { (w[o].q = w[o].q || []).push(arguments) };
js = d.createElement(s), fjs = d.getElementsByTagName(s)[0];
js.id = o; js.src = f; js.async = 1; fjs.parentNode.insertBefore(js, fjs);
}(window, document, 'script', 'plausible', 'https://plausible.io/js/p.js'));
plausible('page')
</script>\
"""
end
end