Playbook
minute read
Completed [date]

Segment

Learning Objectives

What you’ll learn

  • What Segment is
  • How to use Segment to set up conversion tracking and analytics
  • How Segment sends the data to Google Analytics

Overview

It’s OK if you don’t remember or understand everything in this doc. It will feel a lot more intuitive once you actually start using Segment in our project. Don’t stress too much if there’s too much new vocab.

Segment makes it easy to add new tools and tracking to your site.

You use Segment to log events like button clicks and user data like email addresses throughout your site. Then, you configure it to automatically send that data to the right places, such as:

  • Facebook ads — so you know which ads are working well.
  • A chat widget — so you can chat with the right person.
  • CRMs such as Salesforce — so you can follow up with them through email
  • Usability tools like FullStory and Hotjar — so you can see video recordings of specific users on your site.

The basic process is:

  1. Engineers add all the events you’ve specced out for them, using Segment’s code.
  2. You configure Segment to add every tracking tool you need.
  3. For example, you can add GA and Facebook Ad tracking to your site.
  4. Each one only takes a minute or two to set up.
  5. Segment will automatically send the event data along to these tools as they happen

Sources & Destinations

Segment organizes itself with Sources and Destinations.

If we add Facebook Ads (a Destination) to www.demandcurve.com (a Source), Facebook will start receiving the events and user data being logged on our site. So when someone clicks a button on our site, Facebook will know about it — once we hook up the data in Segment.

Sometimes, Segment sends data to a Destination automatically. For example, Google Analytics automatically receives every event you log with Segment.

Other times, we need to translate the Source data into something the Destination can understand. For example, a signup event on your website would be called a CompleteRegistration event on Facebook. We'll cover this more in the project.

Some definitions, if you’d like…

Sources

A Source represents a codebase. It’s the codebase for your site, your web app, your mobile app, or your server. These Sources are where events like button clicks and page visits get recorded.

You need one source for each codebase you have. Your product team can tell you what codebases you have.

Destinations

You add Destinations to a Source. These are third-party tools and platforms that you want added to your site/app. For example: Facebook or Google Analytics.

So when someone clicks a button on your site (the Source), Facebook (the Destination) learns about it.

Open search