ADK

Template language

This is a guide to the ADK Template language, which is used for dynamic content generation within ADK templates. It is also used for Server-side rendered ads.

Parameters

Write a parameter name between percent signs. Names are matched exactly and are case-sensitive.

%parameterName%

A matching value is inserted as text. A missing or undefined value is replaced with an empty string. Placeholder names that do not match a supplied parameter are left unchanged.

Conditional blocks

Use ifdef to include a block when its named parameter is defined, or ifndef to include it when the parameter is undefined.

{#ifdef parameterName}content{/ifdef}
{#ifndef parameterName}content{/ifndef}

These directives test whether the parameter is defined, not whether its value is non-empty. An empty string is defined: ifdef includes its content and ifndef omits it. Conditional blocks are evaluated before parameter substitution. Opening and closing directives must be on the same line.

✅ Supported: nested conditional directives, including directives of the same type, and side-by-side blocks of different types.

{#ifdef outer}{#ifdef inner}content{/ifdef}{/ifdef}
{#ifdef outer}{#ifndef inner}content{/ifndef}{/ifdef}
{#ifdef first}first content{/ifdef}{#ifndef second}second content{/ifndef}

❌ Not supported: side-by-side blocks of the same directive type on the same line.

{#ifdef first}first content{/ifdef}{#ifdef second}second content{/ifdef}