1P Tagging & Analytics skill

Set up first-party tracking and analytics — website pixels, conversion tracking, UTM architecture, cookie consent, server-side tagging vs client-side, 1P vs 3P data strategy, and identity resolution.

by LeadMagic·MIT license·★ 62 Stars on the repo·GitHub ↗

Use now

Inside this skill

SKILL.md · the author's own words
# 1P Tagging & Analytics

## Overview

Third-party cookies are dead. Apple ITP, Firefox ETP, and Chrome's phase-out
have made browser-based tracking unreliable. The future is first-party data
and server-side measurement — data your customers intentionally share with you
that survives ad blockers, cookie restrictions, and platform changes.

This skill covers the complete measurement stack: 1P vs 3P strategy, pixel
implementation, UTM architecture, server-side tagging, consent management,
and identity resolution. The output is a privacy-resilient analytics
infrastructure that works when cookies don't.

## Authoritative Foundations
- **Google Tag Manager — Server-side tagging** — Route tags through a first-party server container so conversion data survives browser rest…

Word-for-word excerpt, not a result. Read the full SKILL.md ↓

Files of 1P Tagging & Analytics

LeadMagic/main1 file shown
SKILL.md
Show the full text242 lines

1P Tagging & Analytics

Overview

Third-party cookies are dead. Apple ITP, Firefox ETP, and Chrome's phase-out have made browser-based tracking unreliable. The future is first-party data and server-side measurement — data your customers intentionally share with you that survives ad blockers, cookie restrictions, and platform changes.

This skill covers the complete measurement stack: 1P vs 3P strategy, pixel implementation, UTM architecture, server-side tagging, consent management, and identity resolution. The output is a privacy-resilient analytics infrastructure that works when cookies don't.

Authoritative Foundations

  • Google Tag Manager — Server-side tagging — Route tags through a first-party server container so conversion data survives browser restrictions and you control exactly what leaves your domain.
  • Meta Conversions API — Send server events alongside the pixel with a shared event_id so Meta deduplicates them and recovers conversions lost to browser blocking.
  • Google Ads — Enhanced conversions — Hash first-party customer data (SHA-256) at conversion time to raise match rates without third-party cookies.
  • Google Consent Mode v2 — Gate tag behavior on the visitor's consent state; required for EEA traffic to keep measurement and remarketing eligible.

When to Use

  • "Set up conversion tracking"
  • "1P vs 3P data strategy"
  • "Install pixels (LinkedIn, Meta, Google, TikTok)"
  • "Build UTM architecture"
  • "Set up server-side GTM"
  • "Implement first-party tracking"
  • "Fix attribution gaps"
  • "Set up cookie consent"
  • "Identity resolution setup"

1P vs 3P Data Strategy

First-Party Data (1P)

Data you collect directly from your customers — they know they're sharing it. Examples: email signups, form fills, product usage, purchase history, support tickets, survey responses, account registration.

Advantages: Privacy-compliant by default. Survives browser changes. Higher data quality. You own it. No intermediary. Can be enriched with identity resolution.

Disadvantages: Requires customer action (signup, login, form fill). Smaller volume than 3P. Needs infrastructure to collect, store, and activate.

Third-Party Data (3P)

Data collected by entities that don't have a direct relationship with the user. Examples: browser cookies, ad network tracking, data brokers, device graphs, cross-site tracking.

Advantages: Large scale. Doesn't require user action. Useful for prospecting and lookalike audiences. Historical data for benchmarking.

Disadvantages: Dying. Browser restrictions block 30-40% of 3P tracking. Regulatory pressure (GDPR, CCPA). Lower data quality. You don't own it. Expensive (data broker fees).

The Transition

Now: Run both 1P and 3P in parallel. 3P for scale, 1P for accuracy. Next 12 months: Shift budget from 3P data to 1P infrastructure. End state: 1P is the foundation. 3P is supplementary where still available.

1P Data Activation

Collect → Enrich → Activate:

  1. Collect: Form fills, signups, logins, product usage, email engagement, survey responses, support interactions.
  2. Enrich: Identity resolution (match email to company, role, firmographics). Behavioral scoring. Predictive modeling.
  3. Activate: Personalization (website, email, product), ad targeting (customer match, retargeting), sales prioritization, content recommendations, churn prediction.

Step-by-Step Process

Phase 1: Pixel Inventory

Install these four pixels on every page:

LinkedIn Insight Tag: Base code in <head>, event tracking on conversions. Identifies company visitors for ABM retargeting even without form fills.

Meta Pixel (Facebook): Base code + conversion events. Required for Meta ads optimization, retargeting, and lookalike audience building.

Google Ads Conversion Tag: Via Google Tag Manager or gtag.js. Tracks ad-driven conversions for bidding optimization.

TikTok Pixel: Base code + events. Required for TikTok ads optimization.

Plus: Google Analytics 4 (GA4) — your analytics foundation. Event-based model (not pageview-based). Free, unlimited for most use cases.

Phase 2: UTM Architecture

Standardize UTM parameters across all campaigns:

Parameter Purpose Example
utm_source Traffic origin linkedin, google, meta, email, direct
utm_medium Channel type cpc, organic, email, social, referral
utm_campaign Specific campaign product_demo_q1, webinar_feb
utm_content Ad/creative variant variant_a, video_testimonial
utm_term Keyword (search only) cold+email+software

Enforcement: Single source of truth spreadsheet. Consistent naming. Never mix linkedin and LinkedIn and li. Pre-built UTM templates for common campaign types.

Phase 3: Server-Side Tagging

Move from browser tags to server-side dispatch:

Benefits:

  • Supports controlled event dispatch for permitted measurement; honor consent choices, opt-outs, and browser privacy controls.
  • Improves page speed (fewer browser scripts).
  • Data control (filter, enrich, or suppress data before it leaves your server).
  • Data minimization controls; server-side collection does not itself establish legal compliance.

Setup: Google Tag Manager Server-Side (free, Google-hosted or self-hosted), Segment Protocols, or custom server endpoint. One server-side container receives events, dispatches to all platforms.

Architecture:

Website/App → Server-Side GTM → LinkedIn Conversion API
                              → Meta Conversions API
                              → Google Ads Offline Conversions
                              → TikTok Events API
                              → Your Data Warehouse

GDPR (EU): explicit opt-in before tracking. CCPA (California): right to opt-out. Growing state laws.

Implementation: Consent Management Platform (Cookiebot, OneTrust, Termly). Load tracking scripts only after consent. Block all cookies and pixels until user accepts. Document data flows for compliance.

Consent banner best practices: Clear "Accept All" / "Customize" options. Don't make rejecting harder than accepting. Don't use dark patterns.

Phase 5: Identity Resolution

Connect anonymous visitors to known contacts:

  • Reverse-IP lookup: Identify companies visiting your site (even without form fills). Tools: Clearbit Reveal / HubSpot Breeze, 6sense, Demandbase, Leadfeeder, Albacross. Person-level deanonymization (RB2B, Warmly) is higher privacy risk — load website-visitor-identification before deploying. Canonical playbook: website-visitor-identification/references/visitor-identification-playbook.md.
  • First-party cookie matching: Match returning visitors to previous sessions. Survives 3P cookie restrictions.
  • Email-based identity: The strongest identifier. Every form fill, login, and email click links to a known identity.
  • Cross-device graph: Link same user across phone, laptop, tablet via login events.

Use identity resolution for: ABM retargeting, sales alerts on target account visits, content personalization, pipeline attribution.

Output Format

Measurement plan with: 1P vs 3P strategy, pixel inventory, UTM taxonomy, server-side architecture diagram, consent implementation, identity resolution setup, and conversion event map.

Quality Check

  • All four major pixels installed (LinkedIn, Meta, Google, TikTok)
  • GA4 configured with conversion events
  • UTM taxonomy documented and enforced
  • Server-side tagging implemented (or roadmap with timeline)
  • Consent management active for EU traffic
  • Identity resolution configured for ABM accounts
  • Conversion event map: every meaningful action tracked

Common Pitfalls

  1. Client-side only. 30-40% of browser events are lost to ad blockers. Server-side captures 100%. Implement server-side tagging before scaling ad spend.

  2. No UTM standardization. "linkedin", "LinkedIn", "li", "lnkd" are four different sources in analytics. One naming convention, enforced.

  3. Tracking without consent. GDPR fines up to 4% of global revenue. Implement consent before tracking EU visitors.

  4. Pixel duplication. Same pixel fired twice = double-counted conversions. Audit quarterly with browser dev tools.

  5. 3P dependency without 1P transition. 3P data is dying. 1P data is the future. Run both now, actively build 1P infrastructure.

Execution Artifacts

  • references/framework-notes.md — named frameworks, citation anchors, and operating assumptions
  • templates/output-template.md — copy-paste deliverable structure for the user
  • scripts/check-output.py — local checklist validator for required sections This skill includes lightweight artifacts the agent can load on demand: Use the artifacts when the user asks for an implementation-ready deliverable, a repeatable workflow, or a quality check rather than generic advice.
  • website-visitor-identification: Company vs person ID, vendors, privacy checklist
  • attribution: Multi-touch attribution models
  • paid-advertising: Campaign tracking setup
  • proactive-alerts: Trigger alerts on tracked events
  • marketing-strategy: Overall measurement framework
  • campaign-governance: UTM + visitor source attribution
1---
2name: 1p-tagging-pixels
3description: >-
4 Set up first-party tracking and analytics — website pixels, conversion tracking,
5 UTM architecture, cookie consent, server-side tagging vs client-side, 1P vs 3P
6 data strategy, and identity resolution. Use when setting up tracking, implementing
7 pixels, building attribution, or preparing for privacy-first measurement.
8 Triggers on: "pixel", "tracking", "conversion tracking", "first-party data",
9 "server-side tagging", "UTM", "cookie consent", "1P vs 3P", "identity resolution",
10 or any tracking implementation request.
11license: MIT
12compatibility: Claude Code, Codex, GitHub Copilot, Cursor, Gemini CLI, OpenCode, Goose, Hermes, Windsurf, Zed
13metadata:
14 version: "1.1.1"
15 author: LeadMagic
16 category: analytics
17 tags: [tracking, pixels, analytics, attribution, privacy, first-party]
18 related_skills: [attribution, paid-advertising, gtm-metrics, proactive-alerts, website-visitor-identification, campaign-governance]
19 frameworks:
20 - "Google Tag Manager — Server-side tagging"
21 - "Meta Conversions API"
22 - "Google Ads — Enhanced conversions"
23 - "Google Consent Mode v2"
24---
25 
26# 1P Tagging & Analytics
27 
28## Overview
29 
30Third-party cookies are dead. Apple ITP, Firefox ETP, and Chrome's phase-out
31have made browser-based tracking unreliable. The future is first-party data
32and server-side measurement — data your customers intentionally share with you
33that survives ad blockers, cookie restrictions, and platform changes.
34 
35This skill covers the complete measurement stack: 1P vs 3P strategy, pixel
36implementation, UTM architecture, server-side tagging, consent management,
37and identity resolution. The output is a privacy-resilient analytics
38infrastructure that works when cookies don't.
39 
40## Authoritative Foundations
41- **Google Tag Manager — Server-side tagging** — Route tags through a first-party server container so conversion data survives browser restrictions and you control exactly what leaves your domain.
42- **Meta Conversions API** — Send server events alongside the pixel with a shared event_id so Meta deduplicates them and recovers conversions lost to browser blocking.
43- **Google Ads — Enhanced conversions** — Hash first-party customer data (SHA-256) at conversion time to raise match rates without third-party cookies.
44- **Google Consent Mode v2** — Gate tag behavior on the visitor's consent state; required for EEA traffic to keep measurement and remarketing eligible.
45 
46## When to Use
47 
48- "Set up conversion tracking"
49- "1P vs 3P data strategy"
50- "Install pixels (LinkedIn, Meta, Google, TikTok)"
51- "Build UTM architecture"
52- "Set up server-side GTM"
53- "Implement first-party tracking"
54- "Fix attribution gaps"
55- "Set up cookie consent"
56- "Identity resolution setup"
57 
58## 1P vs 3P Data Strategy
59 
60### First-Party Data (1P)
61Data you collect directly from your customers — they know they're sharing it.
62Examples: email signups, form fills, product usage, purchase history, support
63tickets, survey responses, account registration.
64 
65**Advantages:** Privacy-compliant by default. Survives browser changes. Higher
66data quality. You own it. No intermediary. Can be enriched with identity
67resolution.
68 
69**Disadvantages:** Requires customer action (signup, login, form fill). Smaller
70volume than 3P. Needs infrastructure to collect, store, and activate.
71 
72### Third-Party Data (3P)
73Data collected by entities that don't have a direct relationship with the user.
74Examples: browser cookies, ad network tracking, data brokers, device graphs,
75cross-site tracking.
76 
77**Advantages:** Large scale. Doesn't require user action. Useful for prospecting
78and lookalike audiences. Historical data for benchmarking.
79 
80**Disadvantages:** Dying. Browser restrictions block 30-40% of 3P tracking.
81Regulatory pressure (GDPR, CCPA). Lower data quality. You don't own it.
82Expensive (data broker fees).
83 
84### The Transition
85**Now:** Run both 1P and 3P in parallel. 3P for scale, 1P for accuracy.
86**Next 12 months:** Shift budget from 3P data to 1P infrastructure.
87**End state:** 1P is the foundation. 3P is supplementary where still available.
88 
89### 1P Data Activation
90 
91Collect → Enrich → Activate:
92 
931. **Collect:** Form fills, signups, logins, product usage, email engagement,
94 survey responses, support interactions.
952. **Enrich:** Identity resolution (match email to company, role, firmographics).
96 Behavioral scoring. Predictive modeling.
973. **Activate:** Personalization (website, email, product), ad targeting
98 (customer match, retargeting), sales prioritization, content recommendations,
99 churn prediction.
100 
101## Step-by-Step Process
102 
103### Phase 1: Pixel Inventory
104 
105Install these four pixels on every page:
106 
107**LinkedIn Insight Tag:** Base code in `<head>`, event tracking on conversions.
108Identifies company visitors for ABM retargeting even without form fills.
109 
110**Meta Pixel (Facebook):** Base code + conversion events. Required for Meta
111ads optimization, retargeting, and lookalike audience building.
112 
113**Google Ads Conversion Tag:** Via Google Tag Manager or gtag.js. Tracks
114ad-driven conversions for bidding optimization.
115 
116**TikTok Pixel:** Base code + events. Required for TikTok ads optimization.
117 
118Plus: **Google Analytics 4 (GA4)** — your analytics foundation. Event-based
119model (not pageview-based). Free, unlimited for most use cases.
120 
121### Phase 2: UTM Architecture
122 
123Standardize UTM parameters across all campaigns:
124 
125| Parameter | Purpose | Example |
126|---|---|---|
127| `utm_source` | Traffic origin | `linkedin`, `google`, `meta`, `email`, `direct` |
128| `utm_medium` | Channel type | `cpc`, `organic`, `email`, `social`, `referral` |
129| `utm_campaign` | Specific campaign | `product_demo_q1`, `webinar_feb` |
130| `utm_content` | Ad/creative variant | `variant_a`, `video_testimonial` |
131| `utm_term` | Keyword (search only) | `cold+email+software` |
132 
133**Enforcement:** Single source of truth spreadsheet. Consistent naming. Never
134mix `linkedin` and `LinkedIn` and `li`. Pre-built UTM templates for common
135campaign types.
136 
137### Phase 3: Server-Side Tagging
138 
139Move from browser tags to server-side dispatch:
140 
141**Benefits:**
142- Supports controlled event dispatch for permitted measurement; honor consent choices, opt-outs, and browser privacy controls.
143- Improves page speed (fewer browser scripts).
144- Data control (filter, enrich, or suppress data before it leaves your server).
145- Data minimization controls; server-side collection does not itself establish legal compliance.
146 
147**Setup:** Google Tag Manager Server-Side (free, Google-hosted or self-hosted),
148Segment Protocols, or custom server endpoint. One server-side container
149receives events, dispatches to all platforms.
150 
151**Architecture:**
152```
153Website/App → Server-Side GTM → LinkedIn Conversion API
154 → Meta Conversions API
155 → Google Ads Offline Conversions
156 → TikTok Events API
157 → Your Data Warehouse
158```
159 
160### Phase 4: Consent Management
161 
162GDPR (EU): explicit opt-in before tracking. CCPA (California): right to
163opt-out. Growing state laws.
164 
165**Implementation:** Consent Management Platform (Cookiebot, OneTrust, Termly).
166Load tracking scripts only after consent. Block all cookies and pixels until
167user accepts. Document data flows for compliance.
168 
169**Consent banner best practices:** Clear "Accept All" / "Customize" options.
170Don't make rejecting harder than accepting. Don't use dark patterns.
171 
172### Phase 5: Identity Resolution
173 
174Connect anonymous visitors to known contacts:
175 
176- **Reverse-IP lookup:** Identify companies visiting your site (even without
177 form fills). Tools: Clearbit Reveal / HubSpot Breeze, 6sense, Demandbase,
178 Leadfeeder, Albacross. **Person-level** deanonymization (RB2B, Warmly) is
179 higher privacy risk — load `website-visitor-identification` before deploying.
180 Canonical playbook:
181 `website-visitor-identification/references/visitor-identification-playbook.md`.
182- **First-party cookie matching:** Match returning visitors to previous
183 sessions. Survives 3P cookie restrictions.
184- **Email-based identity:** The strongest identifier. Every form fill, login,
185 and email click links to a known identity.
186- **Cross-device graph:** Link same user across phone, laptop, tablet via
187 login events.
188 
189Use identity resolution for: ABM retargeting, sales alerts on target account
190visits, content personalization, pipeline attribution.
191 
192## Output Format
193 
194Measurement plan with: 1P vs 3P strategy, pixel inventory, UTM taxonomy,
195server-side architecture diagram, consent implementation, identity resolution
196setup, and conversion event map.
197 
198## Quality Check
199 
200- [ ] All four major pixels installed (LinkedIn, Meta, Google, TikTok)
201- [ ] GA4 configured with conversion events
202- [ ] UTM taxonomy documented and enforced
203- [ ] Server-side tagging implemented (or roadmap with timeline)
204- [ ] Consent management active for EU traffic
205- [ ] Identity resolution configured for ABM accounts
206- [ ] Conversion event map: every meaningful action tracked
207 
208## Common Pitfalls
209 
2101. **Client-side only.** 30-40% of browser events are lost to ad blockers.
211 Server-side captures 100%. Implement server-side tagging before scaling
212 ad spend.
213 
2142. **No UTM standardization.** "linkedin", "LinkedIn", "li", "lnkd" are
215 four different sources in analytics. One naming convention, enforced.
216 
2173. **Tracking without consent.** GDPR fines up to 4% of global revenue.
218 Implement consent before tracking EU visitors.
219 
2204. **Pixel duplication.** Same pixel fired twice = double-counted conversions.
221 Audit quarterly with browser dev tools.
222 
2235. **3P dependency without 1P transition.** 3P data is dying. 1P data is the
224 future. Run both now, actively build 1P infrastructure.
225 
226## Execution Artifacts
227 
228- `references/framework-notes.md` — named frameworks, citation anchors, and operating assumptions
229- `templates/output-template.md` — copy-paste deliverable structure for the user
230- `scripts/check-output.py` — local checklist validator for required sections
231This skill includes lightweight artifacts the agent can load on demand:
232Use the artifacts when the user asks for an implementation-ready deliverable, a repeatable workflow, or a quality check rather than generic advice.
233 
234## Related Skills
235 
236- **website-visitor-identification**: Company vs person ID, vendors, privacy checklist
237- **attribution**: Multi-touch attribution models
238- **paid-advertising**: Campaign tracking setup
239- **proactive-alerts**: Trigger alerts on tracked events
240- **marketing-strategy**: Overall measurement framework
241- **campaign-governance**: UTM + visitor source attribution
242 

Discussion

Alternatives

Attribution AuditPaste the sales and spend numbers each ad platform claims, and get back a plain explanation of why they disagree and which figure to trust.Data & AI · MITAnalytics trackingWhen 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," "attribution model," "gtag," "data layer," "GA4 setup," "conversion tracking," "event setup," "User ID tracking," or "CTA attribution." For traffic insights, use traffic-analysis.Marketing · MITAnalytics TrackingWhen the user wants to set up, improve, or audit analytics tracking and measurement. Also use when the user mentions "set up tracking," "GA4," "Google Analytics," "conversion tracking," "event tracking," "UTM parameters," "tag manager," "GTM," "analytics implementation," "tracking plan," "how do I measure this," "track conversions," "Mixpanel," "Segment," "are my events firing," or "analytics isn't working." Use this whenever someone asks how to know if something is working or wants to measure marketing results. For choosing attribution models, comparing multi-touch/MMM/incrementality, or reconciling conflicting numbers across tools, see attribution. For A/B test measurement, see ab-testing.Marketing · MITFind Out Which Marketing Actually Made The SalePaste the conflicting numbers from your ad accounts, website stats and sales records; get back one honest read on which channels really drove sales and where to put your budget.Data & AI · MIT