> For the complete documentation index, see [llms.txt](https://community.commandersact.com/tagcommander/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://community.commandersact.com/tagcommander/user-manual/serverside/consents.md).

# Consents

## 1. Hybrid serverside : Managing consent client side with your CMP

If you setup a serverside tag from your web container, one way to manage consents is to fire or not your serverside tag depending of your CMP signal.\
Commanders Act offers with TrustCommander an integrated way to manage the firing of your tags depending of consent categories by a simple mapping beetween your tags and your categories.

Nevertheless, for a more precise management, even in hybrid setup we recommand to manage consent in serverside constraints.

## 2. Managing consents with serverside's constraints

We recommand to manage your serverside's tags through constraints, using a variable containing the list of optin categories.

* 1. Create an [external variable](https://community.commandersact.com/tagcommander/user-manual/serverside/datalayer#external-variables) `consent_categories`  and feed it with the user's consent from your CMP. We recommand that consent\_categories is feeded by a list of categorie's ids.\
     (You can also create one variable per category of course if needed)

![](/files/-MZmXjEbOxA9TUIpgBxF)

* 2\. Create a constraint in your serverside container that rely on `consent_categories`
* 3\. Attach the constraint to your tags

![](/files/-MZmX6rxBTZrd8pId8Uk)

{% hint style="info" %}
With **TrustCommander**, you can get your consent categories easily inside your client container using our Javascript API`cact('consent.get')` and put the result inside a variable that will be send through your serverside tag.\
See documentation here : <https://community.commandersact.com/trustcommander/onsite-api/consent.get>
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://community.commandersact.com/tagcommander/user-manual/serverside/consents.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
