mirror of
https://github.com/alanorth/hugo-theme-bootstrap4-blog.git
synced 2024-12-19 00:52:19 +01:00
layouts: Test for existence of Google Analytics ID
Previously we showed the Cookie Usage banner if the site's config had a cookie consent URL specified. As of 2018-05 (GDPR) it makes more sense to only display this banner if the site has a Google Analytics ID set. Because we are using Haven for consent manage- ment we can now inject Google Analytics automatically after the user has agreed, so we no longer need to use Hugo's internal te- mplate.
This commit is contained in:
parent
dedea8ccc0
commit
26f170bfdd
@ -31,9 +31,7 @@
|
|||||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
|
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
|
||||||
{{ template "_internal/google_analytics_async.html" . }}
|
{{ if .Site.GoogleAnalytics }}
|
||||||
|
|
||||||
{{ if .Site.Params.cookie_consent_info_url }}
|
|
||||||
{{ partial "cookie-consent.html" . }}
|
{{ partial "cookie-consent.html" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ Haven.create({
|
|||||||
{
|
{
|
||||||
name: 'google-analytics',
|
name: 'google-analytics',
|
||||||
options: {
|
options: {
|
||||||
id: '{{ .Site.Params.googleAnalytics }}',
|
id: {{ .Site.GoogleAnalytics }},
|
||||||
},
|
},
|
||||||
purposes: ['analytics'],
|
purposes: ['analytics'],
|
||||||
inject: true,
|
inject: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user