Skip to main content
Some characteristics should accompany the visitor beyond the session: the customer group they once selected, or the product range they are interested in. For this, the shop creates its own cookie in which you can store any key-value pairs. This so-called design cookie is encrypted and compressed. The visitor can neither read nor change what is in it. Guide: Onsite personalization
Nothing is written without the visitor’s consent. If there is no consent for the design cookie, DC-CookieData_set() has no effect, without any error message appearing. Therefore, build your template so that it also looks sensible without the stored characteristics.

Writing and reading

If the key already exists, _set() replaces the previous value. If it is new, it is added. A key can therefore never appear twice in the cookie.
Both arguments of _set() must be filled. An empty value does not delete the key, but makes the tag invalid. Upper and lower case of the keys do not matter: Kundengruppe and kundengruppe are the same entry.

Iterating over all pairs

Without a parameter, DC-CookieData() is a loop tag over all stored pairs.
Within the loop, ~DC-CookieData~ outputs the key of the current entry and ~DC-CookieData_get()~ its value. This lets you list the entire content of the cookie, which is helpful during development.
Bracketing also works within the loop and then checks against the key of the current entry.

Reusing a value

DC-CookieData_get() outputs, nothing more. If the value is to be used in a query or in another tag, provide it with _touchKey() and retrieve it via the two touched tags.
Reference: DC- (free parameters and session parameters) The shop only sends the changed cookie along with the next page. If the visitor leaves the shop directly after the page on which _set() appeared, nothing has been saved. DC-CookieData_cookieHasChanged applies exactly when something in the cookie was changed on this page. Within it, you can additionally set the cookie in the browser.
DC-CookieData_cookieName and DC-CookieData_cookieValue are not listed as separate tags in the previous documentation, but they exist in the shop and are already used in the example above.
The output value is the encrypted cookie content, not your plain-text data. Only the shop can decode it. Therefore, do not evaluate it in JavaScript.

Limits

The second case affects not just the one entry that is too long, but the entire cookie: all previously stored characteristics are then gone. Therefore, store short keys and short values, for example abbreviations instead of full names, and do not store lists in the cookie.
The design cookie is intended for characteristics, not for data. Anything that should only apply within the session belongs in a session parameter DC-SPX, and anything that belongs to the customer account belongs in the customer data.

Overview of the tags

All tags are permitted in all templates.
  • Guide: Onsite personalization
  • Materials: Cookies used
  • Reference: DC- (free parameters and session parameters)
  • Reference: CHECK- (URL and cookie data)