pages/ANALYTICS.md
George 25b758805c
Added copilot instructions, AGENTS.md, improved README files (#3486)
This pull request introduces several documentation improvements and adds
comprehensive Copilot and agent instruction files to the al-folio
repository. The most significant changes are the addition of
repository-wide and path-specific Copilot instructions, updates to agent
documentation to reference these instructions, and improvements to the
documentation structure and clarity regarding file purposes and
workflows.

**Copilot and Agent Instruction Enhancements:**

- Added a new `.github/copilot-instructions.md` file providing detailed,
repository-wide setup, build, CI/CD, troubleshooting, and file format
guidance for Copilot coding agents.
- Introduced `.github/instructions/bibtex-bibliography.instructions.md`
with specific instructions for editing and validating BibTeX files,
including custom keywords, formatting rules, and integration with
Jekyll-Scholar.
- Updated agent documentation files (`customize.agent.md`,
`docs.agent.md`) to reference the new Copilot instruction files and
explain their purpose and usage for both repository-wide and
path-specific scenarios.
[[1]](diffhunk://#diff-15864f2655921f50a97689076e3b8feba0da320463750845be6a76eb2e30bfe4L57-R65)
[[2]](diffhunk://#diff-15864f2655921f50a97689076e3b8feba0da320463750845be6a76eb2e30bfe4L107-R122)
[[3]](diffhunk://#diff-961a46180ce568ce43c20bf7129dc5e4926a9aa4e0d7bc19926ca5ee3ff95cd0L49-R51)
[[4]](diffhunk://#diff-961a46180ce568ce43c20bf7129dc5e4926a9aa4e0d7bc19926ca5ee3ff95cd0L106-R137)

**Documentation Structure and Clarity Improvements:**

- Clarified and reorganized the documentation file list in agent files,
removing references to deprecated or merged files (e.g.,
`MAINTENANCE.md`, `ACCESSIBILITY.md`) and updating descriptions to
reflect current usage.
[[1]](diffhunk://#diff-15864f2655921f50a97689076e3b8feba0da320463750845be6a76eb2e30bfe4L57-R65)
[[2]](diffhunk://#diff-961a46180ce568ce43c20bf7129dc5e4926a9aa4e0d7bc19926ca5ee3ff95cd0L21-R21)
[[3]](diffhunk://#diff-961a46180ce568ce43c20bf7129dc5e4926a9aa4e0d7bc19926ca5ee3ff95cd0L106-R137)
- Enhanced documentation on the purpose and application of each
documentation file, and added detailed explanations of Copilot
instruction files and their role in project development.

**Workflow and Validation Updates:**

- Updated references and descriptions for GitHub Actions workflows in
agent documentation to include the Copilot environment setup and clarify
pre-commit and CI/CD requirements.
[[1]](diffhunk://#diff-15864f2655921f50a97689076e3b8feba0da320463750845be6a76eb2e30bfe4L57-R65)
[[2]](diffhunk://#diff-961a46180ce568ce43c20bf7129dc5e4926a9aa4e0d7bc19926ca5ee3ff95cd0L49-R51)
- Corrected references for accessibility guidance, now directing users
to `TROUBLESHOOTING.md` instead of the removed `ACCESSIBILITY.md`.

These changes collectively improve the onboarding experience for both
human contributors and AI agents, ensuring consistent adherence to
project conventions and reducing errors.

**References:**  

[[1]](diffhunk://#diff-227c2c26cb2ee0ce0f46a320fc48fbcbdf21801a57f59161b1d0861e8aad55f5R1-R253)
[[2]](diffhunk://#diff-6fd2827fb8d9c2dd6dc973572201853487ecbbd1120b00425d4f1c21dfdcf35fR1-R174)
[[3]](diffhunk://#diff-15864f2655921f50a97689076e3b8feba0da320463750845be6a76eb2e30bfe4L57-R65)
[[4]](diffhunk://#diff-15864f2655921f50a97689076e3b8feba0da320463750845be6a76eb2e30bfe4L107-R122)
[[5]](diffhunk://#diff-15864f2655921f50a97689076e3b8feba0da320463750845be6a76eb2e30bfe4L550-R562)
[[6]](diffhunk://#diff-961a46180ce568ce43c20bf7129dc5e4926a9aa4e0d7bc19926ca5ee3ff95cd0L21-R21)
[[7]](diffhunk://#diff-961a46180ce568ce43c20bf7129dc5e4926a9aa4e0d7bc19926ca5ee3ff95cd0L49-R51)
[[8]](diffhunk://#diff-961a46180ce568ce43c20bf7129dc5e4926a9aa4e0d7bc19926ca5ee3ff95cd0L106-R137)

---------

Signed-off-by: George Araújo <george.gcac@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-28 22:55:05 -03:00

187 lines
5.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Analytics Setup Guide
This guide helps you add website analytics to track visitor statistics and behavior.
<!--ts-->
- [Analytics Setup Guide](#analytics-setup-guide)
- [Overview](#overview)
- [Supported Analytics Services](#supported-analytics-services)
- [Google Analytics](#google-analytics)
- [Setup Steps](#setup-steps)
- [Privacy-Friendly Alternatives](#privacy-friendly-alternatives)
- [Pirsch Analytics](#pirsch-analytics)
- [Openpanel Analytics](#openpanel-analytics)
- [Monitoring \& Performance](#monitoring--performance)
- [Cronitor](#cronitor)
- [GDPR and Privacy Considerations](#gdpr-and-privacy-considerations)
- [GDPR Checklist](#gdpr-checklist)
- [Privacy-first services (No GDPR cookie banner needed)](#privacy-first-services-no-gdpr-cookie-banner-needed)
- [Services requiring cookie consent](#services-requiring-cookie-consent)
- [Comparing Analytics Services](#comparing-analytics-services)
- [Next Steps](#next-steps)
<!--te-->
## Overview
Analytics help you understand your website visitors: where they come from, which pages they visit, and how they interact with your content. al-folio supports several analytics providers that you can enable in `_config.yml`.
## Supported Analytics Services
Currently implemented in al-folio:
- **Google Analytics** Free, feature-rich, but collects user data
- **Pirsch Analytics** GDPR-compliant, free tier available, European servers
- **Openpanel Analytics** Open-source option, privacy-focused
- **Cronitor** Uptime monitoring with Real User Monitoring (RUM) analytics
---
## Google Analytics
Google Analytics is free and widely used. It provides detailed insights into visitor behavior.
### Setup Steps
1. **Create a Google Analytics account:**
- Visit [Google Analytics](https://analytics.google.com)
- Sign in with your Google account
- Click **Start measuring****Create account**
2. **Create a property for your website:**
- Enter your website name and URL
- Accept terms and continue
- Choose your timezone and currency
3. **Get your Measurement ID:**
- In the left sidebar, go to **Admin****Properties**
- Click **Data Streams****Web** (or your existing stream)
- Copy the **Measurement ID** (format: `G-XXXXXXXXXX`)
4. **Enable in your site:**
- Open `_config.yml` in your repository
- Set `enable_google_analytics: true`
- Add your Measurement ID: `google_analytics: G-XXXXXXXXXX`
- Commit and push
5. **Verify it's working:**
- Visit your website
- Go back to Google Analytics → **Real-time** tab
- You should see your visit appear within a few seconds
**Note:** Google Analytics takes 24-48 hours to start showing data trends.
---
## Privacy-Friendly Alternatives
If you're concerned about user privacy or GDPR compliance, consider these alternatives:
### Pirsch Analytics
**Best for:** GDPR-compliant analytics without complex setup
**Features:**
- ✅ GDPR compliant
- ✅ European servers
- ✅ Free tier available
- ✅ Simple integration
- ✅ No cookie consent needed
**Setup:**
1. Sign up at [Pirsch.io](https://pirsch.io)
2. Add your domain
3. Copy the tracking code
4. In `_config.yml`, set `enable_pirsch_analytics: true`
5. Add your Site ID: `pirsch_analytics: YOUR_SITE_ID` (format: 32 characters)
6. Commit and push
(The site ID appears in your Pirsch dashboard.)
---
### Openpanel Analytics
**Best for:** Open-source and privacy-conscious developers
**Features:**
- ✅ Open-source
- ✅ Self-hosted option available
- ✅ Privacy-focused
- ✅ Modern dashboard
**Setup:**
1. Sign up at [Openpanel.dev](https://openpanel.dev)
2. Create a project for your website
3. Get your **Client ID**
4. In `_config.yml`, set `enable_openpanel_analytics: true`
5. Add your Client ID: `openpanel_analytics: YOUR_CLIENT_ID` (format: UUID)
6. Commit and push
---
## Monitoring & Performance
### Cronitor
Cronitor is an **uptime monitoring** service with RUM (Real User Monitoring) analytics.
**Best for:** Tracking if your site is online + basic performance metrics
**Setup:**
1. Create account at [Cronitor.io](https://cronitor.io)
2. Get your **Site ID**
3. In `_config.yml`, set `enable_cronitor_analytics: true`
4. Add your Site ID: `cronitor_analytics: YOUR_SITE_ID`
5. Commit and push
---
## GDPR and Privacy Considerations
If you're in the European Union or serve EU visitors, consider GDPR requirements:
### GDPR Checklist
- [ ] If using Google Analytics: Add cookie consent banner
- [ ] Display a privacy policy explaining what analytics you use
- [ ] Allow users to opt-out if using tracking cookies
- [ ] Use privacy-first alternatives when possible
### Privacy-first services (No GDPR cookie banner needed)
- ✅ Pirsch Analytics
- ✅ Openpanel Analytics
### Services requiring cookie consent
- ❌ Google Analytics (EU users must consent first)
- ❌ Cronitor (collects user data via RUM)
---
## Comparing Analytics Services
| Service | Free | GDPR | Setup | Features | Best for |
| -------------------- | ------------ | ------------------- | ------ | ---------------- | -------------------------- |
| **Google Analytics** | ✅ | ⚠️ Requires consent | Easy | Detailed reports | Detailed tracking |
| **Pirsch** | ✅ Free tier | ✅ | Easy | Balanced | GDPR compliance |
| **Openpanel** | ✅ | ✅ | Medium | Modern dashboard | Privacy-focused developers |
| **Cronitor** | Paid | ⚠️ Requires consent | Easy | Uptime + RUM | Uptime monitoring |
---
## Next Steps
1. **Choose a service** based on your needs (privacy, features, budget)
2. **Follow the setup guide** for your chosen service
3. **Verify it's working** by visiting your site and checking the analytics dashboard
For more customization help, see [CUSTOMIZE.md](CUSTOMIZE.md).