Websites (Hardcoded)

Steps to hardcode TrustCommander on websites.

TrustCommander can be directly integrated with websites. The setup requires technical installation steps.


Following you will find the required steps to implement a standard TrustCommander setup.

  1. Choose the default account configuration mode for your account (see Options).

  2. Setup your TrustCommander categories & vendors (see Manage Categories).

  3. Create one or multiple banner templates (see Manage Banner)

  4. Deploy your TrustCommander banner templates to the Commanders Act CDN or on premise target (see Deploy Banner).

  5. Install TrustCommander tag (see below)

  6. Manage onsite tags with TrustCommander (see below).

Install TrustCommander tag

To hardcode TrustCommander on websites you need to add following JavaScript tag to your website. This snippet should be added to the <head> of your website.

<script type="text/javascript" src="{{ privacy_tag_url }}"></script>

{{ privacy_tag_url }} has to be replaced with your privacy JavaScript tag URL. This URL can be found in the GENERATE & DEPLOY tab of each privacy banner.

Manage onsite tags with TrustCommander

Add tag triggers

TrustCommander can manage onsite JavaScript tags by wrapping them in a script tag with a custom MIME type.

This approach only works when you install TrustCommander in the <head> of the document (e.g. not when injecting the TrustCommander tag via Google Tag Manager)!

This TrustCommander wrapper does only fire that wrapped JavaScript code in case a visitor provided consent for the specified privacy category ID.

<script type="text/tc_privacy" data-category="{{ category_or_sub-category_id }}" data-vendor="{{ vendor_id }}">
{{ tag_javascript_code }}

The <script> has to have type="text/tc_privacy" .

{{ tag_javascript_code }} has to be replaced with the JavaScript code of the tag you want to manage with TrustCommander.

{{ category_or_subcategory_id }} has to be replaced with the category or sub-category of the TrustCommander category that should manage this tag (see Manage Categories). Be careful when you create sub-categories associated to a category: you have to enter the sub-category ID in the attribute, not the category ID, as the user will be able to activate or deactivate only sub-categories and not the main category in the banner:

{{ vendor_id }} has to be replaced with the vendor ID of the vendor related to the tag (Only available when native vendors are activated for the account).


Following examples shows how you would manage a Criteo Tag based on a TrustCommander category named "Retargeting".

Retargeting was assigned to sub-category ID 6. In case a sub-category is used you should never use the main category (4 in this case) to manage tags.

The Tag wrapper for the Criteo JavaScript tag might look like this (example shortened):

<script type="text/tc_privacy" data-category="6" src="//" async="true">
<script type="text/tc_privacy" data-category="6">
window.criteo_q = window.criteo_q || [];