getFrontendVariable
Last updated
Was this helpful?
getFrontendVariable FunctionThe getFrontendVariable function is used to retrieve the value of a client-side variable or to evaluate it on demand during the execution of another variable.
This function allows you to reference or reuse the value of another client-side variable by its variable ID, making your setup more modular and maintainable.
this.getFrontendVariable(variableId: string): anyvariableId (string, required):
The ID of the client-side variable you want to retrieve.
This ID must match the internal name defined in the JENTIS Tag Manager.
Type: any
Returns the value of the specified client-side variable.
The returned type depends on the definition of the referenced variable.
Retrieve the value of another client-side variable
function() {
let referrer = this.getFrontendVariable("document_ref_diff");
return referrer;
}In this example, the value of the document_ref_diff variable is retrieved and returned from within another client-side variable.
Compose variables by combining values from other client-side variables.
Avoid duplicating logic across multiple variables.
Maintain a centralized and DRY (Don't Repeat Yourself) configuration.
This function is essential when building dynamic tracking setups that depend on multiple contextual inputs from the browser.
Last updated
Was this helpful?
Was this helpful?