ORTB
中 / EN
Chapter navigation

GPP String structure & encoding

container protocol

Role & 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

FieldTypeDescription
TypeInt(6)Fixed to 3 as "GPP Header field".
VersionInt(6)Version of the GPP spec (currently 1).
SectionsRange(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.

NameEncodingDescription
Boolean1 bit0=true, 1=false in the GPP JS API output convention (section-specific docs define meaning).
Integer (fixed)x bitsFixed-length integer; usual lengths 3, 6, 12, 16, 24, 36 bits.
Integer (Fibonacci)variableFibonacci-coded integer; bit sequence always ends with "11".
String (fixed)x×6 bitsEach character: ASCII − 65 as Int(6); used for language/country codes.
Datetime36 bitsDeciseconds since 1970-01-01 UTC (Math.round(Date.now()/100)).
Bitfield (fixed)x bitsOne boolean per ID; first bit ↔ ID 1.
N-BitfieldInt(16) length + bitfieldVariable-length bitfield prefixed by its length.
Range (Int)variableint(12) count, then per item: single/group bit + int(16) start (+ int(16) end for groups); not necessarily sorted.
Range (Fibonacci)variableint(12) count, then per item: single/group bit + Fibonacci offset from last seen ID (+ Fibonacci group length); must be sorted.
OptimizedRangevariableBoolean switch: 1 → Fibonacci Range; 0 → variable-length bitfield.
ArrayOfRanges / N-ArrayOfRangesvariableint(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.

URLMacroDescription
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.

gpp_sid gpp_sid semantics & multi-section use

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)
This chapter's body is migrated from the legacy /protocol/gpp-tcf single page; the material matches the official specification.