Fix Google Analytic not showing up for v3 ID (#363)

Signed-off-by: hossainemruz <hossainemruz@gmail.com>
This commit is contained in:
Emruz Hossain 2021-06-28 00:00:23 +06:00 committed by GitHub
parent 091c77360d
commit 14ee45e4a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 3 deletions

View file

@ -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>