Separate Your Debug Traffic with A Lookup Table

When you start using GTM for the first time you may not need this, but with time you’ll start implementing more and more events, do more testing and debugging, and this will seriously disrupt your data. While this is easily fixed if you just filter your traffic in GA – it’s always better to have a backup plan. Another reason to use a separate property for your testing is to easily check your events, and not the events generated by your current visitors (this is especially valid in the Real Time report, where limited events are shown -20 rows, and if your site has huge traffic – you won’t be able to see your test events).

Good news everyone – all it takes to fix this is enabling one built in variable and create one simple Lookup Table Variable. Your debug traffic will be separated in no time!

Step One – Create a new property in Google Analytics

Create a new property in GA, which will be used to collect all the debugging data. You can name it as you wish (for example –  ‘Debug – yoursite.name’). Don’t place any filters on it, it’s your personal debug property and you’ll want to see everything that goes on.

Step Two – Enable the Debug Mode

There is a built-in variable in Google Tag Manager called Debug. You just need to enable it, as it’s disabled by default:

Enabling Debug Mode in GTM

What this variable does is returning true if you browse your website with Preview mode and false otherwise.

Step Three – Create the Lookup Table Variable

Go to Variables and create New Lookup Table Variable. Name it as you wish (I always name my Lookup Tables ‘LT – Some Name’). Choose {{Debug Mode}} as input and add two rows.
In the first row add as input true. As output type the UA code of the newly created debug property.
In the second row add as input false and your original UA code as output (the one of your main Google Analytics property).
Setting up the Debug Lookup Table

Step Four – Deploy the Lookup Table in your events

This step could be cumbersome or easy, depending on your current GTM setup. If you followed my advice in The little hero of GTM – The Constant Variable – just edit your Constant Variable so it takes the new Lookup Table as value, instead of hard coding the UA code. It will automatically deploy itself in all of your Analytics tags:
Adjust your GA UA constant variable If not – You’ll need to change the UA codes in all of your tags with the variable.

You just need to publish your container now and voila – you have your separate debugging property ready!


Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/turbose/public_html/wp-includes/wp-db.php on line 3030

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /home/turbose/public_html/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /home/turbose/public_html/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /home/turbose/public_html/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /home/turbose/public_html/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /home/turbose/public_html/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /home/turbose/public_html/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /home/turbose/public_html/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /home/turbose/public_html/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /home/turbose/public_html/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /home/turbose/public_html/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /home/turbose/public_html/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /home/turbose/public_html/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /home/turbose/public_html/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /home/turbose/public_html/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /home/turbose/public_html/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /home/turbose/public_html/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /home/turbose/public_html/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /home/turbose/public_html/wp-includes/class-wp-term.php on line 198

Check these related articles:


Deprecated: Creation of dynamic property WP_Query::$comments_by_type is deprecated in /home/turbose/public_html/wp-includes/comment-template.php on line 1528

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.