The id5 module
Part of the SharedID Edge specification. The general rules for modules, including consent, time limits, modules on /sync and module requests, are there.
Name id5; gvlid 131 (ID5), purposes [1], routes v1 and sync, and fetching with the hosts id5-sync.com and api.id5-sync.com. It runs only when listed in SID_MODULES, and only on adapters that can send requests to other hosts. It fetches the visitor's ID5 ID from ID5's API, with the deployment's own ID5 partner number, and returns the EIDs ID5 answers with.
- Settings (
SID_MODULE_CONFIG.id5):partner(required, an integer from 1 to 2147483647);provider(1 to 100 printable ASCII characters);endpoint(defaulthttps://id5-sync.com/gs/v2/{partner}.json,{partner}replaced; MUST behttps, on the default port, without credentials or a fragment, on one of the two hosts);timeoutMs(an integer from 10 to 5000, default 300);domain(a domain, orauto, for the cache cookie);readCookie(a cookie name, defaultid5id;""for none);browsers(all, the default, orwebkit27). Any other key, or an invalid value, makes the module anerror. - Denials. The module MUST NOT send a request, MUST NOT return an ID5 EID, and MUST delete its cache cookie when the browser sent it, when any of these apply: the storage decision for the SharedID isn't
allowed(opt-out, GPC, COPPA, a consent provider's denial, the TC string); aus_privacystring whose third character isY; a US section of the GPP string, listed ingpp_sid, that thegppmodule's rules deny (whether or notgppis inSID_MODULES); or a decoded TC string, whether or not GDPR applies, whose core segment lacks ID5's vendor consent (131), consent for Purpose 1, or consent or legitimate interest for at least one of Purposes 2 to 10. Where GDPR applies, core already skips the module without a readable TC string, ID5's vendor consent or consent for Purpose 1 in the core segment, and deletes the cache cookie it declares (see Modules). - An existing answer. When
readCookienames a cookie the request carries, holding ID5's opt-out (0) or a fetch answer as JSON (maybe percent-encoded; with apbjsobject, the entry for the partner number), an opt-out deletes the cache cookie and returns nothing, and an answer's EIDs are returned; no request is sent either way. - The cache cookie is
sid_id5_<partner>,HttpOnly, withdomain(elseSID_COOKIE_DOMAIN), holding unpadded base64url of UTF-8 JSON:t(when ID5 last answered, Unix seconds),r(when to ask again),e(the EIDs),s(the signature) oro: 1(ID5's opt-out, withouteors). ItsMax-Ageis what's left of 30 days fromt. A cache that isn't valid, has atmore than 60 seconds ahead or 30 days or more behind the clock, is ignored; its EIDs are checked as ID5's answer is. A value over 3072 characters is written withoute, withrthe current time.{basePath}/optoutdeletes it. - When to ask. Before
r, the cached EIDs are returned (none foro: 1) and nothing is sent. Fromr, or with no valid cache, the module sends one request, ifcontext.fetchis given, the platform information has a client IP that is routable and thatpreciseLocationDenialallows, and the request has aUser-Agentof 1 to 1024 printable ASCII characters. Withbrowserswebkit27, theUser-Agentmust also be Apple WebKit 27 or later (below). Otherwise it returns the cached EIDs, if any, and sends nothing. Routable: IPv4 outside0/8,10/8,100.64/10,127/8,169.254/16,172.16/12,192.0.0/24,192.0.2/24,192.88.99/24,192.168/16,198.18/15,198.51.100/24,203.0.113/24and224/3; IPv6 in2000::/3outside2001::/23,2001:db8::/32,2002::/16and3fff::/20. An IPv4-mapped IPv6 address is IPv4. webkit27: aUser-AgentcontainingAppleWebKit/that is either iOS or iPadOS (iPhone,iPadoriPodas a word, and notAndroid) withOS <n>(OS <n>_<m>[_<p>] like Mac OS X) orVersion/<n>,nat least 27, for any browser; orMacintoshwithSafari/andVersion/<n>,nat least 27, and none ofChrome/,Chromium/,CriOS/,Firefox/,FxiOS/,Edg/,EdgiOS/,EdgA/,OPR/,OPT/,Opera/,SamsungBrowser/,YaBrowser/,Vivaldi/,Brave/,DuckDuckGo/orElectron/. Anything else doesn't match. The setting changes only whether a request is sent: denials, the cache and its deletion work as withall.- The request:
POSTto the endpoint,Content-Type: application/json, with the time limittimeoutMs(core shortens it to its own limit), and the body:partner;originsharedid-edge;v(the module's version);ts(ISO 8601);gdpr(1when GDPR applies, else0);gdpr_consent(the TC string),us_privacy,gpp_stringandgpp_sid(comma-joined), each only when present;providerwhen set;domain(the request URL's host name);ua;ip(a routable IPv4 address, dotted decimal) oripv6(a routable IPv6 address, RFC 5952), never both, and IPv6 never asip;puid, the SharedID, when there is one; and the cached signature, ass, or assignaturewhen the endpoint's path starts with/ga/. Nothing else from the request. - The answer (status 2xx, a JSON object of at most 65,536 characters):
universal_uid"0", orprivacy.id5_consentfalse: ID5's opt-out. The cache becomes{ t: now, r: now + 8 hours, o: 1 }; nothing is returned.- Otherwise the EIDs are the
eidof each value ofids, at most 4, each with asourceof letters, digits,.and-(at most 100 characters, lower-cased) and at most 2 UIDs:id1 to 512 printable ASCII characters other than0,atypean integer from 1 to 3 (default 1),exta JSON object of at most 512 characters. Without any, auniversal_uidgives{ "source": "id5-sync.com", "uids": [{ "id": <universal_uid>, "atype": 1, "ext": { "linkType": <ext.linkType> } }] }(extonly for an integerlinkTypefrom 0 to 99). signature(1 to 1024 printable characters without spaces) is cached;cache_control.max_age_secsetsrto between 15 minutes and 8 hours from now (8 hours without it).- The EIDs are returned in
eidsand cached withtnow. - Anything else (another status, no usable EID, invalid JSON): nothing new is returned; the cached EIDs are, and the cache gets
rone hour from now (a new cache withtnow if there was none). - No answer within the time limit, or a network error: the cached EIDs are returned, and the cookie isn't changed.
- Output:
eidsonly, neverortb2. On/sync, only the cookie is used. - Nothing about the request or answer is logged or reported; errors aren't returned.