Step by step guide to integrating Google Analytics with Segment for B2B marketing

If you run B2B marketing and want real visibility into what’s actually working, you probably need better data than what Google Analytics gives you out of the box. Here’s the deal: by routing your website and product events through Segment and then into Google Analytics, you can clean up your tracking, save yourself hours of headaches, and actually trust your reports.

This guide is for marketers, product folks, and anyone stuck gluing tools together. I’ll walk through exactly how to hook up Segment and Google Analytics, which settings matter, what to skip, and where most people trip up.

Why combine Google Analytics and Segment?

Let's be honest—Google Analytics is powerful, but setting it up for B2B funnels is a pain. It’s not great at tracking complex user journeys or connecting marketing campaigns all the way to revenue. Segment isn’t magic, but it helps you collect data once and send it anywhere, including GA.

What you get by integrating the two:

  • Cleaner data: Avoid double-counting and missing events.
  • Custom events: Track exactly what matters to your business, not just pageviews.
  • More flexibility: Send the same data to your CRM, analytics, and other tools.

If you just want basic website stats, you probably don’t need this setup. But if you want a single source of truth, or you’re sick of wrangling inconsistent UTM parameters, this is worth your time.


Step 1: Get the basics ready

Before diving in, make sure you’ve got:

  • A Segment account (the free tier is fine to start).
  • A Google Analytics property (for most, GA4 is the default now).
  • Edit access to both.
  • The ability to add code to your website (or someone technical on call).

Pro tip: If you’re migrating from Universal Analytics (UA) to GA4, don’t try to “translate” every old event. Start fresh with what you actually need.


Step 2: Set up Segment on your website

  1. Create a new Source in Segment.
    Go to your Segment workspace, click “Add Source,” and pick “Website.” JavaScript is the usual choice for most web apps or marketing sites.

  2. Install the Segment snippet.
    Segment gives you a little JavaScript snippet. Paste it right before the closing </head> tag on every page you want to track.

  3. If you’re using a tag manager, Segment has guides for that.
  4. If you use a CMS (like WordPress), check for plugins—just make sure it’s the official one or a reputable third-party.

  5. Verify it’s working.
    Segment’s Debugger tab shows incoming events. Open your site, refresh, and confirm you see “Page” events showing up.

What to skip: Don’t bother setting up every single “track” event yet. Focus on just getting the snippet live and seeing pageviews come in.


Step 3: Add Google Analytics as a Segment destination

  1. In Segment, go to Destinations.
  2. Click “Add Destination” and search for “Google Analytics 4.”
  3. (If you’re still on Universal Analytics, wrap it up—GA4 is the future, and UA is deprecated.)

  4. Connect your Google Analytics property.

  5. Segment will ask for your Measurement ID (looks like G-XXXXXXXXXX).
  6. You can find this in GA4 under Admin → Data Streams → Web.

  7. Map your data.

  8. By default, Segment sends page calls to GA4 as pageview events, and track calls as custom events.
  9. You can customize mappings if you want, but for most setups, the defaults are good enough.

  10. Test your connection.

  11. Navigate around your site and check GA4’s real-time view.
  12. If you see your own visits, it’s working.

What to ignore: Don’t get bogged down with every advanced mapping option Segment offers right now. The defaults usually cover 80% of use cases.


Step 4: Decide what to track (and keep it simple)

Here’s where most B2B teams overcomplicate things. You don’t need to track every button click or form field. Start with:

  • Page views (handled by default)
  • Key conversion events (like demo requests, signups, downloads)
  • Important user actions (logged-in actions, account upgrades, etc.)

How to add custom events:

  • Use analytics.track() (if you’re coding it in) or your product’s Segment plugin to fire events.
  • Example:
    javascript analytics.track('Requested Demo', { plan: 'Enterprise', source: 'Pricing Page' });

Pro tip:
Name events for humans, not just for Google. “Requested Demo” is better than “Lead_Submit_v2.”

Don’t bother with: - Tracking every scroll or mouse movement—unless you have a very specific reason. - Tons of custom properties per event. Start with the basics; you can add more later.


Step 5: Test, test, test (seriously)

This is the unglamorous part, but nothing kills trust in analytics faster than broken data.

  • Use Segment’s Debugger to make sure events are firing.
  • Check GA4’s DebugView for live events.
  • Test real user flows:
  • Open an incognito window.
  • Do the core actions (sign up, request demo, etc.).
  • Make sure the events show up in both Segment and GA4.

What to watch for: - Duplicate events: If you’re running both the native GA4 tag and Segment, you’ll get double-counting. Pick one or the other. - Missing user IDs: For B2B, tracking logged-in users is valuable. Make sure you’re sending a user ID (not just anonymous hits) where possible.


Step 6: Make B2B data actually useful in Google Analytics

Out of the box, GA4 is built for ecommerce, not B2B SaaS. Here’s how to get more mileage:

  • Set up custom dimensions for things like company name, account tier, or user role.
  • You’ll need to register these in GA4 (Admin → Custom definitions).
  • Then, send them as event parameters from Segment.
  • Group users by accounts:
  • If you have account-based marketing, send an “account_id” parameter with events.
  • You can then build segments or audiences in GA4 based on company behavior, not just individuals.
  • Create conversion events for your main goals (like “Requested Demo”).
  • Mark these as conversions in GA4, so they show up in reports.

Pro tip:
Don’t try to make GA4 your CRM. Use it for trends, not for deep user-level analysis. For pipeline tracking, sync the same Segment data into your CRM or a data warehouse.


Step 7: Keep your setup maintainable

B2B teams love to tinker, but analytics setups break all the time. A few ways to avoid headaches:

  • Document your events: Keep a simple spreadsheet or Notion doc listing event names, what triggers them, and what properties are sent.
  • Audit regularly: Once a quarter, check what’s actually being tracked versus what’s in your documentation.
  • Limit who can change tracking: Too many cooks spoil the broth (or the data, in this case).

What to ignore:
Don’t obsess over “perfect” tracking. Real-world teams change their websites and products constantly. Aim for “useful and mostly consistent,” not flawless.


Honest takes: What works, what doesn’t

  • Works: Using Segment as the single source for tracking means fewer headaches and less debugging.
  • Doesn’t work: Trying to retrofit every possible data point into GA4. Focus on what supports real decisions.
  • Ignore the hype: Segment isn’t a magic bullet. Garbage in, garbage out still applies. And Google Analytics can’t solve data quality issues on its own.

Wrapping up: Start small, iterate, and stay skeptical

Setting up Google Analytics and Segment together isn’t rocket science, but it’s easy to get lost in the weeds. Start with basic events, make sure your data looks right, and use your setup to answer real business questions—not just to fill dashboards. When in doubt, keep it simple and improve as you go. And remember: the best analytics stack is the one you actually use.