From f79d4470132ddcbeb9bcebff8fd69e0b2f5e5154 Mon Sep 17 00:00:00 2001 From: lamrowena <108421200+lamrowena@users.noreply.github.com> Date: Wed, 23 Nov 2022 08:08:53 -0500 Subject: [PATCH 1/5] No section in scope Clearly define when no section is in scope, make this information available as early as possible --- Core/CMP API Specification.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Core/CMP API Specification.md b/Core/CMP API Specification.md index 94861dc..e5bb80a 100644 --- a/Core/CMP API Specification.md +++ b/Core/CMP API Specification.md @@ -162,9 +162,7 @@ cmpStatus : String, // possible values: stub, loading, loaded, error cmpDisplayStatus: String, // possible values: hidden, visible, disabled -apiSupport : Array of string, // list of supported APIs (prefix strings), e.g. used while loading. Example: ["tcfeuv2","uspv1"] - -currentAPI: String, // name of detected API once CMP is loaded, may be empty while loading. Example “tcfeuv2” +apiSupport : Array of string, // list of supported APIs (prefix strings), e.g. used while loading. Example: ["tcfeuv2","uspv1"] cmpId : Number, // IAB assigned CMP ID, may be 0 during stub/loading @@ -566,10 +564,11 @@ gppVersion : Number, // The version number parsed from the header sectionList : Array of Number, // the sections contained within the encoded GPP string as parsed from the header -applicableSection: Array of Number, // Section ID considered to be in force for this transaction. In most cases, this field should have a single section ID. In rare occasions where such a single section ID can not be determined, the field may contain up to 2 values. +applicableSection: Array of Number, // Section ID considered to be in force for this transaction. The value should be 0 during stub/load. In most cases, this field should have a single section ID. In rare occasions where such a single section ID can not be determined, the field may contain up to 2 values. When no section is applicable, the value will be -1. gppString: String // the complete encoded GPP string +pingData: object // see PingReturn } ``` From 06070a35a5ca7b4576ccda86466506b594ceaf53 Mon Sep 17 00:00:00 2001 From: lamrowena <108421200+lamrowena@users.noreply.github.com> Date: Wed, 23 Nov 2022 11:19:51 -0500 Subject: [PATCH 2/5] updated stub example --- Core/CMP API Specification.md | 63 ++++++++++++++++++++++++++--------- 1 file changed, 47 insertions(+), 16 deletions(-) diff --git a/Core/CMP API Specification.md b/Core/CMP API Specification.md index e5bb80a..c01028d 100644 --- a/Core/CMP API Specification.md +++ b/Core/CMP API Specification.md @@ -162,7 +162,7 @@ cmpStatus : String, // possible values: stub, loading, loaded, error cmpDisplayStatus: String, // possible values: hidden, visible, disabled -apiSupport : Array of string, // list of supported APIs (prefix strings), e.g. used while loading. Example: ["tcfeuv2","uspv1"] +supportedAPIs : Array of string, // list of supported APIs (prefix strings), e.g. used while loading. Example: ["tcfeuv2","uspv1"] cmpId : Number, // IAB assigned CMP ID, may be 0 during stub/loading @@ -564,7 +564,7 @@ gppVersion : Number, // The version number parsed from the header sectionList : Array of Number, // the sections contained within the encoded GPP string as parsed from the header -applicableSection: Array of Number, // Section ID considered to be in force for this transaction. The value should be 0 during stub/load. In most cases, this field should have a single section ID. In rare occasions where such a single section ID can not be determined, the field may contain up to 2 values. When no section is applicable, the value will be -1. +applicableSection: Array of Number, // Section ID considered to be in force for this transaction. In most cases, this field should have a single section ID. In rare occasions where such a single section ID can not be determined, the field may contain up to 2 values. The value can be 0 or a Section ID specified by the Publisher / Advertiser, during stub / load. When no section is applicable, the value will be -1. gppString: String // the complete encoded GPP string @@ -874,8 +874,7 @@ window.__gpp_stub = function () gppVersion : '1.0', // must be “Version.Subversion”, current: “1.0” cmpStatus : 'stub', // possible values: stub, loading, loaded, error cmpDisplayStatus: 'hidden', // possible values: hidden, visible, disabled - apiSupport : ['tcfeuv2', 'tcfcav2', 'uspv1'], // list of supported APIs - currentAPI : '', // name of detected API once CMP is loaded + supportedAPIs : ['tcfeuv2', 'tcfcav2', 'uspv1'], // list of supported APIs cmpId : 31 // IAB assigned CMP ID, may be 0 during stub/loading }; } @@ -894,6 +893,13 @@ window.__gpp_stub = function () eventName : 'listenerRegistered', listenerId: lnr, // Registered ID of the listener data : true // positive signal +pingData: { + gppVersion : '1.0', + cmpStatus : 'stub', + cmpDisplayStatus: 'hidden', + supportedAPIs : ['tcfeuv2', 'tcfva', 'usnat'], + cmpId : 31 +} }; } else if (cmd === 'removeEventListener') @@ -913,10 +919,35 @@ window.__gpp_stub = function () eventName : 'listenerRemoved', listenerId: par, // Registered ID of the listener data : success // status info +pingData: { + gppVersion : '1.0', + cmpStatus : 'stub', + cmpDisplayStatus: 'hidden', + supportedAPIs : ['tcfeuv2', 'tcfva', 'usnat'], + cmpId : 31 +} }; - } +} + else if (cmd === 'getGPPData') +{ + //return null; //CMPs can decide to return null during load + return { +sectionId : 3, +gppVersion : 1, +sectionList : [], +applicableSections: [0], /*may be filled by publisher*/ +gppString : '', +pingData: { + gppVersion : '1.0', + cmpStatus : 'stub', + cmpDisplayStatus: 'hidden', + supportedAPIs : ['tcfeuv2', 'tcfva', 'usnat'], + cmpId : 31 +} +}; +} //these commands must not be queued but may return null while in stub-mode - else if (cmd === 'hasSection' || cmd === 'getSection' || cmd === 'getField' || cmd === 'getGPPString') + else if (cmd === 'hasSection' || cmd === 'getSection' || cmd === 'getField' { return null; } @@ -935,16 +966,16 @@ window.__gpp_msghandler = function (event) { var i = json.__gppCall; window.__gpp(i.command, function (retValue, success) - { - var returnMsg = { - '__gppReturn': { - 'returnValue': retValue, - 'success' : success, - 'callId' : i.callId - } - }; - event.source.postMessage(msgIsString ? JSON.stringify(returnMsg) : returnMsg, '*'); - }, i.parameter); +{ +var returnMsg = { + '__gppReturn': { + 'returnValue': retValue, + 'success' : success, + 'callId' : i.callId + } +}; +event.source.postMessage(msgIsString ? JSON.stringify(returnMsg) : returnMsg, '*'); +},'parameter' in i? i.parameter: null, 'version' in i ? i.version : 1); } }; if (!('__gpp' in window) || (typeof (window.__gpp) !== 'function') From ecdf147427a6c83a9cbba422b5c972c4c36d0943 Mon Sep 17 00:00:00 2001 From: lamrowena <108421200+lamrowena@users.noreply.github.com> Date: Mon, 28 Nov 2022 15:11:13 -0500 Subject: [PATCH 3/5] Update CMP API Specification.md --- Core/CMP API Specification.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Core/CMP API Specification.md b/Core/CMP API Specification.md index c01028d..2d96380 100644 --- a/Core/CMP API Specification.md +++ b/Core/CMP API Specification.md @@ -564,7 +564,7 @@ gppVersion : Number, // The version number parsed from the header sectionList : Array of Number, // the sections contained within the encoded GPP string as parsed from the header -applicableSection: Array of Number, // Section ID considered to be in force for this transaction. In most cases, this field should have a single section ID. In rare occasions where such a single section ID can not be determined, the field may contain up to 2 values. The value can be 0 or a Section ID specified by the Publisher / Advertiser, during stub / load. When no section is applicable, the value will be -1. +applicableSections: Array of Number, // Section ID considered to be in force for this transaction. In most cases, this field should have a single section ID. In rare occasions where such a single section ID can not be determined, the field may contain up to 2 values. The value can be 0 or a Section ID specified by the Publisher / Advertiser, during stub / load. When no section is applicable, the value will be -1. gppString: String // the complete encoded GPP string @@ -892,7 +892,7 @@ window.__gpp_stub = function () return { eventName : 'listenerRegistered', listenerId: lnr, // Registered ID of the listener - data : true // positive signal + data : true, // positive signal pingData: { gppVersion : '1.0', cmpStatus : 'stub', @@ -918,7 +918,7 @@ pingData: { return { eventName : 'listenerRemoved', listenerId: par, // Registered ID of the listener - data : success // status info + data : success, // status info pingData: { gppVersion : '1.0', cmpStatus : 'stub', @@ -947,7 +947,7 @@ pingData: { }; } //these commands must not be queued but may return null while in stub-mode - else if (cmd === 'hasSection' || cmd === 'getSection' || cmd === 'getField' + else if (cmd === 'hasSection' || cmd === 'getSection' || cmd === 'getField') { return null; } From 7ee9904208f0ae21a4f1500d463040864ef9c49b Mon Sep 17 00:00:00 2001 From: lamrowena <108421200+lamrowena@users.noreply.github.com> Date: Wed, 7 Dec 2022 13:43:45 -0500 Subject: [PATCH 4/5] Fixed data types table, segment references Fixed data types table and updated all references of "segment" to "section" for clarity --- Core/Consent String Specification.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Core/Consent String Specification.md b/Core/Consent String Specification.md index 8b475ac..bad5e9f 100644 --- a/Core/Consent String Specification.md +++ b/Core/Consent String Specification.md @@ -365,12 +365,12 @@ Based on the Section ID table above, the Section ID for Canadian TCF is 5 and t Discrete sections are used to support multiple signals from one architecture while maintaining the ability to modify each section as needed. -Each string segment is scoped to the same body that updates the spec. This allows for regional sovereignty policies to make changes that might include more delimited information. For example, if TCF needs a version 3 and eliminates the concept of “out of band” vendors—which would result in the removal of DisclosedVendors and AllowedVendors—that should not require a version bump to the GPP string specification. +Each string section is scoped to the same body that updates the spec. This allows for regional sovereignty policies to make changes that might include more delimited information. For example, if TCF needs a version 3 and eliminates the concept of “out of band” vendors—which would result in the removal of DisclosedVendors and AllowedVendors—that should not require a version bump to the GPP string specification. #### Delimiters -In order to be backward compatible with IAB Europe’s TC String and US Privacy String formats, the delimiter used to separate segments is “~” (tilde). +In order to be backward compatible with IAB Europe’s TC String and US Privacy String formats, the delimiter used to separate sections is “~” (tilde). > **Note:** URL-safe characters are important to meet the integration needs of those not reading privacy signals server side or via the client-side APIs. URL-safe characters are: @@ -399,42 +399,49 @@ The possible data types are: Data Type Encoding + JS API output Description Boolean 1 bit + true|false 0=true, 1=false Integer (fixed length of x) x bit + Number A fixed amount of bit representing an integer. Usual lengths are 3, 6 or 12 bit.

Example: int(6) “000101” represents the number 5 Integer (Fibonacci) Variable Length + Number Integer encoded using Fibonacci encoding

See “About Fibonacci Encoding” for more detail String (fixed length of x) (including country codes) x*6 bit + String A fixed amount of bit representing a string. The character’s ASCII integer ID is subtracted by 65 and encoded into an int(6).

Example: int(6) “101010” represents integer 47 + 65 = char “h” Datetime 36 bit + Date A datetime is encoded as a 36 bit integer representing the 1/10th seconds since January 01 1970 00:00:00 UTC.

Example JavaScript representation: Math.round((new Date()).getTime()/100) Bitfield (fixed length of x) x bit + Array of Number A fixed amount of bit. Usually each bit represents a boolean for an ID within a group where the first bit corresponds to true/false for ID 1, the second bit corresponds to true/false for ID 2 and so on. @@ -447,6 +454,7 @@ The possible data types are: Range (Int) variable + Array of Number A range field always consists of the following fields: