wiki icon indicating copy to clipboard operation
wiki copied to clipboard

Not all Google Analytics vars replaced

Open diabeeto076 opened this issue 7 years ago • 0 comments

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:

  1. Add your Tracing ID
  2. Enable Google Analytics module in Wiki JS
  3. 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>

diabeeto076 avatar Oct 23 '19 06:10 diabeeto076