Looker includes a Segment integration that lets you query your data using Looker, and then send that data out to a variety of integrators managed by Segment. From there you can take actions on that data with third party applications like Marketo, Hubspot, and Urban Airship. This means you can trigger marketing campaigns, activate win-back campaigns, and define custom email cohorts right from the Looker interface using the the power of Looker and Segment.
Read our blog post, Segment Integration helps Close the Loop Between Data Analysis and Action, to learn more about what you can do with the Looker Segment integration.
Setting Up the Segment Integration
Follow the instructions below to configure Segment and Looker.
Set Up In Segment
In Segment, you need to create a Looker source and get the Segment Write Key.
After getting data from Looker to Segment, you can connect to a destination.
Create a Looker Source
Before enabling Segment in Looker, you have to configure a Looker Source in Segment:
- From the Segment Overview page, click View More Options.
Scroll to the Looker Source and click on it:
From the Looker page, click Connect.
In the Source Setup page, click Add Source:
Copy the Segment Write Key
Once you have created a Looker source in Segment, copy the Segment Write Key:
- Within Segment, navigate to your Looker Source page, or access it at the URL
<your-segment>with your Segment address.
Click Copy to copy the Write Key to your clipboard.
Set Up In Looker
In Looker, you need to enable the Segment integration and add tags to your LookML model.
After setup, you can send data to segment.
Enable the Segment Integration
Use the Segment Write Key to enable communication with Segment within Looker:
- In Looker, click the Admin tab.
- Click Actions in the Platform section of the left menu panel.
Click Enable. Note, if you have already enabled Segment on your instance, this button will say Edit.
In the Segment page, set Enable to ON.
Paste your Write Key into the Segment Write Key field.
Add Tags to your LookML Model
All Segment partners will require either the email or user_id field. Without the correct ID, your data will not make it to your supported integrations. You can see the required IDs for each supported Segment integration here.
Segment requires that you use the LookML
tags parameter to identify the fields that store either a user’s email address or user_id.
tags parameter to one or both of the identifying dimensions in your LookML model, like the examples below:
Send Data From Looker to Segment
Once you have enabled the Segment Integration, sending data to Segment is simple. You can either send data immediately or on a schedule.
To send data to Segment immediately:
- From an Explore by choosing the Send option in the Explore gear menu. This lets you immediately send a query’s data or visualization to segment immediately — without saving it to a dashboard or a Look.
- From a Look by opening it, clicking its gear, and choosing its Send option. The Send option also is available from the Look or dashboard’s gear menu in Space
To send data to Segment on a schedule:
Opening or creating a Look with the data you want to send to your Segment partner. Be sure to include either the user email or the user_id field as needed by your Segment partner.
Create a schedule for your Look, and select Segment as the destination. You can schedule the Look to be sent to Segment and your Segment partner on a regular interval, or you can send the report once by clicking Send Test.
Whether sending immediately or on a schedule, you can confirm that your data was received by Segment using the Segment debugger. Navigate to your Looker Source page within Segment and click the Debugger tab, or access the debugger at the URL
segment.com/<your-segment>/sources/looker/debugger. When you send data to Segment, you should see a list of records received by Segment in the debugger.
Connect Segment to One or More Destinations
When you can successfully send data to Segment, you can then set up the destinations. In Segment, click the Destinations button in your Looker Source page. From there you can configure and connect to Marketo, Hubspot, and a number of other data destinations to automate your Looker workflows.