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
As in the title, it would be a good thing to disable GoogleAnalytics when not running in production.
There are several ways to do this but the one i prefer is to check for the env var HUGO_ENV. Here user budparr suggests this code:
{{ if eq (getenv "HUGO_ENV") "production" }}
{{ template "_internal/google_analytics_async.html" . }}
{{ end }}
You should simply change layouts/partials/head.html. I would do a pull request but since there are many ways to disable it and since that would force your user to provide that env var, i prefer you to solve the issue in the way you prefer
The text was updated successfully, but these errors were encountered:
As in the title, it would be a good thing to disable GoogleAnalytics when not running in production.
There are several ways to do this but the one i prefer is to check for the env var HUGO_ENV.
Here user budparr suggests this code:
You should simply change layouts/partials/head.html. I would do a pull request but since there are many ways to disable it and since that would force your user to provide that env var, i prefer you to solve the issue in the way you prefer
The text was updated successfully, but these errors were encountered: