Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Cue the extraordinary. Show-stopping experiences that raise the digital bar. Apply now for the 2023 Adobe Experience Maker Awards.

Adobe DTM - Unexpected Token when trying to use brackets

Avatar

Level 1

I am using the at.js library and following use case. (Changed for understanding). I am using the getOffer and want a variable key in the params. I did it with the code and it works fine. The problem is that I need this code in Adobe DTM. And pasted in the editor I get an Error "Unexpected Token for [" -> that means the brackets can't be used. But for me there is no real go around for that. It's normal vanilla js so I do not understand the problem.

var temp = 'test'; 
adobe.target.getOffer({
     "mbox": "mbox",
     "params": { [temp]: true
}...

Shortly: I can't use the brackets for using the property dynamiclly in the getOffer even though it's solid JavaScript and it's working outside the DTM Editor.

Someone faced this issue ?

Thanks!

0 Replies

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now