Skip to content

Commit c340e21

Browse files
committed
Add Google Analytics 4 (gtag.js) to every page
Inject the GA4 tag into the shared <head> template in build.mjs so all 82 generated pages (index, sections, 69 scheme pages, 404) load gtag.js. The measurement ID is read from site.config.json (analyticsId), so the tag is data-driven and can be swapped or removed without touching code. Rebuilt docs/ so the change ships to gh-pages, which the deploy workflow publishes directly from the committed docs/ tree (it does not run the build). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X6LKmrSNzEKyhKQ9EZn32X
1 parent f688ec7 commit c340e21

84 files changed

Lines changed: 756 additions & 1 deletion

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,21 @@ const themeBoot = `<script>(function(){var t;try{t=localStorage.getItem("playboo
273273
if(t!=="light"&&t!=="dark"){t=window.matchMedia&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}
274274
document.documentElement.setAttribute("data-theme",t)})();</script>`;
275275

276+
/* Google Analytics 4 (gtag.js). Measurement ID lives in site.config.json
277+
(analyticsId); omit it there to build the site without the tag. */
278+
const GA_MEASUREMENT_ID = CONFIG.analyticsId || "";
279+
const analyticsTag = GA_MEASUREMENT_ID
280+
? `<!-- Google tag (gtag.js) -->
281+
<script async src="https://www.googletagmanager.com/gtag/js?id=${GA_MEASUREMENT_ID}"></script>
282+
<script>
283+
window.dataLayer = window.dataLayer || [];
284+
function gtag(){dataLayer.push(arguments);}
285+
gtag('js', new Date());
286+
287+
gtag('config', '${GA_MEASUREMENT_ID}');
288+
</script>`
289+
: "";
290+
276291
const brandParts = SITE_NAME.split(" ");
277292
const brandMain = brandParts.length > 1 ? brandParts.slice(0, -1).join(" ") : SITE_NAME;
278293
const brandThin = brandParts.length > 1 ? brandParts[brandParts.length - 1] : "";
@@ -284,6 +299,7 @@ function shell({ root, active, title, description, body, extraHead = "", pageCla
284299
<head>
285300
<meta charset="utf-8">
286301
<meta name="viewport" content="width=device-width, initial-scale=1">
302+
${analyticsTag}
287303
<title>${esc(fullTitle)}</title>
288304
<meta name="description" content="${attr(description)}">
289305
<meta name="color-scheme" content="light dark">

docs/404.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<!-- Google tag (gtag.js) -->
7+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-4993PH3ZP5"></script>
8+
<script>
9+
window.dataLayer = window.dataLayer || [];
10+
function gtag(){dataLayer.push(arguments);}
11+
gtag('js', new Date());
12+
13+
gtag('config', 'G-4993PH3ZP5');
14+
</script>
615
<title>Page not found · Startup Schemes Playbook</title>
716
<meta name="description" content="Page not found.">
817
<meta name="color-scheme" content="light dark">

docs/about.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<!-- Google tag (gtag.js) -->
7+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-4993PH3ZP5"></script>
8+
<script>
9+
window.dataLayer = window.dataLayer || [];
10+
function gtag(){dataLayer.push(arguments);}
11+
gtag('js', new Date());
12+
13+
gtag('config', 'G-4993PH3ZP5');
14+
</script>
615
<title>About &amp; Disclaimer · Startup Schemes Playbook</title>
716
<meta name="description" content="About the Government of India startup schemes playbook (June 2026) and this site — objective, audience, structure and disclaimer.">
817
<meta name="color-scheme" content="light dark">

docs/compare.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<!-- Google tag (gtag.js) -->
7+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-4993PH3ZP5"></script>
8+
<script>
9+
window.dataLayer = window.dataLayer || [];
10+
function gtag(){dataLayer.push(arguments);}
11+
gtag('js', new Date());
12+
13+
gtag('config', 'G-4993PH3ZP5');
14+
</script>
615
<title>Compare Schemes · Startup Schemes Playbook</title>
716
<meta name="description" content="Compare Indian government startup schemes side by side — eligibility, benefits, funding amounts and how to apply.">
817
<meta name="color-scheme" content="light dark">

docs/directory.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<!-- Google tag (gtag.js) -->
7+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-4993PH3ZP5"></script>
8+
<script>
9+
window.dataLayer = window.dataLayer || [];
10+
function gtag(){dataLayer.push(arguments);}
11+
gtag('js', new Date());
12+
13+
gtag('config', 'G-4993PH3ZP5');
14+
</script>
615
<title>All Schemes · Startup Schemes Playbook</title>
716
<meta name="description" content="Browse and filter all 69 central government schemes for Indian startups by support type, stage, sector and audience.">
817
<meta name="color-scheme" content="light dark">

docs/finder.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<!-- Google tag (gtag.js) -->
7+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-4993PH3ZP5"></script>
8+
<script>
9+
window.dataLayer = window.dataLayer || [];
10+
function gtag(){dataLayer.push(arguments);}
11+
gtag('js', new Date());
12+
13+
gtag('config', 'G-4993PH3ZP5');
14+
</script>
615
<title>Scheme Finder · Startup Schemes Playbook</title>
716
<meta name="description" content="Answer 5 questions about your startup&#39;s stage, needs and sector to get a personalised shortlist of government schemes.">
817
<meta name="color-scheme" content="light dark">

docs/glossary.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<!-- Google tag (gtag.js) -->
7+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-4993PH3ZP5"></script>
8+
<script>
9+
window.dataLayer = window.dataLayer || [];
10+
function gtag(){dataLayer.push(arguments);}
11+
gtag('js', new Date());
12+
13+
gtag('config', 'G-4993PH3ZP5');
14+
</script>
615
<title>Glossary · Startup Schemes Playbook</title>
716
<meta name="description" content="Definitions and abbreviations from the Government of India startup schemes playbook — DPIIT recognition, incubators, AIFs and more.">
817
<meta name="color-scheme" content="light dark">

docs/incubators.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<!-- Google tag (gtag.js) -->
7+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-4993PH3ZP5"></script>
8+
<script>
9+
window.dataLayer = window.dataLayer || [];
10+
function gtag(){dataLayer.push(arguments);}
11+
gtag('js', new Date());
12+
13+
gtag('config', 'G-4993PH3ZP5');
14+
</script>
615
<title>Incubators Directory · Startup Schemes Playbook</title>
716
<meta name="description" content="A searchable, mappable directory of 224 technology business incubators, Atal Incubation Centres and startup hubs across 32 Indian states and union territories — with locations, websites and contacts.">
817
<meta name="color-scheme" content="light dark">

docs/index.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<!-- Google tag (gtag.js) -->
7+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-4993PH3ZP5"></script>
8+
<script>
9+
window.dataLayer = window.dataLayer || [];
10+
function gtag(){dataLayer.push(arguments);}
11+
gtag('js', new Date());
12+
13+
gtag('config', 'G-4993PH3ZP5');
14+
</script>
615
<title>Startup Schemes Playbook — Government Schemes for Indian Startups</title>
716
<meta name="description" content="69 Government of India schemes for startups — grants, equity, loans, incubation and market access — searchable, filterable and explained in plain English.">
817
<meta name="color-scheme" content="light dark">

docs/lifecycle.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<!-- Google tag (gtag.js) -->
7+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-4993PH3ZP5"></script>
8+
<script>
9+
window.dataLayer = window.dataLayer || [];
10+
function gtag(){dataLayer.push(arguments);}
11+
gtag('js', new Date());
12+
13+
gtag('config', 'G-4993PH3ZP5');
14+
</script>
615
<title>Startup Lifecycle Map · Startup Schemes Playbook</title>
716
<meta name="description" content="See which government schemes fit each stage of your startup journey — from ideation to growth and market access.">
817
<meta name="color-scheme" content="light dark">

0 commit comments

Comments
 (0)