@friedbotstudio/create-baseline 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -3
- package/obj/template/.claude/commands/grant-push.md +19 -0
- package/obj/template/.claude/commands/init-project.md +26 -4
- package/obj/template/.claude/hooks/consent_gate_grant.mjs +107 -0
- package/obj/template/.claude/hooks/git_commit_guard.mjs +224 -0
- package/obj/template/.claude/hooks/harness_continuation.sh +101 -34
- package/obj/template/.claude/hooks/lib/common.mjs +283 -0
- package/obj/template/.claude/hooks/lib/common.sh +1 -1
- package/obj/template/.claude/hooks/memory_session_start.sh +20 -6
- package/obj/template/.claude/hooks/memory_stop.sh +161 -2
- package/obj/template/.claude/hooks/spec_approval_guard.sh +1 -1
- package/obj/template/.claude/hooks/swarm_approval_guard.sh +1 -1
- package/obj/template/.claude/hooks/tests/fixtures/ac008_byte_equal_reference.txt +7 -7
- package/obj/template/.claude/hooks/tests/fixtures/memory_stop_landmark_baseline.txt +21 -0
- package/obj/template/.claude/hooks/tests/fixtures/regenerate-ac008.sh +47 -0
- package/obj/template/.claude/hooks/tests/memory_session_start_test.sh +7 -3
- package/obj/template/.claude/hooks/tests/memory_stop_intent_test.sh +329 -0
- package/obj/template/.claude/hooks/tests/regenerate_ac008_test.sh +99 -0
- package/obj/template/.claude/memory/README.md +8 -3
- package/obj/template/.claude/memory/backlog.md +12 -0
- package/obj/template/.claude/project.json +6 -1
- package/obj/template/.claude/settings.json +3 -4
- package/obj/template/.claude/skills/audit-baseline/audit.sh +39 -21
- package/obj/template/.claude/skills/audit-baseline/tests/fixtures/_pending_opener_only.md +3 -0
- package/obj/template/.claude/skills/audit-baseline/tests/fixtures/preamble_full_empty_body.md +4 -0
- package/obj/template/.claude/skills/audit-baseline/tests/fixtures/preamble_full_with_entries.md +9 -0
- package/obj/template/.claude/skills/audit-baseline/tests/fixtures/preamble_no_opener.md +3 -0
- package/obj/template/.claude/skills/audit-baseline/tests/fixtures/preamble_opener_only.md +3 -0
- package/obj/template/.claude/skills/audit-baseline/tests/preamble_check_test.sh +147 -0
- package/obj/template/.claude/skills/chore/SKILL.md +5 -3
- package/obj/template/.claude/skills/commit/SKILL.md +5 -4
- package/obj/template/.claude/skills/copywriting/LICENSE +21 -0
- package/obj/template/.claude/skills/copywriting/NOTICE +23 -0
- package/obj/template/.claude/skills/copywriting/SKILL.md +1 -1
- package/obj/template/.claude/skills/design-ui/SKILL.md +23 -5
- package/obj/template/.claude/skills/design-ui/references/design-vs-development.md +26 -5
- package/obj/template/.claude/skills/design-ui/references/orchestration.md +1 -0
- package/obj/template/.claude/skills/design-ui/references/state-machine.md +5 -3
- package/obj/template/.claude/skills/documentation/LICENSE +202 -0
- package/obj/template/.claude/skills/documentation/NOTICE +22 -0
- package/obj/template/.claude/skills/google-analytics/SKILL.md +129 -0
- package/obj/template/.claude/skills/google-analytics/references/audiences.md +389 -0
- package/obj/template/.claude/skills/google-analytics/references/bigquery.md +470 -0
- package/obj/template/.claude/skills/google-analytics/references/custom-dimensions.md +355 -0
- package/obj/template/.claude/skills/google-analytics/references/custom-events.md +383 -0
- package/obj/template/.claude/skills/google-analytics/references/data-management.md +416 -0
- package/obj/template/.claude/skills/google-analytics/references/debugview.md +364 -0
- package/obj/template/.claude/skills/google-analytics/references/events-fundamentals.md +398 -0
- package/obj/template/.claude/skills/google-analytics/references/gtag.md +502 -0
- package/obj/template/.claude/skills/google-analytics/references/gtm-integration.md +483 -0
- package/obj/template/.claude/skills/google-analytics/references/measurement-protocol.md +519 -0
- package/obj/template/.claude/skills/google-analytics/references/privacy.md +441 -0
- package/obj/template/.claude/skills/google-analytics/references/recommended-events.md +464 -0
- package/obj/template/.claude/skills/google-analytics/references/reporting.md +397 -0
- package/obj/template/.claude/skills/google-analytics/references/setup.md +344 -0
- package/obj/template/.claude/skills/google-analytics/references/user-tracking.md +417 -0
- package/obj/template/.claude/skills/harness/SKILL.md +3 -1
- package/obj/template/.claude/skills/humanizer/LICENSE +21 -0
- package/obj/template/.claude/skills/humanizer/NOTICE +21 -0
- package/obj/template/.claude/skills/impeccable/LICENSE +202 -0
- package/obj/template/.claude/skills/impeccable/NOTICE +24 -0
- package/obj/template/.claude/skills/memory-flush/SKILL.md +20 -4
- package/obj/template/.claude/skills/memory-flush/sweep.py +74 -6
- package/obj/template/.claude/skills/memory-flush/tests/run.sh +300 -1
- package/obj/template/.claude/skills/optimize-seo/SKILL.md +313 -0
- package/obj/template/.claude/skills/optimize-seo/scripts/pagespeed.mjs +197 -0
- package/obj/template/.claude/skills/pagespeed-insights/LICENSE.md +37 -0
- package/obj/template/.claude/skills/pagespeed-insights/SKILL.md +446 -0
- package/obj/template/.claude/skills/pagespeed-insights/reference.md +50 -0
- package/obj/template/.claude/skills/tdd/SKILL.md +2 -1
- package/obj/template/.claude/skills/tdd/drift_check.py +180 -0
- package/obj/template/.claude/skills/tdd/tests/drift_check_test.sh +190 -0
- package/obj/template/.claude/skills/tdd/tests/run.sh +21 -0
- package/obj/template/.claude/skills/technical-tutorials/LICENSE +21 -0
- package/obj/template/.claude/skills/technical-tutorials/NOTICE +23 -0
- package/obj/template/.claude/skills/technical-tutorials/SKILL.md +1 -1
- package/obj/template/.claude/skills/triage/SKILL.md +8 -3
- package/obj/template/CLAUDE.md +37 -26
- package/obj/template/docs/init/seed.md +38 -23
- package/obj/template/manifest.json +80 -33
- package/package.json +1 -1
- package/src/CLAUDE.template.md +37 -26
- package/src/memory/backlog.template.md +12 -0
- package/src/project.template.json +6 -1
- package/src/seed.template.md +38 -23
- package/src/settings.template.json +3 -4
- package/obj/template/.claude/hooks/consent_gate_grant.sh +0 -89
- package/obj/template/.claude/hooks/git_commit_guard.sh +0 -93
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
# GA4 Property Setup and Installation
|
|
2
|
+
|
|
3
|
+
Complete guide for creating Google Analytics 4 accounts, properties, data streams, and installing tracking code.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Setting up Google Analytics 4 requires creating an account hierarchy, configuring data streams, and installing tracking code. This reference provides step-by-step guidance for all GA4 setup methods from initial property creation through implementation verification.
|
|
8
|
+
|
|
9
|
+
## Account Hierarchy
|
|
10
|
+
|
|
11
|
+
GA4 uses a three-level hierarchy:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
Google Account (Login credentials)
|
|
15
|
+
└── Analytics Account (Container for properties)
|
|
16
|
+
└── GA4 Property (Analytics container for website/app)
|
|
17
|
+
└── Data Stream (Platform-specific: Web, iOS, Android)
|
|
18
|
+
└── Events and Parameters
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Level Definitions
|
|
22
|
+
|
|
23
|
+
| Level | Purpose | Limit |
|
|
24
|
+
|-------|---------|-------|
|
|
25
|
+
| Analytics Account | Organisation container | 2,000 properties |
|
|
26
|
+
| GA4 Property | Website/app container | 1,000 data streams |
|
|
27
|
+
| Data Stream | Platform-specific tracking | Unique Measurement ID |
|
|
28
|
+
|
|
29
|
+
## Creating a GA4 Property
|
|
30
|
+
|
|
31
|
+
### Step 1: Navigate to Analytics
|
|
32
|
+
|
|
33
|
+
1. Go to analytics.google.com
|
|
34
|
+
2. Sign in with Google account
|
|
35
|
+
3. Click Admin (bottom-left)
|
|
36
|
+
4. Click "Create" -> "Property"
|
|
37
|
+
|
|
38
|
+
### Step 2: Configure Property Details
|
|
39
|
+
|
|
40
|
+
**Property Name:**
|
|
41
|
+
- Use descriptive name: "Main Website", "E-commerce Site"
|
|
42
|
+
- Include environment if needed: "Production Website"
|
|
43
|
+
|
|
44
|
+
**Reporting Time Zone:**
|
|
45
|
+
- Select primary business timezone
|
|
46
|
+
- Affects day boundaries in reports
|
|
47
|
+
- Cannot be changed retroactively
|
|
48
|
+
|
|
49
|
+
**Currency:**
|
|
50
|
+
- Select reporting currency (USD, EUR, GBP, AUD)
|
|
51
|
+
- All monetary values converted to this currency
|
|
52
|
+
|
|
53
|
+
### Step 3: Business Information
|
|
54
|
+
|
|
55
|
+
**Industry Category:**
|
|
56
|
+
- Select relevant industry
|
|
57
|
+
- Influences default reports and benchmarks
|
|
58
|
+
|
|
59
|
+
**Business Objectives:**
|
|
60
|
+
- Get baseline reports (recommended for beginners)
|
|
61
|
+
- Examine user behaviour
|
|
62
|
+
- Measure customer actions
|
|
63
|
+
- Get insights on customers
|
|
64
|
+
- Improve marketing ROI
|
|
65
|
+
|
|
66
|
+
### Step 4: Accept Terms
|
|
67
|
+
|
|
68
|
+
- Google Analytics Terms of Service
|
|
69
|
+
- Data Processing Amendment (GDPR)
|
|
70
|
+
- Click "Create"
|
|
71
|
+
|
|
72
|
+
## Data Stream Configuration
|
|
73
|
+
|
|
74
|
+
### Web Data Stream
|
|
75
|
+
|
|
76
|
+
**Creating the Stream:**
|
|
77
|
+
|
|
78
|
+
1. Admin -> Data Streams
|
|
79
|
+
2. Click "Add Stream"
|
|
80
|
+
3. Select "Web"
|
|
81
|
+
4. Enter website URL (example.com, not https://www.example.com)
|
|
82
|
+
5. Enter stream name ("Main Website")
|
|
83
|
+
6. Enable Enhanced Measurement (recommended)
|
|
84
|
+
7. Click "Create stream"
|
|
85
|
+
|
|
86
|
+
**Enhanced Measurement Events:**
|
|
87
|
+
|
|
88
|
+
| Event | Trigger | Toggle |
|
|
89
|
+
|-------|---------|--------|
|
|
90
|
+
| page_view | Page loads | Always on |
|
|
91
|
+
| scroll | 90% vertical scroll | Optional |
|
|
92
|
+
| click | Outbound link clicks | Optional |
|
|
93
|
+
| view_search_results | Site search | Optional |
|
|
94
|
+
| video_start/progress/complete | YouTube engagement | Optional |
|
|
95
|
+
| file_download | PDF, DOC, ZIP clicks | Optional |
|
|
96
|
+
| form_start/form_submit | Form interactions | Optional |
|
|
97
|
+
|
|
98
|
+
**Measurement ID:**
|
|
99
|
+
- Format: G-XXXXXXXXXX
|
|
100
|
+
- Location: Data Streams -> Click stream -> Top section
|
|
101
|
+
- Copy for installation
|
|
102
|
+
|
|
103
|
+
### iOS Data Stream
|
|
104
|
+
|
|
105
|
+
**Prerequisites:**
|
|
106
|
+
- Apple Developer account
|
|
107
|
+
- iOS app in development/published
|
|
108
|
+
- Firebase project (auto-created)
|
|
109
|
+
|
|
110
|
+
**Setup:**
|
|
111
|
+
|
|
112
|
+
1. Admin -> Data Streams -> Add Stream -> iOS app
|
|
113
|
+
2. Enter Bundle ID (com.company.appname)
|
|
114
|
+
3. Enter App Store ID (optional)
|
|
115
|
+
4. Click "Register app"
|
|
116
|
+
5. Download GoogleService-Info.plist
|
|
117
|
+
6. Add to Xcode project
|
|
118
|
+
|
|
119
|
+
**Firebase SDK Installation:**
|
|
120
|
+
|
|
121
|
+
```ruby
|
|
122
|
+
# Podfile
|
|
123
|
+
pod 'Firebase/Analytics'
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
```swift
|
|
127
|
+
// AppDelegate.swift
|
|
128
|
+
import Firebase
|
|
129
|
+
|
|
130
|
+
func application(_ application: UIApplication,
|
|
131
|
+
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
|
132
|
+
FirebaseApp.configure()
|
|
133
|
+
return true
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Android Data Stream
|
|
138
|
+
|
|
139
|
+
**Prerequisites:**
|
|
140
|
+
- Android Studio
|
|
141
|
+
- Android app package name
|
|
142
|
+
|
|
143
|
+
**Setup:**
|
|
144
|
+
|
|
145
|
+
1. Admin -> Data Streams -> Add Stream -> Android app
|
|
146
|
+
2. Enter package name (com.company.appname)
|
|
147
|
+
3. Click "Register app"
|
|
148
|
+
4. Download google-services.json
|
|
149
|
+
5. Place in app/ directory
|
|
150
|
+
|
|
151
|
+
**Firebase SDK Installation:**
|
|
152
|
+
|
|
153
|
+
```gradle
|
|
154
|
+
// Project build.gradle
|
|
155
|
+
buildscript {
|
|
156
|
+
dependencies {
|
|
157
|
+
classpath 'com.google.gms:google-services:4.3.15'
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// App build.gradle
|
|
162
|
+
plugins {
|
|
163
|
+
id 'com.google.gms.google-services'
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
dependencies {
|
|
167
|
+
implementation platform('com.google.firebase:firebase-bom:32.0.0')
|
|
168
|
+
implementation 'com.google.firebase:firebase-analytics'
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Installation Methods
|
|
173
|
+
|
|
174
|
+
### Method 1: CMS Plugin (Easiest)
|
|
175
|
+
|
|
176
|
+
**WordPress - Site Kit by Google:**
|
|
177
|
+
|
|
178
|
+
1. Plugins -> Add New -> Search "Site Kit by Google"
|
|
179
|
+
2. Install and Activate
|
|
180
|
+
3. Site Kit -> Start Setup
|
|
181
|
+
4. Connect Google account
|
|
182
|
+
5. Select or create GA4 property
|
|
183
|
+
6. Activate Analytics module
|
|
184
|
+
|
|
185
|
+
**Shopify:**
|
|
186
|
+
|
|
187
|
+
1. Settings -> Customer events
|
|
188
|
+
2. Add custom pixel -> Google Analytics 4
|
|
189
|
+
3. Enter Measurement ID
|
|
190
|
+
4. Save
|
|
191
|
+
|
|
192
|
+
**Wix:**
|
|
193
|
+
|
|
194
|
+
1. Settings -> Marketing & SEO -> Marketing Integrations
|
|
195
|
+
2. Google Analytics -> Connect
|
|
196
|
+
3. Sign in and select GA4 property
|
|
197
|
+
|
|
198
|
+
### Method 2: gtag.js Direct
|
|
199
|
+
|
|
200
|
+
Place in `<head>` section before other scripts:
|
|
201
|
+
|
|
202
|
+
```html
|
|
203
|
+
<!-- Google tag (gtag.js) -->
|
|
204
|
+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
|
|
205
|
+
<script>
|
|
206
|
+
window.dataLayer = window.dataLayer || [];
|
|
207
|
+
function gtag(){dataLayer.push(arguments);}
|
|
208
|
+
gtag('js', new Date());
|
|
209
|
+
gtag('config', 'G-XXXXXXXXXX');
|
|
210
|
+
</script>
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Method 3: Google Tag Manager (Recommended)
|
|
214
|
+
|
|
215
|
+
**Step 1: Install GTM Container**
|
|
216
|
+
|
|
217
|
+
Head snippet (after `<head>`):
|
|
218
|
+
```html
|
|
219
|
+
<!-- Google Tag Manager -->
|
|
220
|
+
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
|
221
|
+
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
|
222
|
+
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
223
|
+
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
|
224
|
+
})(window,document,'script','dataLayer','GTM-XXXXXXX');</script>
|
|
225
|
+
<!-- End Google Tag Manager -->
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Body snippet (after `<body>`):
|
|
229
|
+
```html
|
|
230
|
+
<!-- Google Tag Manager (noscript) -->
|
|
231
|
+
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXXX"
|
|
232
|
+
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
|
233
|
+
<!-- End Google Tag Manager (noscript) -->
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
**Step 2: Create GA4 Configuration Tag**
|
|
237
|
+
|
|
238
|
+
1. GTM -> Tags -> New
|
|
239
|
+
2. Tag Type: Google Tag
|
|
240
|
+
3. Tag ID: G-XXXXXXXXXX
|
|
241
|
+
4. Trigger: Initialisation - All Pages
|
|
242
|
+
5. Save and Publish
|
|
243
|
+
|
|
244
|
+
## Installation Verification
|
|
245
|
+
|
|
246
|
+
### Immediate Verification (0-5 minutes)
|
|
247
|
+
|
|
248
|
+
1. **Enable Debug Mode:**
|
|
249
|
+
- Install Google Analytics Debugger Chrome extension
|
|
250
|
+
- Enable extension (icon turns blue)
|
|
251
|
+
- Visit website
|
|
252
|
+
|
|
253
|
+
2. **Check DebugView:**
|
|
254
|
+
- GA4 -> Admin -> DebugView
|
|
255
|
+
- Select device from dropdown
|
|
256
|
+
- Confirm events appearing
|
|
257
|
+
|
|
258
|
+
3. **Expected Events:**
|
|
259
|
+
- session_start
|
|
260
|
+
- first_visit (new users)
|
|
261
|
+
- page_view
|
|
262
|
+
|
|
263
|
+
### Realtime Verification (5-30 minutes)
|
|
264
|
+
|
|
265
|
+
1. Reports -> Realtime
|
|
266
|
+
2. Confirm active users showing
|
|
267
|
+
3. Verify events by name
|
|
268
|
+
4. Check user location on map
|
|
269
|
+
|
|
270
|
+
### Standard Reports (24-48 hours)
|
|
271
|
+
|
|
272
|
+
Standard reports have processing delay:
|
|
273
|
+
- Reports -> Acquisition -> User acquisition
|
|
274
|
+
- Reports -> Engagement -> Events
|
|
275
|
+
- Reports -> Engagement -> Pages and screens
|
|
276
|
+
|
|
277
|
+
## Post-Setup Configuration
|
|
278
|
+
|
|
279
|
+
### Data Retention
|
|
280
|
+
|
|
281
|
+
**Location:** Admin -> Data Settings -> Data Retention
|
|
282
|
+
|
|
283
|
+
| Option | Use Case |
|
|
284
|
+
|--------|----------|
|
|
285
|
+
| 2 months | Privacy-focused, GDPR |
|
|
286
|
+
| 14 months | Year-over-year analysis |
|
|
287
|
+
|
|
288
|
+
**Reset on New Activity:** ON (recommended) - timer resets when user returns
|
|
289
|
+
|
|
290
|
+
### Internal Traffic Filter
|
|
291
|
+
|
|
292
|
+
**Location:** Admin -> Data Settings -> Data Filters
|
|
293
|
+
|
|
294
|
+
1. Create Filter -> Internal Traffic
|
|
295
|
+
2. Enter office IP addresses
|
|
296
|
+
3. Set to "Testing" first
|
|
297
|
+
4. Verify in DebugView (traffic_type = internal)
|
|
298
|
+
5. Set to "Active"
|
|
299
|
+
|
|
300
|
+
### Google Signals
|
|
301
|
+
|
|
302
|
+
**Location:** Admin -> Data Settings -> Data Collection
|
|
303
|
+
|
|
304
|
+
- Enables demographics (age, gender)
|
|
305
|
+
- Enables cross-device tracking
|
|
306
|
+
- Requires user consent for personalised ads
|
|
307
|
+
|
|
308
|
+
## Common Issues
|
|
309
|
+
|
|
310
|
+
### No Data Appearing
|
|
311
|
+
|
|
312
|
+
- Verify Measurement ID is correct
|
|
313
|
+
- Check code placement in `<head>`
|
|
314
|
+
- Disable ad blockers for testing
|
|
315
|
+
- Wait 24-48 hours for standard reports
|
|
316
|
+
|
|
317
|
+
### Data Only in DebugView
|
|
318
|
+
|
|
319
|
+
- Remove debug_mode: true from production
|
|
320
|
+
- Disable Google Analytics Debugger extension
|
|
321
|
+
- Check for internal traffic filters
|
|
322
|
+
|
|
323
|
+
### Duplicate Events
|
|
324
|
+
|
|
325
|
+
- Remove duplicate tracking implementations
|
|
326
|
+
- Choose one method: gtag.js OR GTM OR plugin
|
|
327
|
+
- Check for multiple Measurement IDs
|
|
328
|
+
|
|
329
|
+
### Wrong Timezone
|
|
330
|
+
|
|
331
|
+
- Cannot change retroactively
|
|
332
|
+
- Affects only future data
|
|
333
|
+
- Consider creating new property if critical
|
|
334
|
+
|
|
335
|
+
## Next Steps
|
|
336
|
+
|
|
337
|
+
After completing setup:
|
|
338
|
+
|
|
339
|
+
1. Configure Enhanced Measurement events
|
|
340
|
+
2. Set up internal traffic filters
|
|
341
|
+
3. Create first custom events
|
|
342
|
+
4. Register custom dimensions
|
|
343
|
+
5. Link Google Ads (if applicable)
|
|
344
|
+
6. Set up BigQuery export (for advanced analysis)
|