getCustomVariable
The getCustomVariable() method returns the value of the set custom variable.
Syntax
getCustomVariable(index[, scope])Not availableNot availableNot availableNot availableNot availableNot availableParameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| index | number | The index from 1 to 5 where the variable is stored. | Yes |
| scope | string | The scope of the variable: "visit" or "page". The default value is "visit". | No |
Returns
If the custom variable exists, the method returns the variable name and value. Otherwise, it returns false.
Format: "variable name", "variable value". (Example: "Blog author", "Jane Doe")
Type: string[] | boolean
Example
To get the variable value:
_paq.push([
function () {
console.log(this.getCustomVariable(1, "page"));
},
]);Not availableNot availableNot availableNot availableNot availableNot availableA sample of the return value:
"Blog author", "Jane Doe"
Updated 15 days ago