Chapter navigation
GPP String structure & encoding
container protocolRole & classification
Overall layout of the Global Privacy Platform (GPP) string, the three Header fields (Type / Version / Sections), modified base64 encoding rules, and the first-character recognition convention (D = GPP, C = the standalone TC String of the Interactive Advertising Bureau (IAB) Europe Transparency & Consent Framework (TCF) v2).
- GPP section
- §3 (Header)
- Status
- GPP String v1.0
- Delimiter
- ~ (section) · . (subsection)
- Encoding
- modified base64 · 6 bit/char
String & field layout
[Header]~[Discrete Section]~[Discrete Section]…- ~ — Section delimiter: joins the Header and each section payload in order
- . — Sub-segment delimiter inside a section (e.g. the segments of a TC String)
- modified base64 (RFC 4648 table, 6 bits per character, right-padded with 0 to a multiple of 6 bits)
A leading D (bits 000011 → base64 index 3) marks a GPP string; a leading C (000010 → 2) marks an IAB Europe TCF v2 TC string — a backward-compatible recognition convention carried over from the older format.
String structure & Header
| Field | Type | Description |
|---|---|---|
| Type | Int(6) | Fixed to 3 as "GPP Header field". |
| Version | Int(6) | Version of the GPP spec (currently 1). |
| Sections | Range(Fibonacci) | Ordered list of Section IDs contained in the string; IDs appear in the same order as their sections. Fibonacci range: int(12) amount, then per item a single/group bit + Fibonacci offset (from last seen ID, 0-based for the first entry), groups add a Fibonacci length. |
Encoding data types
This table is the reading key for every field table below: the terms used in the TC String — Range(Fibonacci), N-Bitfield, Datetime and friends — are all defined here, so it is worth a scan before going further.
| Name | Encoding | Description |
|---|---|---|
| Boolean | 1 bit | 0=true, 1=false in the GPP JS API output convention (section-specific docs define meaning). |
| Integer (fixed) | x bits | Fixed-length integer; usual lengths 3, 6, 12, 16, 24, 36 bits. |
| Integer (Fibonacci) | variable | Fibonacci-coded integer; bit sequence always ends with "11". |
| String (fixed) | x×6 bits | Each character: ASCII − 65 as Int(6); used for language/country codes. |
| Datetime | 36 bits | Deciseconds since 1970-01-01 UTC (Math.round(Date.now()/100)). |
| Bitfield (fixed) | x bits | One boolean per ID; first bit ↔ ID 1. |
| N-Bitfield | Int(16) length + bitfield | Variable-length bitfield prefixed by its length. |
| Range (Int) | variable | int(12) count, then per item: single/group bit + int(16) start (+ int(16) end for groups); not necessarily sorted. |
| Range (Fibonacci) | variable | int(12) count, then per item: single/group bit + Fibonacci offset from last seen ID (+ Fibonacci group length); must be sorted. |
| OptimizedRange | variable | Boolean switch: 1 → Fibonacci Range; 0 → variable-length bitfield. |
| ArrayOfRanges / N-ArrayOfRanges | variable | int(12) record count; per record key + type + id collection (legacy downward-compatible shape). |
Carriage & access
The whole GPP String travels via OpenRTB's regs.gpp field or the URL macro ${GPP_STRING}; which sections are actually in force for this transaction is declared by gpp_sid, covered in its own chapter.
| URL | Macro | Description |
|---|---|---|
| gpp | ${GPP_STRING_XXXXX} | URL-safe encoded GPP string; XXXXX is the receiving vendor's GPP ID. Vendors without a GPP ID may receive ${GPP_STRING}. |
| gpp_sid | ${GPP_SID} | Section ID(s) in force for the transaction; normally a single ID, rarely two comma-separated. |
Version deltas
GPP String v1.0 (published 2022-09-28, clarifying revision 2023-11-03) + TCF EU v2 TC String (Final v.2.2 baseline incl. the 2.3/2.4 revisions). The section registry follows the latest official Section Information.md (IDs 1–27).
Invalid forms
- Leading character is neither D (GPP string) nor C (standalone TC string), so the format cannot be recognised
- Delimiter misuse: sections must be separated by ~, TCF subsections by .
- modified base64 decoding of a section payload fails (illegal character or insufficient length)