How to use Didomi text macros

What is a macro?

Didomi macros are placeholders within text, enclosed in {macro} markers. They are dynamically replaced with specific content, automating text generation.

When do we use macros?

Our macros can be used anywhere in your consent notice, helping you to insert specific information as needed in any text where they are used.

What macros are available?

Below are the macros created to simplify the process of obtaining information such as your company privacy policy, as well as the name and number of vendors you are using.

Name
Value
Description
{privacyPolicyURL}
app.privacyPolicyURL
Privacy Policy URL
{websiteName}
app.name
Name of your website
{numberOfPartners}
 
Dynamic value that displays a numeric count of all partners (i.e., vendors)
{numberOfIABPartners}
 
Dynamic value that displays a numeric count of IAB partners (i.e., vendors)
{numberOfNonIABPartners}
 
Dynamic value that displays a numeric count of all non-IAB partners (i.e., vendors)

These macros will be replaced with the actual value configured when the text is rendered.

How do we use macros?

The example below use all the text macros provided by Didomi:

{privacyPolicyURL} 

Use this macro for redirecting users to your privacy policy link.

Steps:

  1. Add your company privacy policy link in the relevant field in the Content Editor section of the Didomi Console.
  2. Add the following HTML tag to your notice text: <a href="{privacyPolicyURL}" target="_blank">privacy policy</a>

This will redirect users to your website when they click on the privacy policy text link.

Here is an example a text using this macro:

We and our partners place cookies, access and use non-sensitive information from your device to improve our products and personalize ads and other contents throughout this website. You may accept all or part of these operations. To learn more about cookies, partners, and how we use your data, to review your options or these operations for each partner, visit our <a href="{privacyPolicyURL}" target="_blank">privacy policy</a>.

 

{websiteName} 

Use this macro to include your company name in your notice text.

Steps:

  1. Add your company name in the relevant field in the Content Editor section of the Didomi console.
  2. Add the {websiteName} macro your text to display the name of your company.

Here is an example of a text using this macro:

{websiteName} and our partners place cookies, access and use non-sensitive information from your device to improve our products and personalize ads and other contents throughout this website. You may accept all or part of these operations. To learn more about cookies, partners, and how we use your data, to review your options or these operations for each partner, visit our <a href="{privacyPolicyURL}" target="_blank">privacy policy</a>.


{numberOfPartners} or {numberOfIABPartners} or {numberOfNonIABPartners} :

Use this macro to display a dynamic value for the number of vendors included in your consent notice.

You have two choices:

  1. Insert the macro in a custom notice text; or
  2. Submit a standard notice text including the macro.

Here is example of a text using this macro:

With your agreement, we and <a href="javascript:Didomi.preferences.show('vendors')" class="didomi-notice-view-partners-link-in-text">our {numberOfPartners} partners</a> use cookies or similar technologies to store, access, and process personal data like your visit on this website, IP addresses and cookie identifiers. Some partners do not ask for your consent to process your data and rely on their legitimate business interest. You can withdraw your consent or object to data processing based on legitimate interest at any time by clicking on “Learn More” or in our Privacy Policy on this website.

IAB TCF use cases for {numberOfPartners} macros

To comply with IAB TCF requirements, Didomi includes the number of partners (i.e., vendors) configured for a notice ({numberOfPartners} macro) in the standard text for our Web notices.

When setting up your notice, you may see a"View our partners" link in the first layer. This link allows you to redirect users to the "partners" layer of the notice.

Use case 1. The "View our partners" link is hidden when:

  • At least one of the {numberOfPartners} or {numberOfIABPartners} macros are included in the first layer of the notice text; and
  • The link to open the vendor layer (Didomi.preferences.show('vendors')) is included in the text.

Use case 2. The "View our partners" link is not hidden when :

  • At least one of the {numberOfPartners} or {numberOfIABPartners} macros are included in the first layer of the notice text; and
  • There is NO link (Didomi.preferences.show('vendors')) to open the partners/vendors layer in the text.

Use case 3.  A link to "View our XX partners" is displayed (instead of "View our partners"), where XX is the total number of partners used in the notice, when:

  • There is NO macro included in the text for the first layer of your notice; and
  • There is NO "View our partners" link included the text

OR

  • There is NO macro included in the text for the first layer of your notice; and
  • The link to open the partners/vendors layer (Didomi.preferences.show('vendors')) is included in the text.