How to use variable in content template in ajo | Community
Skip to main content
Mario248
Level 7
October 19, 2025
Solved

How to use variable in content template in ajo

  • October 19, 2025
  • 2 replies
  • 346 views

I am trying to create a variable in HTML and use the value in multiple places in HTML. 

{% let Linktags = "abc,def" %} <a href="https://www.qatarairways.com/" target="_blank" data-tags="{{ Linktags }}" style="color:#8C919B; text-decoration:underline;" data-tracking-type="MIRROR_PAGE" data-nl-type="mirrorPage"> View in browser </a>

 

I validated this HTML and there is no syntax issue but it is treating like string  data-tags="{{ Linktags }}". instead of getting value from actual variable. I also tried below syntax but it is not working. Any idea how to make this work ?

 
<a href="https://www.qatarairways.com/" target="_blank" data-tags="{%=Linktags %}" style="color:#8C919B; text-decoration:underline;" data-tracking-type="MIRROR_PAGE" data-nl-type="mirrorPage"> View in browser </a>

 

Best answer by Parvesh_Parmar

Hi @mario248 ,

 

As I know, In AJO, personalization inside content templates is powered by a Handlebars-based expression language.

That means:

1. You cannot define or assign your own variables in the template using syntax like `{% let ... %}` or `{%= ... %}` — these are not supported in AJO.

2. You can use either:

- Hardcoded (static) strings.
- Dynamic data coming from your profile, event, or context attributes, for example:

- Predefined functions.

 

Doc URL: https://experienceleague.adobe.com/en/docs/journey-optimizer/using/content-management/personalization/personalization-syntax?utm_source=chatgpt.com

 

Hope it will help you.

 

Kr,

Parvesh

2 replies

Parvesh_Parmar
Community Advisor
Parvesh_ParmarCommunity AdvisorAccepted solution
Community Advisor
October 23, 2025

Hi @mario248 ,

 

As I know, In AJO, personalization inside content templates is powered by a Handlebars-based expression language.

That means:

1. You cannot define or assign your own variables in the template using syntax like `{% let ... %}` or `{%= ... %}` — these are not supported in AJO.

2. You can use either:

- Hardcoded (static) strings.
- Dynamic data coming from your profile, event, or context attributes, for example:

- Predefined functions.

 

Doc URL: https://experienceleague.adobe.com/en/docs/journey-optimizer/using/content-management/personalization/personalization-syntax?utm_source=chatgpt.com

 

Hope it will help you.

 

Kr,

Parvesh

Parvesh Parmar – Adobe Community Advisor https://www.linkedin.com/in/parvesh-parmar/
November 7, 2025

Hi Parvesh,

 

Has a deep analysis been made about this topic? 
Since the URL provided contains the "utm_source" parameter equal to "chatgpt.com", I am afraid it didn't.

 

Can you please give us more details about how data-tags can be set dinamically inside the html?

 

Thank you,

 

Mario

November 6, 2025

Hi,

I have exactly the same issue and I tried the following tests:

- data-tags="{{variable}}"

- data-tags="{{{variable}}}"

- data-tags={{variable}}

- data-tags={{{variable}}}

- data-tags="{{profile._tenant.attribute}}"

- data-tags="{{{profile._tenant.attribute}}}"

- data-tags={{profile._tenant.attribute}}

- data-tags={{{profile._tenant.attribute}}}

- data-tags="{{store._tenant.lookupAttribute}}"

- data-tags="{{{store._tenant.lookupAttribute}}}"

- data-tags={{store._tenant.lookupAttribute}}

- data-tags={{{store._tenant.lookupAttribute}}}

 

Where store._tenant.lookupAttribute is an attribute of a dataset enabled for lookup.

 

None of them works. Am I mistaking something? Otherwise it seems it is not true that dynamic data can be used.

Perhaps, I am experiencing this issue only in data-tags (dynamic href, instead, is OK).

 

Thanks,

 

Mario