Display privacy manager link based on end-user location. (GDPR TCF and U.S. Privacy Legacy)

   Permission: Vendor list-GDPR and/or Vendor list-U.S. Privacy

Sourcepoint provides a JavaScript code that can be implemented on your property that allows end-users to directly manage their consent preferences on an ongoing basis without having to re-encounter your organization's first layer message. This code is implemented on-page as a link or button.

For organizations who have implemented both GDPR TCF and U.S. Privacy campaigns on their property, you will only want your end-user to interact with the correct privacy manager based upon the region to which the end-user belongs (e.g. an end-user who is currently in the E.U. and provided consent for GDPR TCF should only be able to manage their consent for GDPR TCF on an ongoing basis while in the E.U.)

In this article, we will cover how to conditionally render either a GDPR TCF or U.S. Privacy privacy manager link/button on your property based upon the end-user's region. 

  Note: Ensure that the GDPR TCF and U.S. Privacy vendor lists for the property have the Applies Scope setting correctly configured and that the scenarios for each messaging campaign are targeting the appropriate regions using the geo-targeting condition.

Use Case

In this article, we will use the details of the following use case to control which privacy manager the end-user can resurface depending on the region they are in when accessing our property.


On our website property we have two messaging campaigns that collect consent from end-users in the EEA + UK and California using the GDPR TCF and U.S. Privacy- CCPA, respectively. We want to implement a button at the bottom of our website that can resurface our configured privacy manager for each respective framework based on the location of the end-user. Our desired experience for this link is as follows:

  • The button should surface the appropriate privacy manager for the regional framework to which the end-user belongs.
  • The text of the button should also change depending on which privacy manager will be resurfaced
  • For users who do not belong to any of the specified regions configured in our vendor lists and scenarios, the button should not be visible



In order to conditionally display and resurface the appropriate privacy manager based on the end-user's region we will:

  • Create a placeholder button on our page
  • Use CSS to set the default visibility of that button to :hidden
  • Add logic to the onConsentReady event callback that will edit the button visibility and text, and insert the appropriate privacy manager for our placeholder button based on the message_type and info.applies parameter
Sourcepoint JavaScript HTML CSS
onConsentReady: function (message_type, uuid, string, info) {
    if((message_type == "ccpa") && (info.applies)){
    	/* code to insert the CCPA footer link */
            document.getElementById("pmLink").innerHTML= "Do Not Sell";
            document.getElementById("pmLink").onclick= function(){
    if((message_type == "gdpr") && (info.applies)){
    	/* code to insert the GDPR footer link */
            document.getElementById("pmLink").innerHTML= "Privacy Preferences";
            document.getElementById("pmLink").onclick= function(){
Was this article helpful?
0 out of 0 found this helpful



Article is closed for comments.