Init with some changes to the Serif Theme
This commit is contained in:
commit
912d143813
243 changed files with 15251 additions and 0 deletions
26
_includes/google-analytics.html
Normal file
26
_includes/google-analytics.html
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{% if jekyll.environment == "production" %}
|
||||
{% assign gid = site.env.NETLIFY_GOOGLE_ANALYTICS_ID %}
|
||||
{% if gid %}
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ gid }}"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
|
||||
function gtag() {
|
||||
dataLayer.push(arguments);
|
||||
}
|
||||
gtag('js', new Date());
|
||||
gtag('config', '{{ $gid }}');
|
||||
</script>
|
||||
{% elsif site.data.seo.google_analytics_id %}
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.data.seo.google_analytics_id }}"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
|
||||
function gtag() {
|
||||
dataLayer.push(arguments);
|
||||
}
|
||||
gtag('js', new Date());
|
||||
gtag('config', '{{ site.data.seo.google_analytics_id }}');
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue