analytics/lib/plausible_web/views/site_view.ex
2019-09-02 12:29:19 +01:00

18 lines
506 B
Elixir

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