RAG Chunking & Vector Embedding Benchmark Diagnostic
Interactive decision checklist and benchmarking guide for retrieval-augmented generation. Evaluates chunk size, overlap ratios, and re-ranking pipelines.
GA4 & Server-Side Tagging Health Check Suite
Progress is saved locally in your browser. Complete each checkpoint to calculate your audit score and export a compliance report.
1. Property Configuration & Governance
Core GA4 data stream setup, retention limits, and BigQuery export linkage.
Default is 2 months. Change to 14 months in Admin > Data Settings > Data Retention.
Ensure raw unthresholded event tables stream to BigQuery GCP project.
Set Reporting Identity to Device-based or Blended to avoid 100% thresholding on low-volume custom dimensions.
Traffic filters set to Active to exclude office and staging hits from production views.
Domains listed in Data Stream > More Tagging Settings > Configure your domains.
2. Data Layer & Event Architecture
Timing, casing and dataLayer structure verification.
window.dataLayer = window.dataLayer || [] declared in head before gtm.js loads.
All custom event names and parameters use lowercase snake_case (no camelCase or spaces).
Single-page app route changes do not fire native and manual page_views simultaneously.
Items array contains item_id, item_name, price, quantity, and item_category as strings/numbers.
Purchase event deduplicated in sGTM and GA4 to prevent repeat counts on order confirmation refreshes.
3. Enhanced Conversions & Consent Mode v2
First-party data normalisation and DMA compliance signals.
gtag("consent", "default", { ad_storage: "denied", ... }) executes before container loads.
Consent update push verified in Tag Assistant with correct gcd parameter.
Email lowercased and trimmed, phone in E.164 (+61...) before hashing.
Meta CAPI and Google Ads match browser and server hits with identical event_id.
Balancing Chunk Size against Retrieval Precision
Oversized chunks dilute vector specificity, while undersized chunks lose narrative context. Setting chunk sizes between 400 and 600 tokens with 10% overlap balances retrieval accuracy and context density.
Implementation Code & Script
Splits long documents on semantic paragraph boundaries while maintaining context overlap.
export function semanticChunkDocument(text: string, maxTokens: number = 500, overlap: number = 50): string[] {
const paragraphs = text.split(/\n\n+/);
const chunks: string[] = [];
let currentChunk = '';
for (const para of paragraphs) {
if ((currentChunk + ' ' + para).length > maxTokens * 4) {
if (currentChunk) chunks.push(currentChunk.trim());
currentChunk = currentChunk.slice(-overlap * 4) + '\n\n' + para;
} else {
currentChunk = currentChunk ? currentChunk + '\n\n' + para : para;
}
}
if (currentChunk.trim()) chunks.push(currentChunk.trim());
return chunks;
}How to cite and attribute this tool
MIT LicenceThis resource is free, open and un-gated under the MIT Open Source Licence. You are encouraged to use, integrate and cite it with attribution:
@misc{geraghty_rag_chunking_embedding_benchmark,
author = {Geraghty, Gordon},
title = {RAG Chunking & Vector Embedding Benchmark Diagnostic},
year = {2026},
url = {https://gordongeraghty.com/resources/ai-engineering/rag-chunking-embedding-benchmark},
note = {Head of Performance, Empire Amplify}
}Changelog & Version History
v1.0.0Initial release of interactive RAG benchmarking scorecard.