analytics-tracking
Original:🇺🇸 English
Translated
When the user wants to set up, audit, or optimize analytics tracking (GA4, events, conversions). Also use when the user mentions "Google Analytics," "GA4," "event tracking," "conversions," "gtag," or "data layer."
3installs
Added on
NPX Install
npx skill4agent add kostja94/marketing-skills analytics-trackingTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Analytics: Tracking
Guides analytics implementation: GA4 setup, event tracking, conversions, and data quality. Applies to web and app tracking across marketing channels.
Scope
- GA4: Web data stream, gtag.js, configuration
- Events: Recommended and custom events
- Conversions: Key events, parameters
- Quality: Naming, testing, validation
GA4 Setup
Prerequisites
- Google Analytics property and web data stream
- Google tag (gtag.js) on all pages
- Measurement ID (e.g., )
G-XXXXXXXXXX
Enhanced Measurement
Enable in Admin → Data Streams → Enhanced Measurement for automatic tracking of:
- Page views, scrolls, outbound clicks
- Site search, file downloads
- Video engagement (YouTube)
Event Tracking
Event Types
| Type | Description |
|---|---|
| Automatically collected | page_view, first_visit, session_start |
| Enhanced measurement | scroll, click, file_download, etc. |
| Recommended | purchase, sign_up, search, etc. |
| Custom | Business-specific actions |
Naming Conventions
- Length: ≤40 characters
- Format: , lowercase
snake_case - Verb first: ,
download_pdf,submit_formvideo_play - Context: vs generic
pricing_page_scrollscroll
gtag.js Syntax
javascript
gtag('event', '<event_name>', {
<parameter_name>: <value>,
// e.g. value: 99.99, currency: 'USD'
});Place below the Google tag snippet. Events fire on page load or user action (e.g., button click).
Recommended Events
| Event | Use | Key Parameters |
|---|---|---|
| E-commerce | value, currency, items |
| Registration | method |
| Login | method |
| Site search | search_term |
| Product view | items |
| Add to cart | items |
Custom Events
- Focus on 15–25 meaningful events aligned with KPIs
- Add parameters for context (e.g., ,
content_type)item_id - Avoid tracking everything; prioritize quality over quantity
Conversions (Key Events)
- Mark important events as conversions in GA4 Admin
- Use for attribution, audiences, and reporting
- Typical: purchase, sign_up, lead, contact
Testing & Validation
| Tool | Use |
|---|---|
| Realtime | See events as they fire |
| DebugView | Detailed event/parameter inspection; requires debug mode |
| GA4 Debug mode | |
- Test before launch; verify parameters and naming
- Check for duplicate events, missing values
Output Format
- Event list (name, trigger, parameters)
- Implementation notes (gtag or GTM)
- Conversion mapping
- Testing checklist
Related Skills
- analytics-traffic: UTM and source attribution
- analytics-ai-traffic: AI traffic in GA4