Skip to content

Commit

Permalink
Remove support for Universal Analytics and default to GA4 if not usin…
Browse files Browse the repository at this point in the history
…g GTM
  • Loading branch information
wjh18 committed Jul 1, 2023
1 parent 425a51a commit 5e8c8bb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Below are the current features of this theme. Features labeled *optional* or *fr

### 3rd Party

* Google Analytics v4 or Universal Analytics (optional)
* Google Analytics v4
* Google Tag Manager as an alternative to GA (optional)
* Disqus comments (optional)
* Disable comments on a per-page basis (optional) (frontmatter)
Expand Down
1 change: 0 additions & 1 deletion exampleSite/config/_default/params.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
### SEO, Analytics & 3rd-party
googleAnalyticsv4 = false # false for Universal Analytics, true for GA v4
netlify_forms = true # add data-netlify attribute to contact and newsletter forms, false to disable Netlify forms
# gtm_id = '' # GTM tracking (leave blank to use GA)
disallow_search_engines = false # Disallow search engine crawling in robots.txt
Expand Down
8 changes: 2 additions & 6 deletions layouts/partials/footer/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@
{{ end }}
<script src="{{ $final.Permalink }}"></script>

<!-- Add Universal Analytics or Google Analytics v4 based on config if not using GTM -->
<!-- Add Google Analytics v4 tag if not using GTM -->
{{ if and (not .Site.IsServer) (not .Site.Params.gtm_id) }}
{{ if eq .Site.Params.googleAnalyticsv4 true }}
{{ template "_internal/google_analytics.html" . }}
{{ else }}
{{ template "_internal/google_analytics_async.html" . }}
{{ end }}
{{ template "_internal/google_analytics.html" . }}
{{ end }}

0 comments on commit 5e8c8bb

Please sign in to comment.