Fix Google Analytic not showing up for v3 ID (#363)
Signed-off-by: hossainemruz <hossainemruz@gmail.com>
This commit is contained in:
parent
091c77360d
commit
14ee45e4a0
3 changed files with 15 additions and 3 deletions
|
@ -11,7 +11,13 @@
|
|||
|
||||
<!-- ADD GOOGLE ANALYTICS IF ENABLED -->
|
||||
{{ if site.GoogleAnalytics }}
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
<!-- Google Analytics v3 ID -->
|
||||
{{ if hasPrefix site.GoogleAnalytics "UA-"}}
|
||||
{{ template "_internal/google_analytics_async.html" . }}
|
||||
{{ else }}
|
||||
<!-- Google Analytics v4 ID -->
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</head>
|
||||
|
||||
|
|
|
@ -31,7 +31,13 @@
|
|||
|
||||
<!-- Add Google Analytics if enabled in configuration -->
|
||||
{{ if site.GoogleAnalytics }}
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
<!-- Google Analytics v3 ID -->
|
||||
{{ if hasPrefix site.GoogleAnalytics "UA-"}}
|
||||
{{ template "_internal/google_analytics_async.html" . }}
|
||||
{{ else }}
|
||||
<!-- Google Analytics v4 ID -->
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</head>
|
||||
<body data-spy="scroll" data-target="#top-navbar" data-offset="100">
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<!-- List all the pages. It uses the sidebar menu to discover the page order. -->
|
||||
{{ $pages := slice }}
|
||||
|
||||
{{ if isset site "Menus" }}
|
||||
{{ if isset site.Menus "sidebar" }}
|
||||
{{ $pages = partial "helpers/get-pages.html" site.Menus.sidebar }}
|
||||
{{ end }}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue