analytics.html 875 B

12345678910111213141516171819202122232425262728
  1. <!-- Google analytics -->
  2. {% if site.google_analytics %}
  3. <script>
  4. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  5. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  6. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  7. })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  8. ga('create', '{{ site.google_analytics }}', 'auto');
  9. ga('send', 'pageview');
  10. </script>
  11. {% endif %}
  12. <!-- Baidu analytics -->
  13. {% if site.baidu_analytics %}
  14. <script>
  15. var _hmt = _hmt || [];
  16. (function () {
  17. var hm = document.createElement("script");
  18. hm.src = "//hm.baidu.com/hm.js?{{ site.baidu_analytics }}";
  19. var s = document.getElementsByTagName("script")[0];
  20. s.parentNode.insertBefore(hm, s);
  21. })();
  22. </script>
  23. {% endif %}