mirror of
https://github.com/thangisme/notes.git
synced 2024-12-21 11:16:39 -05:00
Add hook for GA tracking
This commit is contained in:
parent
a44d3a8652
commit
e12408d07b
@ -31,3 +31,7 @@ aux_links:
|
||||
|
||||
# Color scheme currently only supports "dark" or nil (default)
|
||||
color_scheme: nil
|
||||
|
||||
# Google Analytics Tracking (optional)
|
||||
# e.g, UA-1234567-89
|
||||
ga_tracking: UA-2709176-10
|
||||
|
@ -7,8 +7,21 @@
|
||||
|
||||
<title>{{ page.title }} - {{ site.title }}</title>
|
||||
<link rel="stylesheet" href="{{ "/assets/css/just-the-docs.css" | absolute_url }}">
|
||||
|
||||
{% if site.ga_tracking != nil %}
|
||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-2709176-10"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', '{{ site.ga_tracking }}');
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
{% if site.search_enabled != nil %}
|
||||
<script type="text/javascript" src="{{ "/assets/js/vendor/lunr.min.js" | absolute_url }}"></script>
|
||||
<script type="text/javascript" src="{{ "/assets/js/vendor/lunr.min.js" | absolute_url }}"></script>
|
||||
{% endif %}
|
||||
<script type="text/javascript" src="{{ "/assets/js/just-the-docs.js" | absolute_url }}"></script>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user