@friedbotstudio/create-baseline 0.1.0 → 0.2.1
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 +5 -0
- package/bin/cli.js +8 -2
- package/obj/template/.claude/skills/audit-baseline/audit.sh +11 -5
- 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/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.md +3 -3
- package/obj/template/docs/init/seed.md +2 -2
- package/obj/template/manifest.json +27 -6
- package/package.json +7 -2
- package/src/CLAUDE.template.md +3 -3
- package/src/cli/install.js +14 -4
- package/src/seed.template.md +2 -2
- package/obj/template/.claude/hooks/lib/__pycache__/resume_writer.cpython-314.pyc +0 -0
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
# GA4 DebugView Testing and Validation
|
|
2
|
+
|
|
3
|
+
Comprehensive guide to testing and validating GA4 implementation using DebugView.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
DebugView is GA4's real-time debugging tool for validating implementation, testing events, and troubleshooting tracking issues. Events appear in DebugView within seconds, enabling rapid testing before data reaches standard reports.
|
|
8
|
+
|
|
9
|
+
## Accessing DebugView
|
|
10
|
+
|
|
11
|
+
**Path:** GA4 Admin -> DebugView
|
|
12
|
+
|
|
13
|
+
**Requirements:**
|
|
14
|
+
- Debug mode enabled on website/app
|
|
15
|
+
- Events sent within last 30 minutes
|
|
16
|
+
- Active user session
|
|
17
|
+
|
|
18
|
+
## Enabling Debug Mode
|
|
19
|
+
|
|
20
|
+
### Method 1: Chrome Extension (Recommended)
|
|
21
|
+
|
|
22
|
+
1. Install "Google Analytics Debugger" from Chrome Web Store
|
|
23
|
+
2. Navigate to your website
|
|
24
|
+
3. Enable extension (icon turns blue)
|
|
25
|
+
4. Events automatically appear in DebugView
|
|
26
|
+
|
|
27
|
+
**Benefits:** Easy toggle, no code changes, works instantly
|
|
28
|
+
|
|
29
|
+
### Method 2: URL Parameter
|
|
30
|
+
|
|
31
|
+
Add `?debug_mode=true` to any URL:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
https://yourwebsite.com?debug_mode=true
|
|
35
|
+
https://yourwebsite.com/page?debug_mode=true
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Benefits:** No extension needed, works for sharing debug links
|
|
39
|
+
|
|
40
|
+
### Method 3: gtag.js Configuration
|
|
41
|
+
|
|
42
|
+
```javascript
|
|
43
|
+
gtag('config', 'G-XXXXXXXXXX', {
|
|
44
|
+
'debug_mode': true
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**Important:** Remove for production.
|
|
49
|
+
|
|
50
|
+
### Method 4: GTM Configuration
|
|
51
|
+
|
|
52
|
+
In GA4 Configuration tag:
|
|
53
|
+
1. Expand "Configuration Settings"
|
|
54
|
+
2. Add Fields to Set:
|
|
55
|
+
- Field Name: debug_mode
|
|
56
|
+
- Value: true
|
|
57
|
+
|
|
58
|
+
**Important:** Remove or use variable for production.
|
|
59
|
+
|
|
60
|
+
### Method 5: Mobile App Debug
|
|
61
|
+
|
|
62
|
+
**iOS (Xcode):**
|
|
63
|
+
1. Edit Scheme -> Arguments
|
|
64
|
+
2. Add: `-FIRDebugEnabled`
|
|
65
|
+
|
|
66
|
+
**Android (ADB):**
|
|
67
|
+
```bash
|
|
68
|
+
adb shell setprop debug.firebase.analytics.app com.example.app
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## DebugView Interface
|
|
72
|
+
|
|
73
|
+
### Device Stream (Left Panel)
|
|
74
|
+
|
|
75
|
+
- Shows active debug sessions
|
|
76
|
+
- Displays device type
|
|
77
|
+
- Lists user_pseudo_id or user_id
|
|
78
|
+
- Shows session timing
|
|
79
|
+
- Select device to view events
|
|
80
|
+
|
|
81
|
+
### Event Stream (Centre Panel)
|
|
82
|
+
|
|
83
|
+
- Real-time event list
|
|
84
|
+
- Event names with timestamps
|
|
85
|
+
- Event count per type
|
|
86
|
+
- Click event for details
|
|
87
|
+
- Chronological order
|
|
88
|
+
|
|
89
|
+
### Event Details (Right Panel)
|
|
90
|
+
|
|
91
|
+
Click any event to see:
|
|
92
|
+
- Event name
|
|
93
|
+
- Timestamp
|
|
94
|
+
- All event parameters
|
|
95
|
+
- User properties
|
|
96
|
+
- Device information
|
|
97
|
+
|
|
98
|
+
## Reading Event Data
|
|
99
|
+
|
|
100
|
+
### Event Card Information
|
|
101
|
+
|
|
102
|
+
| Element | Description |
|
|
103
|
+
|---------|-------------|
|
|
104
|
+
| Event Name | e.g., page_view, purchase |
|
|
105
|
+
| Timestamp | When event fired |
|
|
106
|
+
| Event Count | Times this event fired |
|
|
107
|
+
| Parameters | All sent parameters |
|
|
108
|
+
| User Properties | User-level attributes |
|
|
109
|
+
|
|
110
|
+
### Example Event
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
Event: purchase
|
|
114
|
+
Timestamp: 14:23:45
|
|
115
|
+
Parameters:
|
|
116
|
+
transaction_id: "T_12345"
|
|
117
|
+
value: 99.99
|
|
118
|
+
currency: "USD"
|
|
119
|
+
items: [Array with 2 items]
|
|
120
|
+
User Properties:
|
|
121
|
+
user_tier: "premium"
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Validation Workflows
|
|
125
|
+
|
|
126
|
+
### Workflow 1: New Implementation Test
|
|
127
|
+
|
|
128
|
+
1. Enable debug mode
|
|
129
|
+
2. Open DebugView
|
|
130
|
+
3. Load website page
|
|
131
|
+
4. Verify automatic events:
|
|
132
|
+
- session_start
|
|
133
|
+
- page_view
|
|
134
|
+
- first_visit (if new user)
|
|
135
|
+
5. Navigate to second page
|
|
136
|
+
6. Verify page_view fires again
|
|
137
|
+
7. Check parameters on all events
|
|
138
|
+
|
|
139
|
+
### Workflow 2: Custom Event Test
|
|
140
|
+
|
|
141
|
+
1. Enable debug mode
|
|
142
|
+
2. Open DebugView
|
|
143
|
+
3. Trigger custom event (click button, submit form)
|
|
144
|
+
4. Verify event appears with correct name
|
|
145
|
+
5. Check all expected parameters present
|
|
146
|
+
6. Verify parameter values correct
|
|
147
|
+
7. Confirm data types (number vs string)
|
|
148
|
+
|
|
149
|
+
### Workflow 3: Ecommerce Test
|
|
150
|
+
|
|
151
|
+
1. Enable debug mode
|
|
152
|
+
2. Complete purchase flow
|
|
153
|
+
3. Verify each step:
|
|
154
|
+
|
|
155
|
+
| Step | Event | Check |
|
|
156
|
+
|------|-------|-------|
|
|
157
|
+
| Product page | view_item | items array populated |
|
|
158
|
+
| Add to cart | add_to_cart | items, value, currency |
|
|
159
|
+
| Checkout | begin_checkout | items, value |
|
|
160
|
+
| Shipping | add_shipping_info | shipping_tier |
|
|
161
|
+
| Payment | add_payment_info | payment_type |
|
|
162
|
+
| Confirmation | purchase | transaction_id unique |
|
|
163
|
+
|
|
164
|
+
4. Verify items array structure
|
|
165
|
+
5. Confirm value matches cart total
|
|
166
|
+
|
|
167
|
+
### Workflow 4: GTM Integration Test
|
|
168
|
+
|
|
169
|
+
1. Enable GTM Preview mode
|
|
170
|
+
2. Enable GA4 debug mode
|
|
171
|
+
3. Trigger GTM tag
|
|
172
|
+
4. Verify in GTM Preview:
|
|
173
|
+
- Tag fires
|
|
174
|
+
- Variables populated
|
|
175
|
+
5. Verify in DebugView:
|
|
176
|
+
- Event appears
|
|
177
|
+
- Parameters match GTM
|
|
178
|
+
6. Cross-reference both tools
|
|
179
|
+
|
|
180
|
+
## Validation Checklists
|
|
181
|
+
|
|
182
|
+
### Page View Validation
|
|
183
|
+
|
|
184
|
+
- [ ] page_view event appears
|
|
185
|
+
- [ ] page_location parameter present (full URL)
|
|
186
|
+
- [ ] page_title parameter present
|
|
187
|
+
- [ ] page_referrer present (if applicable)
|
|
188
|
+
- [ ] Fires on every page navigation
|
|
189
|
+
|
|
190
|
+
### Purchase Event Validation
|
|
191
|
+
|
|
192
|
+
- [ ] purchase event fires once
|
|
193
|
+
- [ ] transaction_id is unique
|
|
194
|
+
- [ ] value parameter matches total
|
|
195
|
+
- [ ] currency parameter present (USD, EUR, etc.)
|
|
196
|
+
- [ ] items array populated
|
|
197
|
+
- [ ] Each item has item_id or item_name
|
|
198
|
+
- [ ] Each item has price and quantity
|
|
199
|
+
|
|
200
|
+
### Custom Event Validation
|
|
201
|
+
|
|
202
|
+
- [ ] Event name appears correctly
|
|
203
|
+
- [ ] Event name follows snake_case
|
|
204
|
+
- [ ] Event name under 40 characters
|
|
205
|
+
- [ ] All expected parameters present
|
|
206
|
+
- [ ] Parameter names under 40 characters
|
|
207
|
+
- [ ] Parameter values under 100 characters
|
|
208
|
+
- [ ] Correct data types (string, number)
|
|
209
|
+
- [ ] No PII in parameters
|
|
210
|
+
|
|
211
|
+
### User Properties Validation
|
|
212
|
+
|
|
213
|
+
- [ ] User properties appear in event details
|
|
214
|
+
- [ ] Property names correct
|
|
215
|
+
- [ ] Property values expected format
|
|
216
|
+
- [ ] Properties persist across events
|
|
217
|
+
|
|
218
|
+
## Troubleshooting
|
|
219
|
+
|
|
220
|
+
### Issue: Events Not Appearing
|
|
221
|
+
|
|
222
|
+
**Causes:**
|
|
223
|
+
- Debug mode not enabled
|
|
224
|
+
- Wrong GA4 property selected
|
|
225
|
+
- Events sent more than 30 minutes ago
|
|
226
|
+
- Measurement ID incorrect
|
|
227
|
+
- Ad blocker blocking
|
|
228
|
+
|
|
229
|
+
**Solutions:**
|
|
230
|
+
1. Verify debug mode enabled (extension active)
|
|
231
|
+
2. Check correct property in DebugView
|
|
232
|
+
3. Refresh page and try again
|
|
233
|
+
4. Verify Measurement ID
|
|
234
|
+
5. Disable ad blockers for testing
|
|
235
|
+
6. Try incognito mode
|
|
236
|
+
|
|
237
|
+
### Issue: Missing Parameters
|
|
238
|
+
|
|
239
|
+
**Causes:**
|
|
240
|
+
- Parameter name misspelled
|
|
241
|
+
- Value is undefined/null
|
|
242
|
+
- Data layer not populated
|
|
243
|
+
- GTM variable not firing
|
|
244
|
+
|
|
245
|
+
**Solutions:**
|
|
246
|
+
1. Check exact parameter name (case-sensitive)
|
|
247
|
+
2. Validate value before sending
|
|
248
|
+
3. Check GTM Preview for data layer
|
|
249
|
+
4. Verify GTM variable configuration
|
|
250
|
+
|
|
251
|
+
### Issue: Wrong Parameter Values
|
|
252
|
+
|
|
253
|
+
**Causes:**
|
|
254
|
+
- Incorrect data type (string vs number)
|
|
255
|
+
- Variable mapping wrong in GTM
|
|
256
|
+
- JavaScript returning wrong value
|
|
257
|
+
- Encoding issues
|
|
258
|
+
|
|
259
|
+
**Solutions:**
|
|
260
|
+
1. Check data type expectations
|
|
261
|
+
2. Verify GTM variable mapping
|
|
262
|
+
3. Console.log values before sending
|
|
263
|
+
4. Check for special character issues
|
|
264
|
+
|
|
265
|
+
### Issue: Duplicate Events
|
|
266
|
+
|
|
267
|
+
**Causes:**
|
|
268
|
+
- Multiple tags firing for same event
|
|
269
|
+
- Both gtag.js AND GTM installed
|
|
270
|
+
- Trigger firing multiple times
|
|
271
|
+
- Event pushed to data layer twice
|
|
272
|
+
|
|
273
|
+
**Solutions:**
|
|
274
|
+
1. Check for duplicate GTM tags
|
|
275
|
+
2. Choose one implementation method
|
|
276
|
+
3. Add trigger conditions to prevent duplicates
|
|
277
|
+
4. Debug data layer pushes
|
|
278
|
+
|
|
279
|
+
### Issue: Events in DebugView but Not Reports
|
|
280
|
+
|
|
281
|
+
**Expected:** Standard reports have 24-48 hour delay
|
|
282
|
+
|
|
283
|
+
**If persistent:**
|
|
284
|
+
1. Check Realtime reports (faster)
|
|
285
|
+
2. Verify event count meets threshold
|
|
286
|
+
3. Check data retention settings
|
|
287
|
+
4. Confirm no filters blocking data
|
|
288
|
+
|
|
289
|
+
## Testing User Properties
|
|
290
|
+
|
|
291
|
+
### Set User Properties
|
|
292
|
+
|
|
293
|
+
```javascript
|
|
294
|
+
gtag('set', 'user_properties', {
|
|
295
|
+
'user_tier': 'premium',
|
|
296
|
+
'account_age_days': 365
|
|
297
|
+
});
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### Verify in DebugView
|
|
301
|
+
|
|
302
|
+
1. Click any event in stream
|
|
303
|
+
2. Scroll to User Properties section
|
|
304
|
+
3. Verify properties appear
|
|
305
|
+
4. Check values correct
|
|
306
|
+
5. Confirm properties persist across events
|
|
307
|
+
|
|
308
|
+
## Best Practices
|
|
309
|
+
|
|
310
|
+
### Before Launch
|
|
311
|
+
|
|
312
|
+
- [ ] Test all critical events (purchase, sign_up)
|
|
313
|
+
- [ ] Verify on multiple browsers
|
|
314
|
+
- [ ] Test on mobile devices
|
|
315
|
+
- [ ] Check in incognito mode
|
|
316
|
+
- [ ] Test with new vs returning users
|
|
317
|
+
- [ ] Verify consent mode behaviour
|
|
318
|
+
|
|
319
|
+
### During Development
|
|
320
|
+
|
|
321
|
+
- [ ] Test each new event immediately
|
|
322
|
+
- [ ] Use DebugView + GTM Preview together
|
|
323
|
+
- [ ] Document expected vs actual
|
|
324
|
+
- [ ] Screenshot issues for team
|
|
325
|
+
- [ ] Test edge cases
|
|
326
|
+
|
|
327
|
+
### After Launch
|
|
328
|
+
|
|
329
|
+
- [ ] Monitor DebugView first 30 minutes
|
|
330
|
+
- [ ] Check for unexpected duplicates
|
|
331
|
+
- [ ] Verify volumes match expectations
|
|
332
|
+
- [ ] Confirm in standard reports (24-48 hours)
|
|
333
|
+
|
|
334
|
+
## Quick Reference
|
|
335
|
+
|
|
336
|
+
### Enable Debug Mode
|
|
337
|
+
|
|
338
|
+
| Method | How |
|
|
339
|
+
|--------|-----|
|
|
340
|
+
| Chrome extension | Install and enable |
|
|
341
|
+
| URL parameter | ?debug_mode=true |
|
|
342
|
+
| gtag.js | debug_mode: true |
|
|
343
|
+
| GTM | Add debug_mode field |
|
|
344
|
+
|
|
345
|
+
### Access DebugView
|
|
346
|
+
|
|
347
|
+
Admin -> DebugView
|
|
348
|
+
|
|
349
|
+
### Key Checks
|
|
350
|
+
|
|
351
|
+
- Event names: max 40 characters, snake_case
|
|
352
|
+
- Parameters: max 25 per event
|
|
353
|
+
- Parameter names: max 40 characters
|
|
354
|
+
- Parameter values: max 100 characters
|
|
355
|
+
- No PII in any fields
|
|
356
|
+
- Unique transaction_id for purchases
|
|
357
|
+
|
|
358
|
+
### Event Lifecycle
|
|
359
|
+
|
|
360
|
+
1. User action triggers event
|
|
361
|
+
2. Event sent to GA4
|
|
362
|
+
3. Appears in DebugView (seconds)
|
|
363
|
+
4. Appears in Realtime (30 seconds)
|
|
364
|
+
5. Appears in standard reports (24-48 hours)
|