> For the complete documentation index, see [llms.txt](https://docs.didomi.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.didomi.io/widgets/widget-editor/widget-macros.md).

# Widget macros

{% hint style="success" %}
**Access Type**: Widgets - Editor
{% endhint %}

Macros are variables that your organization can insert into text components of widgets. Once inserted into a text component, the macro will automatically retrieve the appropriate information for the macro and insert it into the text. In this article we will cover:

* [Widget macro glossary](#widget-macro-glossary)
* [Insert macro into widget text](#insert-macro-into-widget-text)

{% hint style="info" %}
Macros are identified by the use of curly brackets {}, for example: {numberofPartners}.
{% endhint %}

***

### Widget macro glossary

The following macros are currently available by default and can be inserted into text components:

<table><thead><tr><th width="247">Macro</th><th>Description</th></tr></thead><tbody><tr><td>{privacyPolicyURL}</td><td>Inserts the privacy policy URL configured for the brand used in the consent flow</td></tr><tr><td>{websiteName}</td><td>Inserts the company name configured for the brand used in the consent flow</td></tr><tr><td>{numberOfPartners}</td><td>Inserts the total number of vendors added to the consent flow</td></tr><tr><td>{numberOfIABPartners}</td><td>Inserts the total number of IAB vendors added to the consent flow</td></tr><tr><td>{numberofNonIABPartners}</td><td>Inserts the total number of non-IAB vendors added to the consent flow</td></tr></tbody></table>

### Insert macro into widget text

To insert a macro, click **Widgets** on the left-hand panel and select the **Edit** icon inline with a widget name.

<figure><img src="/files/5v8XgXQ3a2Lajez6F8DG" alt="" width="563"><figcaption></figcaption></figure>

Add a text component to the widget or select an existing text component in the widget in the preview window.

<figure><img src="/files/Evos59rRmCus4lKy9vws" alt="" width="563"><figcaption></figcaption></figure>

With the text component selected in the preview window, ensure the **Settings** tab is selected in the right-hand panel and expand the **Content** accordion. &#x20;

<figure><img src="/files/wRaCpytYBb0YtrCAOARN" alt="" width="563"><figcaption></figcaption></figure>

Position the cursor in the text field where the macro should be added and click the **{}** icon in the toolbar.

<figure><img src="/files/eGrrbnLpisZVeoakGl1G" alt="" width="286"><figcaption></figcaption></figure>

Select a macro from the drop-down menu.

<figure><img src="/files/AwHk4CtcqDorGKb0wadJ" alt="" width="297"><figcaption></figcaption></figure>

The selected macro will be inserted the text component. Click **Save** to confirm the edit.


---

# 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://docs.didomi.io/widgets/widget-editor/widget-macros.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.
