Question


Pegasystems Inc.
PL
Last activity: 27 Sep 2019 6:34 EDT
iOS/MacOs Cookie Acceptance Message
If we login to Pega via web mashup on an apple device, we get the message: 'This page displays information that requires cookies to be set. Confirm to continue'. With a 'Confirm' button. After we click on the button, the Pega gadget is loaded.
This configuration is scripted OOTB in a text file with id: 'PegaCompositeGadgetMgr' js in rulset: 'Pega-UIEngine:08-02-01' on line 413.
We want to change or translate the text in the button 'Confirm'. Are we able to do that? If yes, how?
***Edited by Moderator: Lochan to update platform capability tags***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!


Pegasystems Inc.
IN
To change the text on the confirm button "This page displays information that requires cookies to be set. Confirm to continue".
Pega exposed a javascript variable to override that text i.e pega.web.config.strCookieConsentMessage
we need to add script in the gadget like below in script tags
pega.web.config.strCookieConsentMessage = "My custom message";
To set the custom webconfig properties check the below article


BPM Company
NL
Hello gadig,
Thank you for your response. The script you mentioned allowes us to customize the cookie consent message, but not the caption on the button. As you can see in the 'PegaCompositeGadgetMgr' js text file at line 428 the caption on the button is hardcoded set with 'Confirm':
consentMarkup=consentMessage+"<button onclick='pega.web.mgr.openCookieConsent(\""+ oGt._id +"\")'> Confirm </button>";
Do you have any possibilities to change this too? If not, is it possible to disable cookie consent message?
Thank you


Pegasystems Inc.
IN
As its a pega gadget ,its not possible to localize that .
But we can expose a confirmButtonMsg via pega.web.config.confirmButtonMsg in next available patch release if required.
Meanwhile you can override
<script>
pega.u.d.attachOnload(function(){
if(pega.web && pega.web.manager){
pega.web.manager.prototype.addCookieAcceptanceMessage= function(oGt){
var oCD = document.createElement('div');
oCD.className = "pega-mashup–cookieconsent";
var consentMarkup = "";
if(pega.web.config.fnCookieConsentMessage){
consentMarkup = pega.web.config.fnCookieConsentMessage(oGt._id);
}else{
var consentMessage = "";
if(pega.web.config.strCookieConsentMessage){
consentMessage = pega.web.config.strCookieConsentMessage;
}else{
consentMessage = "This page displays information that requires cookies to be set. Confirm to continue.";
}
consentMarkup=consentMessage+"<button onclick='pega.web.mgr.openCookieConsent(\""+ oGt._id +"\")'> MyCustomConfirmMsg </button>";
}
oCD.innerHTML = consentMarkup;
oGt._oDiv.appendChild(oCD);
};
}
}
As its a pega gadget ,its not possible to localize that .
But we can expose a confirmButtonMsg via pega.web.config.confirmButtonMsg in next available patch release if required.
Meanwhile you can override
<script>
pega.u.d.attachOnload(function(){
if(pega.web && pega.web.manager){
pega.web.manager.prototype.addCookieAcceptanceMessage= function(oGt){
var oCD = document.createElement('div');
oCD.className = "pega-mashup–cookieconsent";
var consentMarkup = "";
if(pega.web.config.fnCookieConsentMessage){
consentMarkup = pega.web.config.fnCookieConsentMessage(oGt._id);
}else{
var consentMessage = "";
if(pega.web.config.strCookieConsentMessage){
consentMessage = pega.web.config.strCookieConsentMessage;
}else{
consentMessage = "This page displays information that requires cookies to be set. Confirm to continue.";
}
consentMarkup=consentMessage+"<button onclick='pega.web.mgr.openCookieConsent(\""+ oGt._id +"\")'> MyCustomConfirmMsg </button>";
}
oCD.innerHTML = consentMarkup;
oGt._oDiv.appendChild(oCD);
};
}
}
,false);
</script>


BPM Company
NL
Hi Gadig,
Thank you for your response.
Yes, exposing confirmButtonMsg would be great. Could you please request this for the next patch release and let me know in which patch release this will be available?
Is it also possible to disable the cookie consent message so it will be never showed?
How can I override the OOTB function with the script you have provided? Overriding the 'PegaCompositeGadgetMgr' js file is not an option because it is a final rule.
Thank you.


Pegasystems Inc.
IN
As you cannot override the final rule, i have exposed only the corresponding function. So that you can use the script for now and once you upgraded to patch release you can remove the script, so that you can use the exposed property pega.web.config.confirmButtonMsg .
In the above script in place of confirmButtonMsg ,you can write your own text as you wish as that script will override OOTB pega function.
Removing consentmessage decision will be taken by concerned team that owns this gadget while fixing the bug in patch release. As of now , i cannot assure you about that.


BPM Company
NL
Hi Gadig,
Where do I have to place the script exactly?
How can I monitor when the exposed property is available to use?
Thank you.


Pegasystems Inc.
IN
Try the script in userworkform first and try .If that does not work. Place the script in your gadget html ,in the place where you generally place scripts.
Regarding montering the fix for patch release, i need to contact gcs once how can you will be in sync with the bug fix.I will let you know about it.