# Debug Mode variable

**URL:** <https://community.piwik.pro/t/debug-mode-variable/1297>\
**Category:** Data collection and tags\
**Created:** [November 25, 2022, 10:50am UTC](https://community.piwik.pro/t/debug-mode-variable/1297 "2022-11-25T10:50:18Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmeekers](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/rmeekers/32/929_2.png) [@rmeekers](https://community.piwik.pro/u/rmeekers)\
**Post date:** [November 25, 2022, 10:50am UTC](https://community.piwik.pro/t/debug-mode-variable/1297/1 "2022-11-25T10:50:18Z")

</div>

Is there a variable to detect if tag manager is running in debug mode? Or another method to accomplish this?

I’m trying to avoid debug data to end up in production analytics.

---

<div class="post-metadata">

**Author:** ![Admin](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@Admin](https://community.piwik.pro/u/Admin)\
**Post date:** [November 25, 2022, 11:38am UTC](https://community.piwik.pro/t/debug-mode-variable/1297/2 "2022-11-25T11:38:15Z")

</div>

Hi, there’s a switcher for that:

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

You could also create a cookie variable checking the value of `stg_debug` cookie.

---

<div class="post-metadata">

**Author:** ![rmeekers](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/rmeekers/32/929_2.png) [@rmeekers](https://community.piwik.pro/u/rmeekers)\
**Post date:** [November 25, 2022, 12:21pm UTC](https://community.piwik.pro/t/debug-mode-variable/1297/3 "2022-11-25T12:21:25Z")

</div>

I saw the switch, but that’s only to prevent a tag from firing, I want it to fire but with other variables. So I’ve solved it like this:

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/piwikpro/original/1X/4b60c8c19cd34ab0d308c7b24ec18c94bc340296.png)

---

<div class="post-metadata">

**Author:** ![rmeekers](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/rmeekers/32/929_2.png) [@rmeekers](https://community.piwik.pro/u/rmeekers)\
**Post date:** [February 13, 2025, 12:37pm UTC](https://community.piwik.pro/t/debug-mode-variable/1297/4 "2025-02-13T12:37:36Z")

</div>

@Admin is this stg\_debug cookie still the way to detect debug mode with the new release of debug mode?

---

<div class="post-metadata">

**Author:** ![Maciej\_Kowcun](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/maciej_kowcun/32/787_2.png) [@Maciej\_Kowcun](https://community.piwik.pro/u/Maciej_Kowcun)\
**Post date:** [February 13, 2025, 3:15pm UTC](https://community.piwik.pro/t/debug-mode-variable/1297/5 "2025-02-13T15:15:35Z")

</div>

Hi @rmeekers, the new debug mode no longer supports the cookie-based solution. We’re currently developing an alternative approach that won’t rely on cookies.

I’ll keep you updated once it’s ready and share more details then.

---

<div class="post-metadata">

**Author:** ![rmeekers](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/rmeekers/32/929_2.png) [@rmeekers](https://community.piwik.pro/u/rmeekers)\
**Post date:** [February 21, 2025, 3:58pm UTC](https://community.piwik.pro/t/debug-mode-variable/1297/6 "2025-02-21T15:58:23Z")

</div>

ok, any idea on what term this would be available?

---

<div class="post-metadata">

**Author:** ![Maciej\_Kowcun](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/maciej_kowcun/32/787_2.png) [@Maciej\_Kowcun](https://community.piwik.pro/u/Maciej_Kowcun)\
**Post date:** [February 25, 2025, 8:20am UTC](https://community.piwik.pro/t/debug-mode-variable/1297/7 "2025-02-25T08:20:38Z")

</div>

Hi @rmeekers, you can use this approach:

In a tag or variable, use `window.sevenTag.api.isDebugModeEnabled()` call. This will be `true` if debug mode is enabled, and `false` otherwise.

Note: The `window.sevenTag.api` object is available only after the installation snippet is executed.

EDIT: The description is accurate, but a release update is required first. It will be ready by March 11 at the latest.

---

<div class="post-metadata">

**Author:** ![Maciej\_Kowcun](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/maciej_kowcun/32/787_2.png) [@Maciej\_Kowcun](https://community.piwik.pro/u/Maciej_Kowcun)\
**Post date:** [February 26, 2025, 2:04pm UTC](https://community.piwik.pro/t/debug-mode-variable/1297/8 "2025-02-26T14:04:11Z")

</div>

@rmeekers, changes have been released. You can verify it yourself.

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex005/uploads/piwikpro/original/1X/db7013c4fd6a24443b339309db52f14995207737.png) [@system](https://community.piwik.pro/u/system)\
**Post date:** [March 26, 2025, 11:57am UTC](https://community.piwik.pro/t/debug-mode-variable/1297/9 "2025-03-26T11:57:34Z")

</div>

Closed on March 26, 2025, 11:57am UTC

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
