getCustomDimensionValue
The getCustomDimensionValue() method returns the value of the set custom variable.
Syntax
getCustomDimensionValue(customDimensionID)getCustomDimensionValue(customDimensionId): Promise<string | undefined>getCustomDimensionValue(customDimensionId): Promise<string | undefined>getCustomDimensionValue(customDimensionId): Promise<string | undefined>getCustomDimensionValue(customDimensionId): Promise<string | undefined>getCustomDimensionValue(customDimensionId): Promise<string | undefined>getCustomDimensionValue(customDimensionId): Promise<string | undefined>Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| customDimensionID | number | The ID of the custom dimension. | Yes |
Returns
The value of a custom dimension.
Format: "custom dimension value" (Example: "Jane Doe")
Type: string
Example
To get the value for a custom dimension with the ID 1:
_paq.push([
function () {
console.log(this.getCustomDimensionValue(1));
},
]);getCustomDimensionValue(1): Promise<string | undefined>getCustomDimensionValue(1): Promise<string | undefined>getCustomDimensionValue(1): Promise<string | undefined>getCustomDimensionValue(1): Promise<string | undefined>getCustomDimensionValue(1): Promise<string | undefined>getCustomDimensionValue(1): Promise<string | undefined>An example of the return statement:
"Jane Doe"
Related methods
Updated 15 days ago