We've all faced the inconvenience of managing Facebook Test ID: you do need it for debugging and testing your setup, but it's ought to be removed from the tags once you deploy your container. So how do we address this? The answer is - lookup table.
Step 1 - go to the Variables menu in your Google Tag Manager Container and make sure 'Debug Mode' is enabled in Built-in Variables. If it's not - press 'Configure' and click the checkbox right next to 'Debug Mode'. Now your GTM can reference this variable.
Step 2 - create a Lookup Table variable. Select {{Debug Mode}} as input. Now put true for the input and your Test ID as an output. Name your variable (we suggest a simple Facebook Test ID) and hit Save.
Step 3 - Now add your new variable to a tag and it will only use Test ID if GTM is in Debug Mode, otherwise, the variable will be empty and will not cause conflicts in production.
Step 4 - enjoy not having to add/remove Test ID infinite amount of times per day.
Want to learn more tricks on how to work with Facebook? Check out this article on CAPI errors.
Happy Tagging!
We can help you! Click Get A Quote, fill up the form, and we will answer you right away.