Powered by MarkdownBrain

Integrating Google Analytics (GA)

Google Analytics (GA) is a powerful website traffic analysis tool. It can be easily integrated into Markdownbrain to track user activity.

Steps

1. Get GA Tracking Code

  • Log in to Google Analytics.
  • Create or select a property.
  • Copy the generated tracking code (usually gtag.js or analytics.js).

2. Add Code to config.yml

Add the following code snippet to the config.yml file. Replace GA_MEASUREMENT_ID with your actual measurement ID.

templates: ["<script async src='https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID'></script>","<script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'GA_MEASUREMENT_ID');</script>"]

Once saved, Markdownbrain will automatically load the GA tracking code and start monitoring visitor activity.

Last updated: 2025-01-06.