update ga
parent
4f35c2e653
commit
593d6e5fba
|
@ -1,30 +1,28 @@
|
|||
{% if jekyll.environment == "production" %}
|
||||
{% assign gid = site.env.NETLIFY_GOOGLE_ANALYTICS_ID %}
|
||||
{{ gid }}
|
||||
{% 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 || [];
|
||||
|
||||
{% 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>
|
||||
{% else %}
|
||||
{% if site.google_analytics_id %}
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics_id }}"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
|
||||
function gtag() {
|
||||
dataLayer.push(arguments);
|
||||
}
|
||||
gtag('js', new Date());
|
||||
gtag('config', '{{ $gid }}');
|
||||
</script>
|
||||
{% else %}
|
||||
{% if site.google_analytics_id %}
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics_id }}"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
|
||||
function gtag() {
|
||||
dataLayer.push(arguments);
|
||||
}
|
||||
gtag('js', new Date());
|
||||
gtag('config', '{{ site.google_analytics_id }}');
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
function gtag() {
|
||||
dataLayer.push(arguments);
|
||||
}
|
||||
gtag('js', new Date());
|
||||
gtag('config', '{{ site.google_analytics_id }}');
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
Loading…
Reference in New Issue