wowthemesnet / mediumish-theme-jekyll

Jekyll Template - Mediumish
https://wowthemesnet.github.io/mediumish-theme-jekyll/
MIT License
1.29k stars 1.53k forks source link

Google Analytics Support #175

Closed trmittal24 closed 3 years ago

trmittal24 commented 3 years ago

Hey Mate, Thanks for providing with the wonderful template! I was facing some troubles with Google Analytics, can you please help?

I created a new Analytics account and a data stream for my site, I got the streamcode and pasted it in _config.yml.

However, the Analytics page on google is always reflecting 0 views.

Is there is something else I need to do?

Thanks Tarun

trmittal24 commented 3 years ago

This is fixed. I replaced

<script> (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','//www.google-analytics.com/analytics.js','ga'); ga('create', '{{site.google_analytics}}', 'auto'); ga('send', 'pageview'); </script>

with

`

`

This was required for Stream ID starting with G- instead of UA-

techtreehouse commented 3 weeks ago

Thank you for this! If anyone is looking for where to replace it, the code is in "_layouts/default.html"