Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Segment write key wrong or destinations off: how to fix it

TRK-244Medium impactCould addBy FunnelGuardPublished Updated
On this page

What this issue is

Segment is a customer data platform. Your site loads a small script (analytics.js) that sends events to Segment. Segment then forwards them to destinations such as GA4, Google Ads, Meta, a CRM or a data warehouse.

Two things have to line up. The write key in your snippet must belong to the right source (the website source in Segment). And that source must have the destinations you need enabled. If either is wrong, data is lost or goes to the wrong place.

Common causes: a staging or development write key left on the live site, a key copied from the wrong workspace, a destination toggled off, a destination connected to a different source, a filter or tracking plan that blocks the event, or a destination's own settings (such as a wrong GA4 Measurement ID) being wrong.

Why it costs you leads or sales

Your site can look perfect while nothing is recorded. Leads still come in, but conversions never reach Google Ads or Meta, so their bidding has no signal. Reports undercount, and teams cut campaigns that were working. A CRM or email tool fed by Segment may also stop receiving new contacts, so follow-up stalls.

Where the data stops
  1. Visitor submits formThe site works normally
  2. analytics.js sends eventUses the wrong write key
  3. Segment source / destinationsEvent lands in the wrong source or is not forwarded
  4. GA4, ads, CRMNo conversion recorded

A wrong write key or a disabled destination breaks the chain after the visitor acts.

Conversions seen in each toolExample numbers
Conversions seen in each tool (example)Real leads (CRM form): 100 conversions; Segment source: 100 conversions; GA4 destination on: 98 conversions; Ads destination off: 0 conversions03877100100980Real leads (CRM form)Segment sourceGA4 destination onAds destination offconversions

Example: 100 real leads in a month. With a destination switched off, that tool shows none of them.

How to check if your site has it

Check the key and destinations
  1. Find the key your site uses

    View the page source or open your browser's DevTools Network tab and filter for api.segment.io or cdn.segment.com. The cdn URL contains the write key, e.g. cdn.segment.com/analytics.js/v1/YOUR_WRITE_KEY/analytics.min.js.

  2. Compare with Segment

    In Segment, go to Connections > Sources, open your website source and check Settings > API Keys for the write key. It must match exactly.

  3. Watch live events

    Open the source's Debugger tab, then use your site in another tab. Submit a form or click a button. If nothing appears, the key is wrong or the script is blocked.

  4. Check destinations

    Open Connections > Destinations. Confirm each destination is connected to this source and its toggle is enabled. Open its settings and check IDs such as the GA4 Measurement ID or ad pixel ID.

  5. Check delivery

    Open the destination's Event Delivery tab. Look for events marked as failed, filtered or not delivered, and read the reason given.

How to fix it

Fix the write key and destinations
  1. Copy the correct write key

    Copy it from Connections > Sources > your website source > Settings > API Keys. Make sure it is the production source, not a staging or test one.

  2. Replace it on the site

    Update the snippet or plugin setting (see the tabs below), then clear caches so the old key is not served.

  3. Enable the destinations

    In Connections > Destinations, open each destination, make sure it is connected to the right source and switch it on.

  4. Check filters and the tracking plan

    If events are blocked, review destination filters, mappings and any Protocols tracking plan that drops unplanned events.

  5. Fix destination settings

    Check IDs and API keys in each destination, such as the GA4 Measurement ID, and any cloud-mode versus device-mode setting.

Where to change the write key
  1. Edit the snippet

    Find the analytics.load("WRITE_KEY") call in your site template and put the correct production key in it.

  2. Use environment variables

    Store separate keys for staging and production in your build config so a test key cannot ship to the live site.

Loading analytics.js with the write keyjavascript
analytics.load("YOUR_PRODUCTION_WRITE_KEY");
analytics.page();

How to confirm it's fixed

Confirmation checklist
  • The write key in the page's network requests matches the production source in Segment
  • A test page view and form submission appear in the Source Debugger within seconds
  • Each needed destination is enabled and connected to this source
  • Event Delivery shows events delivered, not failed or filtered
  • The event shows in the destination itself, such as GA4 Realtime or Meta Events Manager test events
  • The CRM or warehouse receives the test lead

How to prevent it happening again

Prevention habits
  • Keep separate Segment sources for staging and production, and name them clearly
  • Store write keys in environment config instead of pasting them by hand
  • Test the Source Debugger after every release, theme change or tag change
  • Limit who can toggle destinations and note changes in a shared log
  • Set up Segment's own delivery alerts if your plan includes them
  • Compare Segment event counts with GA4 and CRM counts weekly

How FunnelGuard handles this

FunnelGuard does not check for this yet. Reading a Segment source and its destination settings is a possible future check, but it is not part of the product today.

What FunnelGuard does cover nearby: a robot visitor runs your real journeys, such as a lead form or checkout, on a schedule, and checks the tracking hits sent to ad and analytics platforms like GA4, Google Ads, Meta, TikTok, LinkedIn, Bing, Pinterest, Snapchat, X and Reddit. It also checks that test leads reach your inbox and CRM. If a platform hit goes missing, that can point to a broken chain, though it will not tell you the Segment write key is wrong.

Questions people ask

Why is my Segment source not receiving any events?

The most common cause is a wrong or missing write key in your site's snippet, or a script blocked by a consent tool or ad blocker. Compare the key in your page's network requests with the one under Settings > API Keys on the source, then watch the Source Debugger while you use the site.

Where do I find my Segment write key?

In Segment, go to Connections > Sources, open your website source and choose Settings > API Keys. The write key is listed there. Use the key from the production source, not a staging one.

Why do events show in the Segment debugger but not in GA4 or Meta?

The write key is fine, so the issue is the destination. It may be disabled, connected to another source, filtered by a rule or tracking plan, or set up with a wrong ID. Check the destination's Event Delivery tab for the reason.

Can I use the same Segment write key on staging and production?

You can, but you should not. Test events would pollute live data and sent to real destinations. Create separate sources and keep each key in its own environment config.

How do I know if a Segment destination is enabled?

Open Connections > Destinations, select the destination and check its toggle and the source it is connected to. Then open Event Delivery to confirm events are being delivered.

Does a wrong Segment write key break my website?

Usually not. Pages load and forms work, but data goes to the wrong source or is dropped. That is why it often goes unnoticed until reports look low.

Does FunnelGuard check my Segment write key?

No. FunnelGuard does not check Segment write keys or destinations yet. It does run your real journeys and check tracking hits sent to ad and analytics platforms, and whether test leads reach your inbox and CRM.

Does FunnelGuard catch this?

Could add

Not checked yet: could be added to FunnelGuard.

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.