wiki
wiki copied to clipboard
Not all Google Analytics vars replaced
Describe the bug When i'm entering my Google Analytics tracking ID, and enable the analytics module, Google doesn't see traffic
To Reproduce Steps to reproduce the behavior:
- Add your Tracing ID
- Enable Google Analytics module in Wiki JS
- Send test traffic (you) from your Google Analytics dashboard
Expected behavior The GA dashboard should show 1 active visitor
Host Info (please complete the following information):
- OS: Docker
- Wiki.js version: 2.0.0-rc
- Database engine: MariaDB 5.5
Additional context
When i look at the source code, i see that {{propertyTrackingId}} in server/modules/analytics/google/code.yml is not properly being replaced.
Only the first instance is, resulting in this snippet:
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-12345678-1"</script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{propertyTrackingId}}');
</script>