Segment

Introduction

Segment is a third party tool that helps you manage the data generated by your web properties. In a nutshell, it lets you connect "Sources" of data (e.g. your Bubble app) with "Destinations" that the data should flow to. Destinations include analytics tools like Google Analytics, marketing tools like Mailchimp, data warehouses like Snowflake, and more.

At Bubble, we use Segment because it lets us implement all the event logging we want in our product once, and lets us direct that stream of data to all the other tools we use. In fact, we use this Segment plugin ourselves on bubble.io!

Note: Segment is a third-party tool that has its own Pricing structure, though there is a free tier.

Installing the Segment plugin

You can find the Segment plugin just like any other plugin: in the marketplace in the Plugins tab from your Bubble editor. (These instructions are for the Bubble-made Segment plugin.)

After you install it, you should see the plugin's settings like this:

Segment plugin settings

The "Write key" can be found in the Segment UI: Sources tab → Settings → API Keys. This is the minimum needed to connect your app with your Segment account.

Using this with Google Analytics

Google Analytics is a popular tool to measure traffic to your app, as well as log events.Note that if you begin using Segment, you should not also use the Google Analytics Bubble plugin. Instead, you should connect GA as a Destination in your Segment account.

To finish establishing the Segment -> Google Analytics connection, in the Destinations tab -> Settings (for Google Analytics), make sure to set:

  • Website Tracking ID (as your Google Analytics id)Serverside Tracking ID (same as above, your Google Analytics id)