
Server-side (S2S) affiliate tracking records the conversion on your server or in Stripe, not in the visitor's browser. It makes renewals and refunds easier to attribute. It does not, on its own, make an affiliate program GDPR compliant.

The short answer: **the server changes where the conversion is recorded, not the rules that apply when you read a referral on the visitor's device.** EU regulators treat affiliate tracking links as access to the user's terminal equipment. Consent, or a documented exemption, is still the question for that step.

This explainer maps each step of a SaaS affiliate flow to the rule that applies, then shows a consent-aware setup with Stripe. It is not legal advice: validate your own setup with your DPO or counsel.

For the implementation details, keep the [Stripe affiliate tracking guide](/en/guides/stripe-affiliate-tracking) and the [Next.js affiliate tracking guide](/en/guides/nextjs-affiliate-tracking) open. For the three tracking methods compared, read [how to track affiliate conversions](/en/blog/how-to-track-affiliate-conversions).

---

## What S2S tracking means in a SaaS affiliate flow

A SaaS affiliate conversion has five steps. Only the first two touch the visitor's browser.

1. **Click.** The visitor opens an affiliate link such as `https://yourapp.com/?ref=alice`.
2. **Capture.** A script reads `ref=alice`, asks the tracking service for a session, and stores the session ID in a first-party cookie.
3. **Checkout.** Your server creates the Stripe Checkout Session and copies the session ID into Stripe metadata.
4. **Payment.** Stripe sends `invoice.paid` or a charge event to your affiliate platform by webhook.
5. **Commission.** The platform matches the metadata to the click and creates the commission. Renewals and refunds follow the same server path.

"S2S" describes steps 3 to 5. Those steps run between your server, Stripe and the affiliate platform. No browser is involved when month 7 of a subscription renews.

Steps 1 and 2 still happen on the visitor's device. That is where most of the regulatory analysis sits.

---

## Which rule applies to each step

Two texts matter. The ePrivacy Directive, [Article 5(3)](https://eur-lex.europa.eu/eli/dir/2002/58/oj), covers storing or reading information on the user's terminal equipment. The GDPR covers the processing of personal data that follows.

- **Affiliate link with an identifier.** Runs in the visitor's browser. Main rule: ePrivacy Article 5(3). Document consent, or the exemption you rely on.
- **Session cookie or script capture.** Runs in the visitor's browser. Main rule: ePrivacy Article 5(3). Document consent before the write.
- **Hashed email sent from the browser.** Runs in the visitor's browser. Main rules: ePrivacy Article 5(3), then the GDPR. Document consent before the call.
- **Session ID in Stripe metadata.** Runs on your server and in Stripe. Main rule: GDPR. Document the lawful basis, retention and processors.
- **Webhook to the affiliate platform.** Runs between Stripe and the platform. Main rule: GDPR. Document the processor contract and transfers.

The European Data Protection Board (EDPB) addresses affiliate links directly. Its [Guidelines 2/2023 on the technical scope of Article 5(3)](https://www.edpb.europa.eu/our-work-tools/our-documents/guidelines/guidelines-22023-technical-scope-art-53-eprivacy-directive_en), version 2.0 adopted on 7 October 2024, describe tracked links that partners use "so that the e-commerce website knows which of their partners is responsible for a sale and pay a commission, a practice known as affiliate marketing" (paragraph 49). The EDPB concludes that collecting identifiers through such links is a "gaining of access" covered by Article 5(3) (paragraph 51).

The same guidelines treat hashed emails used as persistent identifiers the same way when client-side code sends them (paragraphs 61 to 63). Hashing in the browser does not move that step out of scope.

Two nuances keep this from being a blanket rule:

- **Article 5(3) applying does not automatically mean consent is required.** The EDPB recalls that each case must be assessed against the exemptions in Article 5(3) (paragraph 56). If you rely on an exemption, write down why it applies to your attribution use.
- **National regulators add their own guidance.** Check the position of the supervisory authority where your users are, and keep that analysis with your consent records.

Once the referral is captured, the GDPR applies to what you keep: the affiliate's identity, the order, the amount and the commission. You need a lawful basis under [Article 6 of the GDPR](https://eur-lex.europa.eu/eli/reg/2016/679/oj), a processor contract with your affiliate platform (Article 28), and a transfer mechanism such as Standard Contractual Clauses when data leaves the EU (Article 46).

---

## What server-side tracking does improve

S2S tracking is still the right architecture for SaaS. It improves three things that matter for compliance and for payout accuracy.

**Fewer browser dependencies after consent.** Once a consented session exists, the payment, every renewal and every refund are attributed from Stripe events. Ad blockers and cookie expiry no longer erase renewals.

**Data minimisation.** The checkout only needs an opaque session ID in Stripe metadata, such as `refcampaign_session`. You do not need to copy the customer's email or IP address into the affiliate platform to attribute the payment.

**One audit trail.** Commissions are created from payment events you can reconcile in Stripe. Refund corrections follow the same path. That makes it easier to answer an affiliate dispute or a data subject request.

---

## What server-side tracking does not fix

Moving the conversion to the server leaves these points open:

- **Consent at capture.** If the link identifier is read and a session stored before the visitor answers your banner, the server-side half does not repair it.
- **IP-based workarounds.** Rebuilding a referral from the IP address when consent is refused can still fall under Article 5(3). The EDPB says IP-based tracking is in scope unless you can show the IP address does not originate from the user's device (paragraphs 54 and 55).
- **Lawful basis for commission data.** You still decide and document the basis for processing affiliate and order data.
- **Transfers.** A tracking worker or webhook endpoint outside the EU needs a transfer mechanism. Check your vendor's subprocessor list, not only its headquarters.
- **Transparency.** Your privacy notice must mention affiliate attribution, the data kept and the retention period.

---

## A consent-aware S2S setup with Stripe

This is the setup RefCampaign's SDK is built around. The browser half is passive until your consent management platform (CMP) gives an attribution choice.

### 1. Pass the CMP decision to the SDK

```ts
import { RefCampaignBrowser } from '@refcampaign/sdk/browser'

RefCampaignBrowser.configure({ siteToken: 'rcst_PUBLIC_SITE_TOKEN' })

// Replay the stored CMP choice on every page load, and again on change.
await RefCampaignBrowser.setConsent({ attribution: cmpChoice === 'granted' })
```

On a referral URL, a grant creates a first-party `_rc_sid` session for 180 days, the longest campaign attribution window. A refusal sends no browser request. A later withdrawal deletes the session. Your CMP remains the source of truth: RefCampaign does not store the consent choice.

### 2. Send the session to checkout only when it exists

```ts
const sessionId = RefCampaignBrowser.getSessionId() // null without consent

await fetch('/api/checkout', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ priceId, sessionId }),
})
```

### 3. Write the metadata on the server

```ts
import { RefCampaignServer } from '@refcampaign/sdk/server'

const refcampaign = new RefCampaignServer(process.env.REFCAMPAIGN_SECRET_KEY!)

// Returns {} for a missing or malformed session, so checkout never depends on it.
const metadata = refcampaign.getStripeMetadata(sessionId ?? undefined)

await stripe.checkout.sessions.create({
  mode: 'subscription',
  line_items: [{ price: priceId, quantity: 1 }],
  metadata,
  subscription_data: { metadata },
  success_url: `${appUrl}/billing/success`,
  cancel_url: `${appUrl}/pricing`,
})
```

Checkout must succeed without the metadata. A refused consent means no automatic attribution for that visit, not a blocked purchase. The [Stripe guide](/en/guides/stripe-affiliate-tracking) covers Payment Intents and webhook verification.

### 4. Attribute refused-consent visits only from server-known facts

If consent is refused, you can still attribute a conversion with information your server knows independently: a coupon issued to the affiliate, an explicit referral code typed at signup, or an affiliate code already attached to the order. Record it with the server SDK. Do not rebuild the referral from device data.

### 5. Keep a server-set session cookie behind the same consent

Safari caps cookies written by JavaScript to 7 days, so you may re-issue `_rc_sid` from your own server after capture. Moving the write to the server does not change its legal nature: it still stores an identifier on the visitor's device. Set it only after a grant, and let the SDK delete it on withdrawal. The browser `identify()` call is deprecated and no longer sends an email hash.

---

## Checklist before launch

- Affiliate attribution sits in a consent category of your CMP, not under "strictly necessary", unless you documented an exemption.
- A refusal on a `?ref=` URL sends no capture request and stores no session.
- A withdrawal deletes the stored session.
- Checkout completes without a session.
- Stripe metadata carries an opaque session ID only.
- Your privacy notice describes affiliate attribution, its data and its retention.
- Your affiliate platform's processor terms and subprocessor list are on file. RefCampaign publishes its [subprocessor list](/en/legal/subprocessors): the primary database is in Helsinki (EU), and some subprocessors are in the US under Standard Contractual Clauses.

For the wider compliance picture, including FTC disclosures and affiliate agreements, read the [affiliate program compliance guide](/en/blog/affiliate-program-compliance-ftc-gdpr-2026). To see how attribution feeds commissions, refunds and payouts in Stripe, see the [Stripe affiliate software page](/en/stripe-affiliate-software) and [pricing](/en/pricing).

---

## Sources

Consulted on October 22, 2026.

- European Data Protection Board, [Guidelines 2/2023 on Technical Scope of Art. 5(3) of ePrivacy Directive](https://www.edpb.europa.eu/our-work-tools/our-documents/guidelines/guidelines-22023-technical-scope-art-53-eprivacy-directive_en), version 2.0, adopted 7 October 2024: paragraphs 49 to 51 (tracking links and affiliate marketing), 54 to 56 (IP-based tracking, exemptions), 61 to 63 (unique identifiers).
- [Directive 2002/58/EC (ePrivacy Directive)](https://eur-lex.europa.eu/eli/dir/2002/58/oj), Article 5(3).
- [Regulation (EU) 2016/679 (GDPR)](https://eur-lex.europa.eu/eli/reg/2016/679/oj), Articles 6, 28 and 46.
- RefCampaign [SDK documentation](https://docs.refcampaign.com/docs/api/integration/sdk): consent lifecycle, `_rc_sid` session, server-set session cookie.
