Fix JavaScript Template Literal (${}) Conflict in Adobe Target Custom Code
Adobe Target appears to interpret ${} as Target variable/token syntax, which conflicts with JavaScript ES6 template literals.
For example:
let x = 'Testing var';
console.log(`Value: ${x}`);
Instead of printing:
Value: Testing var
the content inside ${} gets removed or replaced during Target processing, resulting in unexpected behavior.
As a workaround, developers must use string concatenation:
console.log('Value: ' + x);
It would be helpful if Adobe Target could either:
- Support JavaScript template literals without preprocessing
${}expressions. - Provide an escape mechanism for JavaScript template literals.
- Document this limitation and the recommended workaround in the official documentation.
This would prevent conflicts between Adobe Target token replacement and standard JavaScript syntax, making custom code easier to write and debug.