setCustomDimensionValue
The setCustomDimensionValue() method sets the value for a custom dimension. The value can be sent to Piwik PRO with a page view or other event.
Syntax
setCustomDimensionValue(customDimensionID, customDimensionValue)setCustomDimensionValue(customDimensionId, customDimensionValue): voidsetCustomDimensionValue(customDimensionId, customDimensionValue): voidsetCustomDimensionValue(customDimensionId, customDimensionValue): voidsetCustomDimensionValue(customDimensionId, customDimensionValue): voidsetCustomDimensionValue(customDimensionId, customDimensionValue): voidsetCustomDimensionValue(customDimensionId, customDimensionValue): voidParameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| customDimensionId | number | The ID of the custom dimension. | Yes |
| customDimensionValue | string | The value of the custom dimension. | Yes |
Examples
To set the value for a custom dimension and send it with a page view:
_paq.push(["setCustomDimensionValue", 1, "Jane Doe"]);
_paq.push(["ping"]);setCustomDimensionValue(1, "Jane Doe"): voidsetCustomDimensionValue(1, "Jane Doe"): voidsetCustomDimensionValue(1, "Jane Doe"): voidsetCustomDimensionValue(1, "Jane Doe"): voidsetCustomDimensionValue(1, "Jane Doe"): voidsetCustomDimensionValue(1, "Jane Doe"): voidNotes
- If you set a custom dimension, its value will be used in all tracking requests within the page load.
Related methods
Updated 15 days ago