mirror of https://github.com/saimn/sigal.git
8 changed files with 30 additions and 12 deletions
@ -1,13 +1,12 @@
|
||||
{% if settings.google_analytics %} |
||||
<script> |
||||
var _gaq = _gaq || []; |
||||
_gaq.push(['_setAccount', '{{ settings.google_analytics }}']); |
||||
_gaq.push(['_trackPageview']); |
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ |
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), |
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) |
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); |
||||
|
||||
(function() { |
||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; |
||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; |
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); |
||||
})(); |
||||
</script> |
||||
ga('create', '{{ settings.google_analytics }}', 'auto'); |
||||
ga('send', 'pageview'); |
||||
|
||||
</script> |
||||
{% endif %} |
||||
|
||||
@ -0,0 +1,11 @@
|
||||
{% if settings.google_tag_manager %} |
||||
<!-- Google Tag Manager --> |
||||
<noscript><iframe src="//www.googletagmanager.com/ns.html?id={{settings.google_tag_manager}}" |
||||
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> |
||||
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': |
||||
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], |
||||
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= |
||||
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); |
||||
})(window,document,'script','dataLayer','{{settings.google_tag_manager}}');</script> |
||||
<!-- End Google Tag Manager --> |
||||
{% endif %} |
||||
Loading…
Reference in new issue