Update GA4 for public

This commit is contained in:
Paulo Gustavo Veiga
2022-05-29 21:47:44 -07:00
parent 1290261966
commit b44ace6992
2 changed files with 14 additions and 17 deletions

View File

@@ -19,7 +19,20 @@
var locale = '${locale}';
var isAuth = ${principal != null};
</script>
<%@ include file="/jsp/googleAnalytics.jsf" %>
<c:if test="${requestScope['google.analytics.enabled']}">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id='${requestScope['google.analytics.account']}'"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${requestScope['google.analytics.account']}',
{
'page_title' : 'Public - ${mindmap.id}'
});
</script>
</c:if>
</head>
<body>