This article describes the troubleshooting found when working with Google Tag Manager and Google Analytics.
GTM script was defined on DEV environments, so according to the syndication process, all environments have GTM scrip implemented. It means, Google Analytics account was collecting data from all environments and the customer is only interested in collecting PROD data.
- Navigate to Triggers section on GTM interface
- Click each one's name of the trigger.
- Click on Trigger Configuration to edit the trigger.
Add new condition where Page Hostname equals host of your PROD environment. Example:
Page Hostname is a built-in variable of GTM, if you need more information, please refer to the official Google Tag Manager documentation here.
- Click the Save button to save this new configuration
- Validate in preview mode in all environments and then, publish it.
There is official documentation to work with environments on GTM, if you need more information, please refer here.