Use Variables in Custom JavaScript Variable

I want to use other variable information in the custom JavaScript Variable. I use the syntax like {{Variable Name}}, but this error is thrown.

SyntaxError: expected property name, got '{'

In the Container i see the plain variable markup:

Templates['CustomJsFunctionVariable32002477'] = (function () { return function (parameters, TagManager) { this.get = function() {
  var pt_pagetype = "default";
  var pageURL = {{Page URL}};

How can i access the variable in an other variable.


instead of referencing the inbuilt variables you can create a JS like following example.

function () { 
var myPagePath = undefined;
myPagePath =;
return myPagePath;

Because unfortunately custom-JavaScript variables do not support the inbuilt variables.

Hi Tom,
at the moment it isn’t yet possible to do this, but it is listed in our backlog at:
but unfortunately as we have not scheduled it yet, we cannot give a date when it will be implemented.

@Trackingninja solution might work as well, have you tried it maybe?

The solution would work but of course it depends on the use case.