Documentation > UCP Implementation Guide > Testing

General Functional Testing

It can be a challenge to test the UCP scripts in non-production environments. For example, if you configure a notice for “” and you are trying to test from “” the notice will not function as the domain won’t match. There are several strategies to overcome this.

Duplicate Notice Testing

The first strategy is to create a notice for “” that is configured exactly the same way as “” (same countries, translations, consent settings, themes, etc.).  This is an easy way to run some initial tests but may not satisfy all the acceptance criteria of your testers.

One of the downsides of this testing is the list of vendors for “” won’t match the vendors for “” since it is unlikely you have set up all the advertising vendors on that site.  And, even if you have, it may not be publicly accessible for our scanners to pull vendors from.

Root Domain Testing

Depending on how your domains are set up you may be able to set up a notice for the root domain that covers both “” and “”.  This will show the same notice for both environments with the list of vendors and everything.  However, it may not be appropriate based on your environment to set up a root domain notice.

Javascript Domain Override

UCP has a full JavaScript API that can be used to force a specific Domain to be registered for the script to execute on. This is available so you can test on a site other than the one to which you will push to production. This requires a JavaScript call to fire on your test site.  Here is an example of what that would look like:

setTimeout(function () {


}, 2000);

This is handled in a timeout because the script needs to load and try to detect the current domain first.  If the script hasn’t loaded this setDomain call will fail.

Ask your CSM for a copy of our Javascript API documentation for more details on this and other API functions.

Connect with Crownpeak