Skip to content

Commit

Permalink
update google analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
onweru committed Nov 17, 2023
1 parent 699607b commit fbd7eb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 4 additions & 2 deletions exampleSite/config/_default/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ languageCode = "en-us"
paginate = 10 # Number of posts per page
# this example loads the theme as hugo module
# comment out line below, and uncomment the line after it if you prefer to load the theme normally
theme = ["github.com/onweru/browse"]
theme = "github.com/onweru/browse"
# theme = "browse" # comment this out if you'ld rather use a fork of this repo or use it as a git submodule
disqusShortname = "" # Enable comments by entering your Disqus shortname
googleAnalytics = "" # Enable Google Analytics by entering your tracking id
[services]
[services.googleAnalytics]
ID = "G-MEASUREMENT_ID" # Enable Google Analytics by entering your tracking id
6 changes: 2 additions & 4 deletions layouts/partials/analytics/google.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{{- if hasPrefix site.GoogleAnalytics "G-" }}
{{ if hugo.IsProduction }}
{{ template "_internal/google_analytics.html" . }}
{{- else }}
{{ template "_internal/google_analytics_async.html" . }}
{{- end }}
{{ end }}

0 comments on commit fbd7eb7

Please sign in to comment.