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.
- Visitor submits formThe site works normally
- analytics.js sends eventUses the wrong write key
- Segment source / destinationsEvent lands in the wrong source or is not forwarded
- GA4, ads, CRMNo conversion recorded
A wrong write key or a disabled destination breaks the chain after the visitor acts.
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
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.
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.
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.
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.
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
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.
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.
Enable the destinations
In Connections > Destinations, open each destination, make sure it is connected to the right source and switch it on.
Check filters and the tracking plan
If events are blocked, review destination filters, mappings and any Protocols tracking plan that drops unplanned events.
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.
Edit the snippet
Find the analytics.load("WRITE_KEY") call in your site template and put the correct production key in it.
Use environment variables
Store separate keys for staging and production in your build config so a test key cannot ship to the live site.
Open the Segment tag
Find the Custom HTML tag that loads analytics.js and replace the write key.
Preview and publish
Use Preview mode to confirm events appear in the Source Debugger, then publish the container.
Find where it is installed
Check your Segment plugin settings, your theme's header or a header and footer scripts plugin for the snippet.
Update and clear cache
Save the correct key, then purge any caching plugin or CDN cache.
Check theme code and apps
Look in Online Store > Themes > Edit code (theme.liquid) and in any Segment app or custom pixel under Settings > Customer events.
Replace the key
Update the write key wherever it appears and test a page view.
Open custom code
Go to Site settings > Custom code and check the head code for the Segment snippet.
Update and publish
Replace the key and publish the site. Page-level custom code may also hold a copy.
analytics.load("YOUR_PRODUCTION_WRITE_KEY");
analytics.page();How to confirm it's fixed
- 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
- 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.
Related issues
- TRK-243Mixpanel / Amplitude / Segment events missingFix guide
- TRK-248Two analytics tools disagreeing on conversion countsFix guide
- TRK-245PostHog / Heap autocapture missing conversionFix guide
- TRK-238Hotjar script missing or wrong site IDFix guide
- TRK-239Microsoft Clarity missing or wrong project IDFix guide
- TRK-240Session recording capturing form fields (PII in recordings)Fix guide