getCustomDimension

❗️

Deprecated

This method is no longer recommended. It returns percent-encoded values which are hard to read. Use the getCustomDimensionValue() method instead.

The getCustomDimension() method returns the value of the set custom variable.

Syntax

getCustomDimension(customDimensionID)
getCustomDimensionValue(customDimensionId): Promise<string | undefined>a
getCustomDimensionValue(customDimensionId): Promise<string | undefined>a
getCustomDimensionValue(customDimensionId): Promise<string | undefined>a
getCustomDimensionValue(customDimensionId): Promise<string | undefined>a
getCustomDimensionValue(customDimensionId): Promise<string | undefined>a
getCustomDimensionValue(customDimensionId): Promise<string | undefined>a

Parameters

customDimensionID (number, required)

The ID of the custom dimension.

Returns

The value of a custom dimension.

Format: "custom dimension value" (Example: "Jane+Doe")

Type: string

Examples

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>a
getCustomDimensionValue(1): Promise<string | undefined>a
getCustomDimensionValue(1): Promise<string | undefined>a
getCustomDimensionValue(1): Promise<string | undefined>a
getCustomDimensionValue(1): Promise<string | undefined>a
getCustomDimensionValue(1): Promise<string | undefined>a

An example of the return statement:

"Jane+Doe"