의외로 간단하다.
Google Analytics 의 적용방식을 참고하여 만들면 된다.
<!-- google_ad_client: "ca-pub-2352406350095521" -->
{% if jekyll.environment == 'production' and google_ad_client %}
<!-- google Adsence -->
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script> (adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "{{ site.google_ad_client }}",
enable_page_level_ads: true
});
</script>
{% endif %}
google_ad_client: ca-pub-2352406350095521
<title>
{% if page.title == "Home" %}
{{ site.title }}{% if site.tagline %} · {{ site.tagline }}{% endif %}
{% else %}
{{ page.title }} · {{ site.title }}
{% endif %}
</title>
{% include google-analytics.html %}
<title>
{% if page.title == "Home" %}
{{ site.title }}{% if site.tagline %} · {{ site.tagline }}{% endif %}
{% else %}
{{ page.title }} · {{ site.title }}
{% endif %}
</title>
{% include google_adsense.html %}
{% include google-analytics.html %}
post.html 파일에 Debug Code를 넣고 테스트 해보면 된다.