---
title: "TypoScript setup"
version: "5.0"
permalink: "https://docs.typo3.org/permalink/dmind/cookieman:typoscript-setup@5.0"
source: "Configuration/Reference/TypoScriptSetup/Index.rst"
rendered: "2026-11-25T17:56:19+00:00"
---

# TypoScript setup {#typoscript-setup}

See a full TypoScript [Configuration example](https://docs.typo3.org/permalink/dmind/cookieman:configuration-example@5.0).

All configuration is prepended with `plugin.tx_cookieman.settings`.

## groups {#groups}

-   **groups**

    `|` *Data type:* array
    `|` *Default:* mandatory
    `|`

    Holds the group configurations. A group contains several tracking objects.

    By default, it only contains the 'mandatory' group, which includes the `CookieConsent` settings cookie.
    See a full TypoScript [Configuration example](https://docs.typo3.org/permalink/dmind/cookieman:configuration-example@5.0).

## groups.\<group-key> {#groups-group-key}

-   **groups.\<group-key>**

    `|` *Data type:* array
    `|` *Default:* mandatory
    `|`

    A single group. The group's key (name) should not contain spaces and non-ASCII characters.

    It will be saved in the settings cookie and can be checked with JavaScript: `hasConsented('‹group-key›')`

## groups.‹group-key›.preselected {#groups-group-key-preselected}

-   **groups.\<group-key>.preselected**

    `|` *Data type:* [boolean](https://docs.typo3.org/m/typo3/reference-typoscript/14.3/en-us/Syntax/StringFormats/Index.html#data-type-boolean)
    `|` *Default:* 0 (not set)
    `|`

    If enabled (`1`), the group's consent checkbox will be already checked when the popup opens.

    The default group 'mandatory' has this set to `1`.

## groups.‹group-key›.disabled {#groups-group-key-disabled}

-   **groups.\<group-key>.disabled**

    `|` *Data type:* [boolean](https://docs.typo3.org/m/typo3/reference-typoscript/14.3/en-us/Syntax/StringFormats/Index.html#data-type-boolean)
    `|` *Default:* 0 (not set)
    `|`

    If enabled (`1`), the group's consent checkbox will be disabled (cannot be changed).

    The default group 'mandatory' has this set to `1`.

## groups.‹group-key›.trackingObjects {#groups-group-key-trackingobjects}

-   **groups.\<group-key>.trackingObjects**

    `|` *Data type:*  array with numeric indices
    `|`

    Holds a list of tracking object keys (numbered).

    Example:

    ```typoscript
    trackingObjects {
      0 = CookieConsent
      1 = fe_typo_user
    }
    ```

## groups.‹group-key›.respectDnt {#groups-group-key-respectdnt}

-   **groups.\<group-key>.respectDnt**

    `|` *Data type:* [boolean](https://docs.typo3.org/m/typo3/reference-typoscript/14.3/en-us/Syntax/StringFormats/Index.html#data-type-boolean)
    `|` *Default:* 0 (not set)
    `|`

    If set to `1`, this group respects to the ["Do-not-track" setting of your browser](https://en.wikipedia.org/wiki/Do_Not_Track).

## groups.‹group-key›.showDntMessage {#groups-group-key-showdntmessage}

-   **groups.\<group-key>.showDntMessage**

    `|` *Data type:* [boolean](https://docs.typo3.org/m/typo3/reference-typoscript/14.3/en-us/Syntax/StringFormats/Index.html#data-type-boolean)
    `|` *Default:* 0 (not set)
    `|`

    If set to `1` **and** the ["Do-not-track" setting of your browser](https://en.wikipedia.org/wiki/Do_Not_Track) is enabled, an additional message about that is shown inside the group.

## trackingObjects {#trackingobjects}

-   **trackingObjects**

    `|` *Data type:* array
    `|`

    This array holds the tracking object configurations.

    The Cookieman extension already provides several **preconfigured** tracking objects
    in the folder [./Configuration/TypoScript/TrackingObjects/](https://github.com/dmind-gmbh/extension-cookieman/tree/master/Configuration/TypoScript/TrackingObjects)
    (link to the Github repository).

    > [!IMPORTANT]
    > If you add a preconfigured tracking object, you must at least **adapt** the `inject` code to your needs!

    The default group 'mandatory' only contains the tracking object `CookieConsent` settings cookie.

## trackingObjects.‹tracking-object-key› {#trackingobjects-tracking-object-key}

-   **trackingObjects.‹tracking-object-key›**

    `|` *Data type:* array
    `|` *Example:* fe_typo_user
    `|`

    A single tracking object configuration.

    Example:

    ```typoscript
    plugin.tx_cookieman.settings.trackingObjects {
        // 'Matomo' is the ‹tracking-object-key›:
        Matomo {
            // injected code, if consent is given:
            inject = TEXT
            inject {
                insertData = 1
                value (
                    <script nonce="{request : nonce | value}"
                       data-what="Matomo"
                       src="{asset : EXT:cookieman/Resources/Public/Js/Injects/example-inject.js}?{date : U}"
                    ></script>
                )
            }

            show {
                // set cookies, if consent is given:
                _pk_id {
                    duration = 13
                    durationUnit = months
                    type = cookie_http+html
                    provider = Matomo
                }

                // etc.
            }
        }
    }
    ```

## trackingObjects.‹tracking-object-key›.inject {#trackingobjects-tracking-object-key-inject}

-   **trackingObjects.‹tracking-object-key›.inject**

    `|` *Data type:*  / cObject
    `|` *Example:*  \<script src="/path/to/tracking-code.js">\</script>
    `|`

    Each HTML tag in here will be appended to the page when the respective group is consented.
    This can be `<script>`, `<img>` or anything else.

    You can either use inline script or link to an external file (useful if a HTTP header `Content-Security-Policy` is set).

    If you need a local path from your `_assets` directory, let TYPO3 build it. We currently recommend using `TEXT`
    with `insertData = 1` and the getText `{asset : EXT:…}`. We recommend adding `?{date : U}` to add a cache-busting parameter.
    See the example above.

## trackingObjects.‹tracking-object-key›.show {#trackingobjects-tracking-object-key-show}

-   **trackingObjects.‹tracking-object-key›.show**

    `|` *Data type:* array
    `|`

    The actual rows of the table, each representing one "tracking item" (usually a cookie).

## trackingObjects.‹tracking-object-key›.show.‹tracking-item-key› {#trackingobjects-tracking-object-key-show-tracking-item-key}

-   **trackingObjects.‹tracking-object-key›.show.‹tracking-item-key›**

    `|` *Data type:* array
    `|` *Example:*  \_pk_id
    `|`

    A single "tracking item" (e.g. the name of a cookie).
    A cookie that matches this name will be removed when consent for the group in which this tracking object is included
    is revoked. (see also [trackingObjects.‹tracking-object-key›.show.‹tracking-item-key›.htmlCookieRemovalPattern](https://docs.typo3.org/permalink/dmind/cookieman:trackingobjects-e2-80-b9tracking-object-key-e2-80-ba-show-e2-80-b9tracking-item-key-e2-80-ba-htmlcookieremovalpattern@5.0))

## trackingObjects.‹tracking-object-key›.show.‹tracking-item-key›.duration {#trackingobjects-tracking-object-key-show-tracking-item-key-duration}

-   **trackingObjects.‹tracking-object-key›.show.‹tracking-item-key›.duration**

    `|` *Data type:*
    `|` *Example:*  12
    `|`

    The lifetime of the tracking object (only the "number" part).

## trackingObjects.‹tracking-object-key›.show.‹tracking-item-key›.durationUnit {#trackingobjects-tracking-object-key-show-tracking-item-key-durationunit}

-   **trackingObjects.‹tracking-object-key›.show.‹tracking-item-key›.durationUnit**

    `|` *Data type:*
    `|` *Example:*  months
    `|`

    The lifetime of the tracking object (only the "unit" part).

## trackingObjects.‹tracking-object-key›.show.‹tracking-item-key›.type {#trackingobjects-tracking-object-key-show-tracking-item-key-type}

-   **trackingObjects.‹tracking-object-key›.show.‹tracking-item-key›.type**

    `|` *Data type:*
    `|` *Example:*  cookie_http+html
    `|`

    The type of tracking.

    Possible (default) keywords:

    -   `cookie_http+html`: an HTML (=HTTP+HTML) cookie, which is also readable from JavaScript.
        This is the only type that can be removed after consent has been revoked.
    -   `cookie_http`: an HTTP cookie
    -   `pixel`: a tracking pixel

    > [!NOTE]
    > You can add your own types by adding a localization string `type.‹your-type-key›`.

## trackingObjects.‹tracking-object-key›.show.‹tracking-item-key›.provider {#trackingobjects-tracking-object-key-show-tracking-item-key-provider}

-   **trackingObjects.‹tracking-object-key›.show.‹tracking-item-key›.provider**

    `|` *Data type:*
    `|` *Example:* Google
    `|`

    The provider of the cookie or tracking object.

## trackingObjects.‹tracking-object-key›.show.‹tracking-item-key›.htmlCookieRemovalPattern {#trackingobjects-tracking-object-key-show-tracking-item-key-htmlcookieremovalpattern}

-   **trackingObjects.‹tracking-object-key›.show.‹tracking-item-key›.htmlCookieRemovalPattern**

    `|` *Data type:*
    `|` *Example:*  ^\_gat(?:\_UA-d+-d+)?$
    `|`

    You can (optionally) set a regex pattern for cookie names here. It will be used during cookie removal.
    If would remove all matched cookies when consent for the group in which this tracking object is included is revoked.
    If this is empty, the tracking object key is used for deletion (see [trackingObjects.‹tracking-object-key›](https://docs.typo3.org/permalink/dmind/cookieman:trackingobjects-e2-80-b9tracking-object-key-e2-80-ba@5.0)).

    > [!NOTE]
    > Cookie removal will only work for tracking object type `cookie_http+html`.
    > See [trackingObjects.‹tracking-object-key›.show.‹tracking-item-key›.type](https://docs.typo3.org/permalink/dmind/cookieman:trackingobjects-e2-80-b9tracking-object-key-e2-80-ba-show-e2-80-b9tracking-item-key-e2-80-ba-type@5.0).
