Skip to content

Not all Google Analytics vars replaced #1129

Description

@diabeeto076

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>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions