How to set up a consent management for Locator & Pages

Last updated on July 4th, 2024

In order to be able to position the user on the Locator map, the Uberall Locator has to send the user's IP address to Google. In order to respect the end-user's privacy, the map will not be displayed before receiving consent from the end-user. This end-user consent handling needs to be considered when implementing the Uberall Locator & Pages.

Delete

Disclaimer

Please see the following steps as an example on how to set up the consent management logic. The provided code might not work with any consent management tool.

Prevent loading of Locator map

First of all, the map of the locator should not load right away when entering the website. This can be realized by setting:

data-showbacklink=“false”

This prevents the map from loading in the first place and makes sure, that no data is submitted towards Google.

Next, users should be asked to accept Cookies and consent to the submission of their IP address to Google for positioning. Implement the following:

// Handle consent status
      // Change category here, always in the format ',<categoryID>,'
      if (OptanonActiveGroups.indexOf(",3,") > -1) {
        locatorSrc = "static-prod.uberall.com/assets/storeFinderWidget-v2.js";
        window.dataLayer.push({ event: "OneTrustGroupsUpdated" }); // shouldn't be needed if not using GTM
        var storeFinder = document.getElementById("store-finder-widget");
        storeFinder.setAttribute("data-showbacklink", true);
      } else {
        locatorSrc =
          "https://static-prod.uberall.com/assets/storeFinderWidget-v2-withoutMap.js";
      }

In case the user does not consent, they will be directed to the "All locations" page, where no map is loaded, but all location pages are listed

This locatorSrc is being used:

else {
        locatorSrc =
          "https://static-prod.uberall.com/assets/storeFinderWidget-v2-withoutMap.js";
      }


In case users consent, the regular source should be used and the map should load.

This locatorSrc is being used:

{
        locatorSrc = "https://static-prod.uberall.com/assets/storeFinderWidget-v2.js";
        window.dataLayer.push({ event: "OneTrustGroupsUpdated" }); // shouldn't be needed if not using GTM
        var storeFinder = document.getElementById("store-finder-widget");
        storeFinder.setAttribute("data-showbacklink", true);
      }



Also read: Does a Locator add cookies to the website it has been implemented in?


Was this article helpful?

Save as PDF