📅 2019-Jul-06 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ google analytics, pandoc ⬩ 📚 Archive
Pandoc can be used to convert Markdown files to HTML webpages. If you are hosting these webpages online, it might be useful to get some stats on them. Google Analytics is a popular service to do this.
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxxxx-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-xxxxxxxxx-1');
</script>
header.txt.head section of every webpage on your website. To embed
this tracking code in every HTML webpage you generate using Pandoc, use
the --include-in-header or -H option. For
example:$ pandoc --standalone --include-in-header=header.txt in.markdown -o out.html
Tried with: Pandoc 1.19.2.4 and Ubuntu 18.04