analytics-tracking
Scannednpx machina-cli add skill kostja94/marketing-skills/tracking --openclawAnalytics: Tracking
Guides analytics implementation: GA4 setup, event tracking, conversions, and data quality. Applies to web and app tracking across marketing channels.
When invoking: On first use, if helpful, open with 1-2 sentences on what this skill covers and why it matters, then provide the main output. On subsequent use or when the user asks to skip, go directly to the main output.
User ID
- Purpose: Cross-device, cross-session user identification
- Implementation: Set
user_idwhen user is identified (e.g., login); send to GA4 - Benefit: Accurate attribution across sessions; better audience building
CTA Attribution (Article ROI)
Track CTA clicks on key articles to measure content ROI:
| Action | Purpose |
|---|---|
| Event per CTA | e.g., cta_click with content_url, content_type |
| Conversion | Mark as conversion in GA4 for attribution |
| Use | Compare high vs low performers; optimize CTA placement and copy |
See seo-monitoring for article database and benchmark context.
Scope
- GA4: Web data stream, gtag.js, configuration
- User ID: Cross-device, cross-session identification
- CTA attribution: Per-article conversion tracking for content ROI
- 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: <=60 characters
- Format:
snake_case, lowercase - Verb first:
download_pdf,submit_form,video_play - Context:
pricing_page_scrollvs genericscroll
gtag.js Syntax
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 |
|---|---|---|
purchase | E-commerce | value, currency, items |
sign_up | Registration | method |
login | Login | method |
search | Site search | search_term |
view_item | Product view | items |
add_to_cart | 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 | gtag('config', 'G-XXX', { 'debug_mode': true }); or GTM preview |
- 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
- traffic-analysis: UTM and source attribution
- ai-traffic-tracking: AI traffic in GA4
- google-search-console: GSC analysis (correlate with GA4)
- seo-monitoring: Article database, benchmark, full SEO monitoring framework
Source
git clone https://github.com/kostja94/marketing-skills/blob/main/skills/analytics/tracking/SKILL.mdView on GitHub Overview
Guides analytics implementation for GA4 setup, event tracking, conversions, and data quality. It covers web and app tracking across marketing channels.
How This Skill Works
Configures GA4 via gtag.js, defines an event taxonomy (automatic, enhanced, recommended, custom), and sets up conversions and User ID for cross-device attribution. Emphasizes naming standards and validation to ensure accurate data and attribution.
When to Use It
- You’re setting up GA4 for a new website or app.
- You need to audit or fix existing event tracking for accuracy.
- You want to implement CTA attribution to measure content ROI.
- You’re configuring cross-device tracking with User ID.
- You’re validating naming conventions, parameters, and data quality.
Quick Start
- Step 1: Create a GA4 property, add a web data stream, and install gtag.js with your Measurement ID.
- Step 2: Define event taxonomy (automatic, enhanced, recommended, custom) and set up conversions.
- Step 3: Validate with Real-time, DebugView, and GA4 Debug mode; verify naming and parameters.
Best Practices
- Define concise event names using snake_case, lowercase, and <=60 chars.
- Use a mix of automatically collected, enhanced, recommended, and meaningful custom events.
- Attach key parameters to events (e.g., content_type, item_id, value, currency).
- Test before launch with Real-time, DebugView, and GA4 Debug mode.
- Mark important events as conversions in GA4 Admin and monitor attribution.
Example Use Cases
- Set up GA4 with a web data stream and install gtag.js on all pages.
- Implement core events: purchase, sign_up, view_item, add_to_cart.
- Configure CTA attribution by tracking cta_click events with content_url and content_type.
- Enable and use User ID tracking for cross-device attribution.
- Use Enhanced Measurement to auto-track page_views, scrolls, and video engagement.