File tree Expand file tree Collapse file tree 4 files changed +29
-11
lines changed Expand file tree Collapse file tree 4 files changed +29
-11
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ url: "https://pyweekly.qiwihui.com" # change this to the base hostname & protoco
77permalink : /:title
88
99google_analytics : " UA-46660488-11"
10- # google_adsense: "ca-pub-8935595858652656"
10+ google_adsense : " ca-pub-8935595858652656"
1111
1212# cayman-blog date format
1313# refer to http://shopify.github.io/liquid/filters/date/ if you want to customize this
Original file line number Diff line number Diff line change 1+ {% if site.google_analytics %}
2+ < script async src ="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }} "> </ script >
3+ < script >
4+ window . dataLayer = window . dataLayer || [ ] ;
5+ function gtag ( ) { dataLayer . push ( arguments ) ; }
6+ gtag ( 'js' , new Date ( ) ) ;
7+ gtag ( 'config' , '{{ site.google_analytics }}' ) ;
8+ </ script >
9+ {% endif %}
Original file line number Diff line number Diff line change 1+ <!--
12{% if site.google_adsense %}
23<script data-ad-client="{{ site.google_adsense }}" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js">
34</script>
5+ {% endif %}
6+ -->
7+
8+ {% if page.layout == 'post' %}
9+ {% if site.google_adsense %}
10+ < script async src ="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js "> </ script >
11+ < ins class ="adsbygoogle "
12+ style ="display:block; text-align:center; "
13+ data-ad-layout ="in-article "
14+ data-ad-format ="fluid "
15+ data-ad-client ="{{ site.google_adsense }} "
16+ data-ad-slot ="2654019047 "> </ ins >
17+ < script >
18+ ( adsbygoogle = window . adsbygoogle || [ ] ) . push ( { } ) ;
19+ </ script >
20+ {% endif %}
421{% endif %}
Original file line number Diff line number Diff line change 22< html lang ="{{ page.lang | default: site.lang | default: "en " }}">
33
44< head >
5-
6- {% if site.google_analytics %}
7- < script async src ="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }} "> </ script >
8- < script >
9- window . dataLayer = window . dataLayer || [ ] ;
10- function gtag ( ) { dataLayer . push ( arguments ) ; }
11- gtag ( 'js' , new Date ( ) ) ;
12- gtag ( 'config' , '{{ site.google_analytics }}' ) ;
13- </ script >
14- {% endif %}
5+
6+ {% include analytics.html %}
157
168 {% include auto-ads.html %}
179
You can’t perform that action at this time.
0 commit comments