Difference between production and development codes

When implementing CookieHub, you’ll find two different code snippets in the Implementation tab (for paid subscriptions):

  • Production code – for your live website.
  • Development/Testing code – for testing changes before publishing.

Production code

Use the production code for all live websites.

It ensures proper consent storage and compliance.

Important: Always place the code above all other scripts in the <head> section to allow CookieHub to block scripts before consent is given.


Development/Testing code

If you use the production code in a development environment, CookieHub may not be able to store consent choices if the domain does not match your live configuration. As a result, the consent dialog appears on every page view.

To avoid this, use the development code (visible only for paid subscriptions):

  • Allows testing changes to the CookieHub widget before publishing.
  • The development widget remains active for up to 7 days after the last update in the CookieHub dashboard.

Important:

  • The development code should never be used on production websites.
  • Always publish your changes and switch to the production code before going live.

When to use development code

  • Preview and test widget styling or behavior before publishing.
  • Test functionality in staging or local environments without repeated consent prompts.