Technical settings
Connect Analytics
The starter does not ship with tracking scripts enabled. Add optional ID fields to site config, then inject scripts once in BaseLayout so every page is covered.
Step 1: Add IDs to site.ts
Extend src/config/site.ts with empty strings until you have real IDs from each platform:
export const site = {
name: "Acme Clinic",
url: "https://www.acmeclinic.com",
// …existing fields
gtmId: "GTM-XXXXXXX", // Google Tag Manager
clarityId: "", // Microsoft Clarity project ID
metaPixelId: "", // Meta (Facebook) Pixel
} as const;
Step 2: Load in BaseLayout
In src/layouts/BaseLayout.astro inside <head>, add scripts only when an ID is set. Leave empty strings in site.ts to disable a tool.
- GTM — Official snippet from tagmanager.google.com
- Clarity — clarity.ms script with your project ID
- Meta Pixel — fbevents.js with pixel ID
Privacy note
If you use analytics, mention it in your privacy policy page and comply with cookie consent rules in your region.