You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi, i am having a problem form google analytics, i can not set up it.
i have changed the code from includes/extensions/google-analytics.html
and now is like this:
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
<script>
function initGoogleAnalytics() {
var doNotTrack = (window.doNotTrack === "1" || navigator.doNotTrack === "1" ||
navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1");
var enableDNT = "{{ site.enableDNT | default: true }}" == "true";
if (!enableDNT || !doNotTrack) {
window.dataLayer = window.dataLayer || [];
function gtag(){window.dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ site.google_analytics }}');
}
}
window.addEventListener("load", initGoogleAnalytics);
</script>
```
and my `_config.yml`
```
# Google analytics
google_analytics: [G-9DDM93FC22]
```
what is my error?
The text was updated successfully, but these errors were encountered:
The conditions for the _includes/extensions/google-analytics.html to populate in the _includes/head.html are if the google_analytics property is set in the _config.yml (yours is) AND the jekyll environment is set to production.
This can be done by running JEKYLL_ENV=production jekyll build.
hi, i am having a problem form google analytics, i can not set up it.
i have changed the code from
includes/extensions/google-analytics.html
and now is like this:
The text was updated successfully, but these errors were encountered: