Skip to content
FunnelGuard

Fix guide by FunnelsGuard

sGTM custom loader domain DNS broken: how to find and fix it

TRK-120High impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

Server-side GTM runs a tagging server that you own. Many sites serve the GTM loader (gtm.js) and send tracking hits through a custom subdomain of their own site, for example metrics.example.com. This is called a first-party or custom loader domain.

That subdomain depends on DNS (the system that turns a name into a server address). If the record is deleted, changed, expired or points at the wrong target, the browser cannot reach your tagging server. The page itself loads fine, but the loader script and every hit sent to that domain fail.

Where a broken custom domain stops tracking
  1. Visitor opens pagePage loads normally
  2. Browser requests loadermetrics.example.com/gtm.js
  3. Tags loadGA4, Ads, Meta tags never start
  4. Hits reach platformsConversions not recorded

The page works, but the request to the custom domain cannot resolve, so everything after it is lost.

Why it costs you leads or sales

Visitors still fill in forms and buy, so it looks like nothing is wrong. But analytics and ad platforms stop receiving data. Conversions vanish from reports, and ad platforms lose the signals they use to optimise bidding. You may then cut budget on campaigns that were actually working.

The damage can last for weeks because nobody sees an error. It often starts after a DNS change, a domain transfer, a CDN or hosting move, or a lapsed certificate.

Recorded conversions around a DNS breakExample numbers
Recorded conversions around a DNS break (example)Before break: 40 conversions per day; Day 1 after: 2 conversions per day; Day 7 after: 1 conversions per day; After fix: 39 conversions per day01531402139Before breakDay 1 afterDay 7 afterAfter fixconversions per day

Example: recorded conversions per day before the DNS record broke and after. Real sales did not change, only what was recorded.

How to check if your site has it

Check the custom domain
  1. Find your custom domain

    View your page source and search for gtm.js. Note the host, such as metrics.example.com. You can also find it in your sGTM container under Admin > Container Settings > Tagging server URL.

  2. Open the loader URL in a browser

    Visit https://metrics.example.com/gtm.js?id=GTM-XXXXXXX (use your own host and ID). You should see JavaScript. A browser error such as 'server not found' or a certificate warning means the DNS or SSL is broken.

  3. Look at the browser Network tab

    Open DevTools > Network, reload your page and filter by your custom domain. Requests marked failed with ERR_NAME_NOT_RESOLVED point to DNS.

  4. Query the DNS

    Run the commands below and compare the result with the records your hosting provider gave you.

Check DNS and the loader responsebash
dig metrics.example.com A +short
dig metrics.example.com AAAA +short
dig metrics.example.com CNAME +short
curl -I "https://metrics.example.com/gtm.js?id=GTM-XXXXXXX"
What common results mean
ResultLikely cause
No answer from digRecord deleted or never created, or the domain or DNS zone expired
Resolves to an unexpected IPRecord points to an old server or the wrong host
Resolves, but certificate errorSSL certificate not issued or expired, or the host does not know the domain
Resolves, but 404 or 5xxTagging server is down or the path is not mapped (a different issue)

How to fix it

The exact records depend on where your server container runs (Google Cloud Run or App Engine, or a managed or third-party host). Use the values your host shows, not values copied from another site.

Restore the DNS records
  1. Get the correct records

    In your sGTM container open Admin > Container Settings and the custom domain section, or check your hosting provider's custom domain page. Note the record type (A, AAAA or CNAME) and the value.

  2. Open your DNS provider

    This is where your domain's nameservers point, such as your registrar, Cloudflare or your host. Check you are editing the active zone.

  3. Recreate or correct the record

    Add the missing record or change the wrong one for the subdomain. Remove old conflicting records for the same name. A CNAME cannot sit alongside other records on the same name.

  4. Check proxy settings

    If you use a CDN proxy such as Cloudflare, make sure it is set up as your host's instructions say. A wrong proxy setting can block certificate issue.

  5. Wait for DNS and the certificate

    Changes can take from minutes to a few hours. Managed certificates usually issue after DNS resolves correctly.

  6. Check the domain mapping in your host

    On Google Cloud, confirm the custom domain is still mapped to the service and shows as active.

Questions people ask

Why is my sGTM custom domain not working?

Most often the DNS record for the subdomain was deleted, changed or points at the wrong target, or the SSL certificate was not issued or has expired. Check it with dig and by opening the gtm.js URL in a browser.

How do I check if my server-side GTM domain resolves?

Run dig yoursubdomain.example.com and compare the result with the records your host gave you. Then open the gtm.js URL in a browser. It should return JavaScript, not a connection or certificate error.

Will a broken sGTM domain stop my website loading?

Usually not. The page loads, but the GTM loader and tracking requests to that domain fail. That is why the problem often goes unnoticed while conversions disappear from reports.

How long does it take for DNS changes to work?

Often minutes, sometimes a few hours, depending on the record's TTL (how long it is cached). Managed certificates may take extra time after DNS resolves.

Can FunnelGuard detect a broken sGTM loader domain?

Yes. FunnelGuard checks pages for broken resources, so a loader or tracking request that fails to load is flagged, with a screenshot and a likely cause.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: no_broken_resources.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.