Skip to main content

What is gtm-msr.appspot.com and How to Prevent It from Triggering Tags in GTM

Updated today

What is gtm-msr.appspot.com?

The domain gtm-msr.appspot.com is owned by Google Tag Manager (GTM). It appears when:

  • You or your team enter Preview Mode in GTM.

  • Google runs automated scans or security checks on your container.

  • A tool or browser extension triggers a GTM render for testing/debugging.

This domain does not reflect real user traffic, but it can cause your tags to fire unintentionally, leading to:

  • False pageviews

  • Phantom conversions

  • Polluted analytics reports

Why It’s a Problem

If your GTM tags fire while loaded from gtm-msr.appspot.com, they may:

  • Trigger pixels (TikTok, Meta, Google Ads…) with fake hits

  • Inflate events or conversions in GA4, Meta Ads Manager, or other platforms

  • Break attribution accuracy

How to Prevent Tags from Firing on gtm-msr.appspot.com

To ensure no tag fires when GTM is loaded from this domain, follow this method:

Step 1: Create a Blocking Variable

  1. Go to Variables in Google Tag Manager.

  2. Click New → choose Custom JavaScript Variable.

  3. Name it: IsNotGTMAppspot

  4. Use this code:

function() {
return location.hostname !== "gtm-msr.appspot.com";
}

5. Save

Step 2: Add the Condition to All Triggers

For every trigger that launches tags (pageviews, clicks, events, etc.):

  1. Open the trigger.

  2. Add this condition:

IsNotGTMAppspot  equals  true

This tells GTM: “Only fire if the current hostname is not gtm-msr.appspot.com.”

(Optional) Extra Safety for Custom HTML Tags

If you’re using Custom HTML tags, wrap the code inside this condition:

<script>
if (location.hostname !== 'gtm-msr.appspot.com') {
// your pixel code here
}
</script>

How to Test It

  1. Click Preview in GTM.

  2. Confirm the URL becomes gtm-msr.appspot.com.

  3. Check that no tags are fired during the preview.

  4. If everything looks good, publish your container.

Problem

Solution

Tags firing from gtm-msr.appspot.com

Create a custom variable + add it as a blocking condition in all triggers

False hits in analytics

Filter by hostname or use conditional logic to restrict execution

Clean data = better decisions

✅ Stop pixel spam at the source

Did this answer your question?