# What does a variable have to return so that a custom dimension referencing that variable will not be set at all (instead of with an empty value)?

**URL:** <https://community.piwik.pro/t/what-does-a-variable-have-to-return-so-that-a-custom-dimension-referencing-that-variable-will-not-be-set-at-all-instead-of-with-an-empty-value/3409>\
**Category:** Data collection and tags\
**Created:** [December 22, 2023, 4:35pm UTC](https://community.piwik.pro/t/what-does-a-variable-have-to-return-so-that-a-custom-dimension-referencing-that-variable-will-not-be-set-at-all-instead-of-with-an-empty-value/3409 "2023-12-22T16:35:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![loldenburg](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/loldenburg/32/965_2.png) [@loldenburg](https://community.piwik.pro/u/loldenburg)\
**Post date:** [December 22, 2023, 4:35pm UTC](https://community.piwik.pro/t/what-does-a-variable-have-to-return-so-that-a-custom-dimension-referencing-that-variable-will-not-be-set-at-all-instead-of-with-an-empty-value/3409/1 "2023-12-22T16:35:11Z")

</div>

Dimension5 and 9 in the screenshot of a PP Analytics request reference PP TM variables which return undefined in some cases.  
In these cases, I would find it cleaner if PP TM did not set these dimensions at all instead of setting them to empty values:

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/piwikpro/original/2X/4/4a944e68737aca9cddceaf7695ad5aae349e01e2.png)  
How can I achieve that?  
Are there any repercussions when setting empty custom dimensions?

---

<div class="post-metadata">

**Author:** ![anthonybartczak](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/anthonybartczak/32/2430_2.png) [@anthonybartczak](https://community.piwik.pro/u/anthonybartczak)\
**Post date:** [December 28, 2023, 10:48am UTC](https://community.piwik.pro/t/what-does-a-variable-have-to-return-so-that-a-custom-dimension-referencing-that-variable-will-not-be-set-at-all-instead-of-with-an-empty-value/3409/2 "2023-12-28T10:48:13Z")

</div>

Hi @loldenburg,

The only way would be simply not setting the variable when there’s no value but that’s not really possible when using tag templates.

When it comes to the result - it will be set to `No data` in Analytics.

![image](https://europe1.discourse-cdn.com/flex005/uploads/piwikpro/original/2X/6/6110f937b1cebb9510454d389db7254a00b75a74.png)

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/piwikpro/original/2X/b/b16cd80e7e275698e6cde0f7c8ceb29ce2915b12.png)

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/piwikpro/original/2X/c/c31b843f5b53888f8a95398daeffed7e65d175c3.png)

---

<div class="post-metadata">

**Author:** ![loldenburg](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/loldenburg/32/965_2.png) [@loldenburg](https://community.piwik.pro/u/loldenburg)\
**Post date:** [December 28, 2023, 10:57am UTC](https://community.piwik.pro/t/what-does-a-variable-have-to-return-so-that-a-custom-dimension-referencing-that-variable-will-not-be-set-at-all-instead-of-with-an-empty-value/3409/3 "2023-12-28T10:57:20Z")

</div>

Thanks!  
That’s not good design imho.
