home / skills / mikefilsaime-groove / clickcampaigns-for-claude-code-in-cursor / analytics-tracking

This skill helps you implement precise GTM and pixel tracking with data layer integration and server side configuration for privacy conscious conversion

npx playbooks add skill mikefilsaime-groove/clickcampaigns-for-claude-code-in-cursor --skill analytics-tracking

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
4.5 KB
---
name: gtm-pixels
description: This skill should be used when the user asks to "set up GTM", "install pixels", "configure tracking codes", "tag management", or mentions Google Tag Manager, Meta Pixel, or conversion tracking implementation. Creates precise, technical implementation plans for tracking tags.
---

# GTM & Pixels Implementation

Implement precise, resilient, and privacy-compliant tracking tags using Google Tag Manager (GTM) and platform-specific pixels. This skill focuses on the technical "how-to" of tag deployment, trigger logic, and data layer integration.

## Core Objectives

- Deploy a robust Google Tag Manager container (Client & Server)
- Implement platform pixels (Meta, Google, TikTok, LinkedIn) with 100% accuracy
- Configure custom events and triggers for key conversion actions
- Ensure data layer consistency across the entire funnel
- Validate tracking health using debugging tools

## Mandatory Elements

### 1. GTM Architecture
- **Container Setup:** Client-side for browser tracking, Server-side for privacy and performance.
- **Variable Governance:** Consistent naming for User IDs, Transaction IDs, and Event Names.
- **Folder Structure:** Organized by platform (e.g., [Meta], [GA4], [Ads]).

### 2. Pixel Implementation
- **Base Code:** Installation on every page via GTM.
- **Standard Events:** PageView, Lead, Purchase, AddToCart, InitiateCheckout.
- **Advanced Matching:** Securely passing hashed user data (Email, Phone) for better attribution.

## Structure & Frameworks

### Tag Deployment Workflow
1. **Audit:** Identify all current tags and conversion points.
2. **Data Layer Spec:** Define variables needed from the website code (e.g., `order_value`).
3. **Configuration:** Build Tags, Triggers, and Variables in GTM.
4. **Debug & QA:** Use GTM Preview Mode and Platform Pixel Helpers.
5. **Publish:** Version-controlled release with descriptive notes.

### Conversion API (CAPI) Strategy
**Purpose:** Bypass browser restrictions (iOS14+) by sending events directly from the server.
**Key Elements:**
- Event deduplication (Event ID matching)
- Server-side GTM (sGTM) configuration
- Direct API integrations where possible

## Voice & Tone Guidelines

- **Technical Precision:** Use exact terminology (Data Layer, Trigger, Variable).
- **Instructional:** Clear, step-by-step guidance.
- **Authoritative:** Confident in technical requirements and privacy compliance.
- **Formatting:** Code blocks for data layer snippets and tag configurations.

## Concrete Examples

### Data Layer Push for Purchase
```javascript
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
  'event': 'purchase',
  'ecommerce': {
    'transaction_id': 'T12345',
    'affiliation': 'Online Store',
    'value': 59.99,
    'currency': 'USD',
    'items': [{
      'item_name': 'Marketing Masterclass',
      'item_id': 'MM-01',
      'price': 59.99,
      'quantity': 1
    }]
  }
});
```

### Meta Pixel Lead Event (via GTM Custom HTML)
```html
<script>
  fbq('track', 'Lead', {
    content_name: '{{Page Path}}',
    content_category: 'Funnel Step 1',
    value: 10.00,
    currency: 'USD'
  });
</script>
```

## Quality Checklist

For every implementation, ask:
- [ ] Is the GTM container loading on all pages?
- [ ] Are events deduplicated between browser and server (CAPI)?
- [ ] Is hashed PII (Email/Phone) being sent correctly for Advanced Matching?
- [ ] Does the Data Layer match the technical specification?
- [ ] Have all tags been verified in GTM Preview Mode?

Overview

This skill creates precise, technical implementation plans for Google Tag Manager and platform pixels. It delivers step-by-step GTM architecture, data layer specs, tag/trigger configuration, and validation checks focused on accurate conversion tracking and privacy compliance.

How this skill works

I inspect the conversion points, current tag inventory, and site code to produce a deployable plan: data layer variables, GTM container structure (client + server), tag templates, triggers, and CAPI mapping. The output includes code snippets, debug steps (GTM Preview, pixel helpers), event deduplication rules, and publish/versioning instructions for a resilient rollout.

When to use it

  • Setting up Google Tag Manager for a new website or funnel
  • Installing or migrating Meta/Google/TikTok/LinkedIn pixels
  • Implementing server-side tracking (sGTM) or Conversion API (CAPI)
  • Standardizing data layer variables across multiple pages or environments
  • Auditing and fixing broken or duplicate conversion events

Best practices

  • Create separate GTM containers for client and server; keep consistent variable naming (user_id, transaction_id, event_name).
  • Define a single source-of-truth data layer spec before building tags; include ecommerce objects and transaction fields.
  • Use advanced matching with hashed PII for improved attribution while following privacy rules; hash on the server when possible.
  • Implement event_id deduplication between browser events and CAPI server events to prevent double-counting.
  • Use folder structure in GTM by platform and maintain version-controlled publish notes and QA checklists.

Example use cases

  • Build a GTM plan to track Purchase, Lead, AddToCart, and InitiateCheckout events across a 5-page funnel.
  • Migrate existing pixels into a single GTM container and add server-side forwarding for Facebook CAPI.
  • Create a data layer spec and code snippet for ecommerce transaction pushes to ensure consistent order_value and currency fields.
  • Implement deduplicated server-side purchase events with event_id matching and hashed email for advanced matching.
  • Run a QA checklist with GTM Preview Mode and platform pixel helpers, produce a verification report and publish instructions.

FAQ

Do you handle both client and server-side GTM?

Yes. Plans include client container setup and server-side GTM/CAPI mapping with event deduplication rules.

Will you provide code I can drop into the site?

Yes. I deliver ready-to-deploy data layer snippets, Custom HTML samples for pixel calls, and recommended tag configurations.