XML/XHTML implementation format guide (Blogger)

Sourcepoint's CMP and Preferences implementation code snippet is comprised of 2-3 JavaScript tags (depending on implementation) that are added to the page code of a web property. When implementing the CMP and/or Preferences on web properties that utilize XML/XHTML (e.g. Blogger) these JavaScript tags must be further edited in order to prevent the XML parser from misinterpreting JavaScript characters.

In this article, we will cover how to edit the implementation code generated by the Sourcepoint portal so that it can be successfully read by an XML parser.  

To start, retrieve the implementation code for your property by clicking Properties on the left-hand panel and selecting Properties from the subsequent menu.

Screen Shot 2021-10-25 at 9.26.56 AM.png

Click <> inline with the property name.

Screenshot 2025-03-07 at 1.26.58 PM.png

Use the subsequent modal to select the campaigns that your organization has already configured for the property. Click Copy Code to copy the generated snippet.

Screenshot 2025-05-08 at 2.00.41 PM.png

Customize the copied scripts as necessary. Please review our implementation guides below for more information:

Once your implementation is customized, you will need to add a <![CDATA[ ... ]]> section inside the following <script> tags of the implementation code snippet:

  • Stub files (if generated) 
  • Client configuration script

  Note: The <![CDATA[ ... ]]> section does not need to be added to the URL to messaging library script (e.g. https://cname.subdomain/unified/wrapperMessagingWithoutDetection.js).  

See below for an example:

//Example only. Please use stub file generated in Sourcepoint portal as it may have changed.
<script>
//<![CDATA[
function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(){for(var t,e,o=[],n=window,r=n;r;){try{if(r.frames.__tcfapiLocator){t=r;break}}catch(t){}if(r===n.top)break;r=n.parent}t||(function t(){var e=n.document,o=!!n.frames.__tcfapiLocator;if(!o)if(e.body){var r=e.createElement("iframe");r.style.cssText="display:none",r.name="__tcfapiLocator",e.body.appendChild(r)}else setTimeout(t,5);return!o}(),n.__tcfapi=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return o;"setGdprApplies"===n[0]?n.length>3&&2===parseInt(n[1],10)&&"boolean"==typeof n[3]&&(e=n[3],"function"==typeof n[2]&&n[2]("set",!0)):"ping"===n[0]?"function"==typeof n[2]&&n[2]({gdprApplies:e,cmpLoaded:!1,cmpStatus:"stub"}):o.push(n)},n.addEventListener("message",(function(t){var e="string"==typeof t.data,o={};if(e)try{o=JSON.parse(t.data)}catch(t){}else o=t.data;var n="object"===_typeof(o)?o.__tcfapiCall:null;n&&window.__tcfapi(n.command,n.version,(function(o,r){var a={__tcfapiReturn:{returnValue:o,success:r,callId:n.callId}};t&&t.source&&t.source.postMessage&&t.source.postMessage(e?JSON.stringify(a):a,"*")}),n.parameter)}),!1))}();
//]]>
</script> <script>
//<![CDATA[ window._sp_queue = []; window._sp_ = { config: { accountId: 22, baseEndpoint: 'https://cdn.privacy-mgmt.com', gdpr: { }, events: { onMessageChoiceSelect: function() { console.log('[event] onMessageChoiceSelect', arguments); }, onMessageReady: function() { console.log('[event] onMessageReady', arguments); }, onMessageChoiceError: function() { console.log('[event] onMessageChoiceError', arguments); }, onPrivacyManagerAction: function() { console.log('[event] onPrivacyManagerAction', arguments); }, onPMCancel: function() { console.log('[event] onPMCancel', arguments); }, onMessageReceiveData: function() { console.log('[event] onMessageReceiveData', arguments); }, onSPPMObjectReady: function() { console.log('[event] onSPPMObjectReady', arguments); }, onConsentReady: function (consentUUID, euconsent) { console.log('[event] onConsentReady', arguments); }, onError: function() { console.log('[event] onError', arguments); }, } } }
//]]> </script> <script src="https://cdn.privacy-mgmt.com/unified/wrapperMessagingWithoutDetection.js" async></script>
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.