The Custom dimension tag lets you collect values for custom dimensions. It is usually used for a session custom dimension. Before you set it up, remember to create a custom dimension under Analytics > Settings > Custom dimensions and create a variable to read the value you want to pass to the custom dimension.
To set up the custom dimension tag, follow these steps:
- Go to Menu > Tag Manager.
- Navigate to Tags.
- Click Add a tag.
- Name the tag and select the following type: Custom dimension.
- Click Next.
- Add the custom dimension set in Analytics> Settings> Custom dimensions and assign a value to it.
- In Advanced tag settings, choose Consent type. Set it up if you use a consent form on your site. This tag will fire only for visitors who accept the selected consent type.
- Respect opt-out and DNT is turned on by default. Leave it as is, if you want to respect visitors who set Do-Not-Track in their browsers, or visitors who opt out of tracking using our opt-out form.
- Enable document.write is turned off by default. Toggle this option, if your tag needs
- In Flight dates, set the date and time when the tag is fired.
- In Tag triggers, click Add a trigger or Choose existing trigger to set up a trigger for your tag.
- Adjust trigger conditions.
- When you’re done, click OK for the trigger.
- Click Save for the tag.
Note: When you use an event dimension and track it with a custom dimension tag, you need to run this tag before the tracking code (Piwik PRO tag). This is because a custom tag needs to send data before a page view is tracked. Read more about setting tag priority.
- Test your tag in debug mode.
- When you’re happy how the tag works, click Publish.
- After some time, data will be collected and you will be able to see the event under Menu > Analytics > Reports > Custom dimensions.