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 ↗
npx degit LeadMagic/gtm-skills/skills/analytics/1p-tagging-pixels#main ~/.claude/skills/1p-tagging-pixelsChecked ·commit main
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
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:
- Collect: Form fills, signups, logins, product usage, email engagement, survey responses, support interactions.
- Enrich: Identity resolution (match email to company, role, firmographics). Behavioral scoring. Predictive modeling.
- 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
Phase 4: Consent Management
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-identificationbefore 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
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.
No UTM standardization. "linkedin", "LinkedIn", "li", "lnkd" are four different sources in analytics. One naming convention, enforced.
Tracking without consent. GDPR fines up to 4% of global revenue. Implement consent before tracking EU visitors.
Pixel duplication. Same pixel fired twice = double-counted conversions. Audit quarterly with browser dev tools.
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 assumptionstemplates/output-template.md— copy-paste deliverable structure for the userscripts/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.
Related Skills
- 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 | |
| 2 | name 1p-tagging-pixels |
| 3 | description >- |
| 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. |
| 11 | license MIT |
| 12 | compatibility Claude Code, Codex, GitHub Copilot, Cursor, Gemini CLI, OpenCode, Goose, Hermes, Windsurf, Zed |
| 13 | metadata |
| 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 | |
| 30 | Third-party cookies are dead. Apple ITP, Firefox ETP, and Chrome's phase-out |
| 31 | have made browser-based tracking unreliable. The future is first-party data |
| 32 | and server-side measurement — data your customers intentionally share with you |
| 33 | that survives ad blockers, cookie restrictions, and platform changes. |
| 34 | |
| 35 | This skill covers the complete measurement stack: 1P vs 3P strategy, pixel |
| 36 | implementation, UTM architecture, server-side tagging, consent management, |
| 37 | and identity resolution. The output is a privacy-resilient analytics |
| 38 | infrastructure 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) |
| 61 | Data you collect directly from your customers — they know they're sharing it. |
| 62 | Examples: email signups, form fills, product usage, purchase history, support |
| 63 | tickets, survey responses, account registration. |
| 64 | |
| 65 | **Advantages:** Privacy-compliant by default. Survives browser changes. Higher |
| 66 | data quality. You own it. No intermediary. Can be enriched with identity |
| 67 | resolution. |
| 68 | |
| 69 | **Disadvantages:** Requires customer action (signup, login, form fill). Smaller |
| 70 | volume than 3P. Needs infrastructure to collect, store, and activate. |
| 71 | |
| 72 | ### Third-Party Data (3P) |
| 73 | Data collected by entities that don't have a direct relationship with the user. |
| 74 | Examples: browser cookies, ad network tracking, data brokers, device graphs, |
| 75 | cross-site tracking. |
| 76 | |
| 77 | **Advantages:** Large scale. Doesn't require user action. Useful for prospecting |
| 78 | and lookalike audiences. Historical data for benchmarking. |
| 79 | |
| 80 | **Disadvantages:** Dying. Browser restrictions block 30-40% of 3P tracking. |
| 81 | Regulatory pressure (GDPR, CCPA). Lower data quality. You don't own it. |
| 82 | Expensive (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 | |
| 91 | Collect → Enrich → Activate: |
| 92 | |
| 93 | **Collect:** Form fills, signups, logins, product usage, email engagement, |
| 94 | survey responses, support interactions. |
| 95 | **Enrich:** Identity resolution (match email to company, role, firmographics). |
| 96 | Behavioral scoring. Predictive modeling. |
| 97 | **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 | |
| 105 | Install these four pixels on every page: |
| 106 | |
| 107 | **LinkedIn Insight Tag:** Base code in `<head>`, event tracking on conversions. |
| 108 | Identifies company visitors for ABM retargeting even without form fills. |
| 109 | |
| 110 | **Meta Pixel (Facebook):** Base code + conversion events. Required for Meta |
| 111 | ads optimization, retargeting, and lookalike audience building. |
| 112 | |
| 113 | **Google Ads Conversion Tag:** Via Google Tag Manager or gtag.js. Tracks |
| 114 | ad-driven conversions for bidding optimization. |
| 115 | |
| 116 | **TikTok Pixel:** Base code + events. Required for TikTok ads optimization. |
| 117 | |
| 118 | Plus: **Google Analytics 4 (GA4)** — your analytics foundation. Event-based |
| 119 | model (not pageview-based). Free, unlimited for most use cases. |
| 120 | |
| 121 | ### Phase 2: UTM Architecture |
| 122 | |
| 123 | Standardize 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 |
| 134 | mix `linkedin` and `LinkedIn` and `li`. Pre-built UTM templates for common |
| 135 | campaign types. |
| 136 | |
| 137 | ### Phase 3: Server-Side Tagging |
| 138 | |
| 139 | Move 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), |
| 148 | Segment Protocols, or custom server endpoint. One server-side container |
| 149 | receives events, dispatches to all platforms. |
| 150 | |
| 151 | **Architecture:** |
| 152 | |
| 153 | Website/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 | |
| 162 | GDPR (EU): explicit opt-in before tracking. CCPA (California): right to |
| 163 | opt-out. Growing state laws. |
| 164 | |
| 165 | **Implementation:** Consent Management Platform (Cookiebot, OneTrust, Termly). |
| 166 | Load tracking scripts only after consent. Block all cookies and pixels until |
| 167 | user accepts. Document data flows for compliance. |
| 168 | |
| 169 | **Consent banner best practices:** Clear "Accept All" / "Customize" options. |
| 170 | Don't make rejecting harder than accepting. Don't use dark patterns. |
| 171 | |
| 172 | ### Phase 5: Identity Resolution |
| 173 | |
| 174 | Connect 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 | |
| 189 | Use identity resolution for: ABM retargeting, sales alerts on target account |
| 190 | visits, content personalization, pipeline attribution. |
| 191 | |
| 192 | ## Output Format |
| 193 | |
| 194 | Measurement plan with: 1P vs 3P strategy, pixel inventory, UTM taxonomy, |
| 195 | server-side architecture diagram, consent implementation, identity resolution |
| 196 | setup, 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 | |
| 210 | **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 | |
| 214 | **No UTM standardization.** "linkedin", "LinkedIn", "li", "lnkd" are |
| 215 | four different sources in analytics. One naming convention, enforced. |
| 216 | |
| 217 | **Tracking without consent.** GDPR fines up to 4% of global revenue. |
| 218 | Implement consent before tracking EU visitors. |
| 219 | |
| 220 | **Pixel duplication.** Same pixel fired twice = double-counted conversions. |
| 221 | Audit quarterly with browser dev tools. |
| 222 | |
| 223 | **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 |
| 231 | This skill includes lightweight artifacts the agent can load on demand: |
| 232 | Use 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
Browse more free Claude skills or everything in Marketing.