diff --git a/Core/CMP API Specification.md b/Core/CMP API Specification.md index fadcebb..ce1ed11 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” +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 @@ -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. +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 +pingData: object // see PingReturn } ``` @@ -875,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,7 +892,14 @@ 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', + cmpDisplayStatus: 'hidden', + supportedAPIs : ['tcfeuv2', 'tcfva', 'usnat'], + cmpId : 31 +} }; } else if (cmd === 'removeEventListener') @@ -913,11 +918,36 @@ window.__gpp_stub = function () return { eventName : 'listenerRemoved', listenerId: par, // Registered ID of the listener - data : success // status info + 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; } @@ -936,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') diff --git a/Core/Consent String Specification.md b/Core/Consent String Specification.md index 0e9211b..565b482 100644 --- a/Core/Consent String Specification.md +++ b/Core/Consent String Specification.md @@ -174,9 +174,9 @@ To decode a code word, remove the final "1", assign the remaining values 1,2,3,5 The following details provide information on creating, storing, and managing a GPP String. The basic steps for creating a GPP String are as follows: 1. **Create discrete sections.** For each section: - - For sections that use the recommended base64-websafe encoding, create a bit representation of the section’s header (if it exists) and each sub-section. Then, convert them to base64-websafe without padding (i.e. removing “=” at the end) and concatenate the header and all sub-sections using the “.” (dot) character. + - For sections that use the recommended base64-websafe encoding, create a bit representation of the section’s header (if it exists) and each sub-section adding padding (0) on the right to get to a multiple of 6. Then, convert them to base64-websafe without padding (i.e. removing “=” at the end) and concatenate the header and all sub-sections using the “.” (dot) character. - For sections that use different encoding, ensure that the data is websafe and does not include the “~” (tilde) character. -2. **Create header section.** Create a bit representation of the GPP header section. Include all IDs for discrete sections in a sorted order. Then, convert it to base64-websafe without padding. +2. **Create header section.** Create a bit representation of the GPP header section. Include all IDs for discrete sections in a sorted order. Add padding (0) on the right to get to a multiple of 6. Then, convert it to base64-websafe without padding. 3. **Concatenate all sections.** Concatenate the GPP-header as the first item to the encoded versions of the discrete sections using “~” (tilde) as the delimiter. @@ -266,10 +266,10 @@ The Header is always required and always comes first. It consists of the followi Based on the Section ID table above, the Section ID for EU TCF v2 is 2. - Full header bit string: 000011 000001 000000000001 0 011 + Full header bit string with padding: 000011 000001 000000 000001 001100 - Encoded header: DBABMA + Encoded header: DBABM @@ -298,7 +298,7 @@ Based on the Section ID table above, the Section ID for EU TCF v2 is 2.
  • Version = 000001
  • Section Range