# Commanders Act TMS

Consent Module and TMS Commanders Act are natively integrated with each other. This setup requires minimal technical knowledge and can be done entirely in the interface.

## Setup

Following you will find the required steps to implement a standard Commanders Act Consent module setup.

1. Choose the default account configuration mode for your account (see [Options](https://doc.commandersact.com/features/consent-management/user-guides/settings)).
2. Setup your Consent categories & vendors (see [Manage Categories](https://doc.commandersact.com/features/consent-management/user-guides/categories-and-tags/manage-categories)).
3. Assign your Consent categories & vendors to your Commanders Act Web Container tags (see [Assign categories](https://doc.commandersact.com/features/consent-management/user-guides/categories-and-tags/assign-categories))
4. Create one or multiple Consent banner templates (see [Manage Banner](https://doc.commandersact.com/features/consent-management/user-guides/privacy-banners/manage-banner))
5. Deploy your Consent banner templates to the Commanders Act CDN or on premise target (see [Deploy Banner](https://doc.commandersact.com/features/consent-management/user-guides/privacy-banners/deploy-banner)).
6. Connect your privacy banner templates with Commanders Act Web Container and implement rules for which the banner should be played out (see below).

## Install Consent banner with TMS Commanders Act

To deploy a Consent banner with the Commanders Act TMS it needs to be linked to a container. Commanders Act TMS can then be use to implement detailed rules for which a Consent banner is shown to visitors.

Implement rules to display Consent banners

`Sources > Overview > Web Containers > tab RULES > Privacy Banners Constraints​`

<figure><img src="https://1259070148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk6XpTQ2LaRLcr2tA-d%2Fuploads%2Fgit-blob-ea107508e81c0554331e8f5ed90ca79ba959f98b%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

In Commanders Act TMS it is possible to provide exact conditions to decide when each of the linked privacy banners should be shown to visitors. Typical use cases consist of:

* Implement different banner for different languages or regions
* Avoid to deploy the banner on legal pages (privacy policy) so that users can read them before providing consent.
* Implement AB test for two banner designs.

You can create constrains under the `PRIVACY BANNERS` section to define under which conditions a privacy banner should be shown. Privacy banner constraint work the same way as tag constraints. Please reference constraints in the Web Container documentation for more information.

<figure><img src="https://1259070148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk6XpTQ2LaRLcr2tA-d%2Fuploads%2Fgit-blob-65306e365deb7f8eaad6018b5a57024aa8e61060%2Fimage.png?alt=media" alt=""><figcaption><p>Example: The selected banner would only load in case the data layer property env_language has the value FR.</p></figcaption></figure>

{% hint style="info" %}
You have to first deploy a banner to the Commanders Act CDN or on premise location before being able to configure constraints (see [Deploy Banner](https://doc.commandersact.com/features/consent-management/user-guides/privacy-banners/deploy-banner)).
{% endhint %}

## Link Consent banner with Commanders Act Web Container <a href="#link-trustcommander-banner-with-tagcommander-container" id="link-trustcommander-banner-with-tagcommander-container"></a>

`Sources > Overview > Web Containers > tab GENERATE`

<figure><img src="https://1259070148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk6XpTQ2LaRLcr2tA-d%2Fuploads%2Fgit-blob-22d68c9ae2edaaae4a72d63bb3f8a9c271310b3d%2Fimage.png?alt=media" alt=""><figcaption><p>Example: Add privacy banner to Commanders Act TMS container.</p></figcaption></figure>

Commanders Act TMS makes it easy to implement Consent banner on websites. To link a privacy banner with a Commanders Act TMS container it just has to be activated in the `GENERATE` tab with the `ACTIVATION` checkbox. This installs the selected privacy banner in the generated container version.

<figure><img src="https://1259070148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk6XpTQ2LaRLcr2tA-d%2Fuploads%2Fgit-blob-8b645b39d3c46e5ad13d2e787889b0554cac3f4e%2Fimage.png?alt=media" alt=""><figcaption><p>Example: Consent banners are now deployed with the Commanders Act TMS container.</p></figcaption></figure>

{% hint style="info" %}
You have to first deploy a banner to the Commanders Act CDN or on premise location before boing able to link it (see [Deploy Banner](https://doc.commandersact.com/features/consent-management/user-guides/privacy-banners/deploy-banner)).
{% endhint %}

{% hint style="info" %}
All web containers of your website should be re-generated and deployed when installing a new privacy banner.
{% endhint %}

## Go further with OnSite API

The OnSite API allows you to reload your container(s) on consent, manage behaviour or create custom variables/rules!

You can find the full list of commands in the [dedicated section](https://doc.commandersact.com/features/sources/sources-catalog/web/containers/best-practices/apis/onsite-api).

To reload your web container(s) on user consent, here's a sample code that you can use in the custom js block of your privacy banner, or directly in your web containers

```javascript
/* Reload web containers on user interaction */

cact('consent.onUpdate', function (result) {      
        tC.script.add("https://cdn.tagcommander.com/xxxx/my_container_name.js");
});
```

```javascript
/* Different approach for container reoad - based on work environment variable */

cact('consent.onUpdate', function (result) {      
    if (tc_vars.env_work === 'prod') {    
        tC.script.add("https://cdn.tagcommander.com/xxxx/my_container_name.js");
    } else {          
        tC.script.add("https://cdn.tagcommander.com/xxxx/uat/my_container_name.js"); 
    } 
});
```
