Server Side Tracking logo

Server Side Tracking

Community
mukul975
server-side-tracking

Implementing server-side tracking with privacy controls using Google Tag Manager server containers. Covers first-party data collection, IP anonymization, consent-aware event forwarding, and reducing client-side third-party cookie exposure.

Overview

Publishermukul975
RepositoryPrivacy-Data-Protection-Skills
Skill nameserver-side-tracking
Stars
279
Forks
59
Bundled files
4
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by mukul975 on GitHub. Read the source before you install it.

Installation

Install the Server Side Tracking AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/mukul975/Privacy-Data-Protection-Skills.git /tmp/Privacy-Data-Protection-Skills
mkdir -p .claude/skills
cp -r /tmp/Privacy-Data-Protection-Skills/plugins/cookie-consent-skills/skills/server-side-tracking .claude/skills/server-side-tracking
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Server Side Tracking in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Server Side Tracking on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Server Side Tracking is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Server-Side Tracking with Privacy Controls

Overview

Server-side tracking moves data collection from the user's browser to a server-controlled environment, providing greater control over what data is shared with third parties. Instead of loading third-party JavaScript directly in the browser (which sets third-party cookies and sends data to external servers without intermediation), a server-side container receives events from the client, processes them, and selectively forwards data to analytics and advertising endpoints. This architecture enables IP anonymization before data leaves the first-party infrastructure, consent-based routing of events, and reduced reliance on third-party cookies — directly supporting ePrivacy Directive Article 5(3) compliance and data minimization under GDPR Article 5(1)(c).

Architecture

Client-Server Flow

User's Browser
    ├── Client-side GTM container (minimal)
    │   └── Sends events to first-party endpoint
First-Party Server Endpoint
(https://data.pinnacle-ecommerce.com)
    ├── Server-side GTM container
    │   ├── Validates consent state
    │   ├── Anonymizes IP address
    │   ├── Strips unnecessary identifiers
    │   ├── Applies data minimization rules
    │   │
    │   ├── [If analytics consent granted]
    │   │   └── Forward to Google Analytics 4
    │   │
    │   ├── [If advertising consent granted]
    │   │   ├── Forward to Google Ads
    │   │   ├── Forward to Meta Conversions API
    │   │   └── Forward to other ad platforms
    │   │
    │   └── [If all consent denied]
    │       └── Log aggregate pageview count only (no PII)
    └── First-party server logs (retention: 90 days)

Infrastructure Setup for Pinnacle E-Commerce Ltd

Server Container Hosting Options:

OptionProviderMonthly Cost (est.)LatencyControl
Google Cloud RunGoogle CloudEUR 50-200LowHigh
AWS App RunnerAmazon Web ServicesEUR 40-180LowHigh
Custom DockerSelf-hostedEUR 30-150VariesMaximum
Stape.ioManaged serviceEUR 20-100LowMedium

Pinnacle E-Commerce Ltd Configuration:

SettingValue
Server container URLhttps://data.pinnacle-ecommerce.com
Custom domaindata.pinnacle-ecommerce.com (CNAME to container)
Container regioneurope-west1 (Belgium) — co-located with EU users
ScalingMin 1 instance, max 10 instances
SSL certificateLet's Encrypt via managed certificate
First-party cookie domain.pinnacle-ecommerce.com

Custom Domain for First-Party Context

Using a subdomain of the main site domain ensures:

  • Cookies set by the server container are first-party cookies
  • Requests to data.pinnacle-ecommerce.com are same-site, avoiding third-party cookie restrictions
  • Safari ITP and Firefox ETP do not apply cross-site tracking protections

DNS Configuration:

data.pinnacle-ecommerce.com  CNAME  server-container-abc123.run.app

Consent-Aware Event Forwarding

Consent Validation on the Server

Every event arriving at the server container includes the consent state from the client. The server validates this before forwarding:

Event Payload from Client:

json
{
  "client_id": "1234567890.1709000000",
  "event_name": "purchase",
  "event_params": {
    "transaction_id": "TXN-2026-0314-001",
    "value": 149.99,
    "currency": "EUR",
    "items": [{"item_id": "SKU-001", "item_name": "Widget Pro"}]
  },
  "consent_state": {
    "analytics_storage": "granted",
    "ad_storage": "denied",
    "ad_user_data": "denied",
    "ad_personalization": "denied"
  },
  "user_agent": "Mozilla/5.0...",
  "ip_address": "203.0.113.42"
}

Server-Side Routing Logic:

DestinationRequired ConsentData Sent
GA4 Measurement Protocolanalytics_storage: grantedEvent name, params, anonymized client_id
Google Ads Conversion APIad_storage + ad_user_data: grantedConversion data, gclid, hashed email
Meta Conversions APIad_storage + ad_user_data: grantedEvent data, fbp, hashed email/phone
Aggregate counter (internal)None required+1 to event type counter (no PII)

IP Anonymization

The server container anonymizes IP addresses before forwarding to any third party:

Anonymization Rules:

MethodDescriptionUse Case
IPv4 last octet zeroing203.0.113.42 → 203.0.113.0Standard GA4 anonymization
IPv6 last 80 bits zeroing2001:db8::1234:5678 → 2001:db8::IPv6 anonymization
Full IP removalIP not forwarded at allMaximum privacy (Meta CAPI)
Geolocation-onlyResolve to country/region, discard IPGeo reporting without IP

Pinnacle E-Commerce Ltd Policy:

  • GA4: Forward anonymized IP (last octet zeroed) for geographic reporting
  • Google Ads: Forward anonymized IP for conversion geo-attribution
  • Meta CAPI: Do not forward IP; send hashed email only (with ad_user_data consent)
  • Internal logs: Retain full IP for 24 hours for security/fraud detection, then anonymize

Data Minimization at the Server Layer

The server container strips data before forwarding:

Data ElementRetained for GA4Retained for AdsRetained Internally
Full URLPath only (no query params)Path onlyFull URL (90 days)
User agentReduced UA (SEC-CH-UA)Reduced UAFull UA (24 hours)
IP addressAnonymizedAnonymizedFull (24 hours)
ReferrerDomain onlyDomain onlyFull (90 days)
Client IDGA client_idgclid/wbraid onlyInternal session ID
Email (hashed)Not sentSHA-256 hashNot stored

Server-Side Tag Configurations

GA4 Server-Side Tag

SettingValue
Measurement IDG-PINNACLE123
API SecretStored in Secret Manager
Send toGA4 Measurement Protocol
IP anonymizationEnabled (default in GA4)
Client ID sourceFirst-party _ga cookie
Session ID sourceFirst-party ga* cookie

Meta Conversions API Tag

SettingValue
Pixel ID123456789012345
Access TokenStored in Secret Manager
Event deduplicationevent_id matches browser Pixel event_id
Data sentEvent name, event_time, action_source, hashed email
IP forwardingDisabled
User agent forwardingReduced UA only

First-Party Cookie Management

The server container can set first-party cookies via Set-Cookie headers, giving them longer lifetimes than client-side JavaScript cookies (which Safari ITP caps at 7 days):

CookieSet ByDurationPurpose
_gaServer (Set-Cookie header)2 yearsGA4 client identifier
_ga_PINNACLEServer (Set-Cookie header)2 yearsGA4 session persistence
_fbcServer (Set-Cookie header)90 daysMeta click identifier
_pin_sessServer (Set-Cookie header)30 minutesInternal session tracking

All cookies above are set only when the corresponding consent category is granted.

Monitoring and Debugging

Server Container Health Checks

MetricTargetAlert Threshold
Request latency (p99)< 200ms> 500ms
Error rate< 0.1%> 1%
Event throughputBaseline +/- 20%> 30% deviation
Consent validation failures0> 0
Forwarding failures (GA4)< 0.5%> 2%
Forwarding failures (Meta)< 1%> 5%

Data Flow Audit

Monthly audit of server-side tracking:

  1. Compare client-side events sent vs. server-side events received (expect < 2% loss)
  2. Verify consent state is correctly parsed for all forwarded events
  3. Confirm no PII is forwarded to destinations where consent is denied
  4. Check that IP anonymization is applied before all third-party forwarding
  5. Validate first-party cookie durations match policy
  6. Review server logs for any unexpected outbound connections

Key Legal and Technical References

  • ePrivacy Directive 2002/58/EC, Article 5(3) — Consent for device storage/access; server-side cookies still require consent if non-essential
  • GDPR Article 5(1)(c) — Data minimization principle; server-side filtering reduces data shared with third parties
  • GDPR Article 28 — Data processor requirements for server hosting providers
  • GDPR Article 44-49 — Transfer restrictions if server container is outside EEA
  • Google Tag Manager Server-Side Documentation — Container setup and tag configuration
  • Meta Conversions API Documentation — Server-side event forwarding for Meta advertising
  • Safari Intelligent Tracking Prevention (ITP) — Client-side cookie limitations driving server-side adoption
  • CNIL Deliberation No. 2020-091 — Server-set cookies still subject to consent requirements

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Server Side Tracking AI skill do?

Implementing server-side tracking with privacy controls using Google Tag Manager server containers. Covers first-party data collection, IP anonymization, consent-aware event forwarding, and reducing client-side third-party cookie exposure.

Why use Server Side Tracking on TypingMind?

Because you install it once and use it with any model. Server Side Tracking is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Server Side Tracking in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/mukul975/Privacy-Data-Protection-Skills/tree/main/plugins/cookie-consent-skills/skills/server-side-tracking. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Server Side Tracking?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Server Side Tracking?

As many as you like. As long as a model supports skills, you can use Server Side Tracking with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Server Side Tracking AI skill free?

Yes. It is published on GitHub by mukul975 under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇