With the Segment integration, available in the Looker Action Hub, you can send out data to a variety of integrations managed by Segment, including third-party applications like Marketo, Hubspot, and others.
Read this post from the Looker Blog to learn how Segment integration helps Close the Loop Between Data Analysis and Action.Your Looker instance must be on Looker 4.18 or newer.
Customer-hosted instances may be unable to enable actions from the Looker Action Hub, especially actions that support streamed results or that use OAuth, if the customer-hosted Looker instance does not fulfill these requirements.
See the Sharing data through an action hub documentation page for suggested solutions to this potential issue.
Setting up a Segment integration
Follow the instructions below to configure Segment and Looker to use any of the Segment integrations from the Looker Action Hub.
Setting up Segment
In Segment, create a Looker source and get the Segment write key.
After getting data from Looker to Segment, you can connect to a destination.
Creating a Looker source
Before enabling Segment in Looker, you must 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:
-
On the Source Setup page, click Add Source:
Copying 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
segment.com/<your-segment>/sources/setup/looker
, replacing<your-segment>
with your Segment address. -
Click Copy to copy the write key to your clipboard.
Now you can enable any of the Segment integrations in the Looker Action Hub.
Enabling the Segment integrations in Looker
- In your Segment workspace, create a Looker source: Segment > Sources > Cloud Apps > Looker.
- Admins can enable any of the Segment integrations in Looker from the Actions page in the Admin panel under the Platform header: Admin > Platform > Actions.
- Select Enable on the Segment integration you would like to enable.
- Grab the write key from your Segment Looker Source overview page.
- Paste the Segment write key into the Write Key field on the Looker Actions page.
Adding Segment tags to your model
To send or schedule data with Segment attributes, first add Segment tags to the appropriate fields in your Looker model.
Two important tags, email
and user_id
, are outlined below and can be attached to Segment user email addresses and user IDs. You can also use a segment_anonymous_id
tag for users with an Anonymous ID.
dimension: email {
sql: ${TABLE}.email ;;
tags: ["email"]
}
dimension: user_id {
sql: ${TABLE}.user_id ;;
tags: ["user_id"]
}
Creating and delivering a Look or an Explore
Create a Look or an Explore with the user
field and the email
field or the user_id
field selected. All Segment partners require email
or user_id
. Click the gear icon in the upper right of the Look or Explore and select Send or Schedule (for Looks), or select Send or Save and Schedule (for Explores). Fill in the appropriate delivery information in the Send or Schedule window and click Send (for sending) or Save All (for scheduling).
Without the correct user ID, your data will not be delivered to your supported integrations. You can see the required IDs for each supported Segment integration in the Segment documentation.
In the schedule pop-up, select Segment as the destination. Schedule a report to be sent to Segment and downstream partners on an interval, or simply send the report once by clicking on Send Test.
You can confirm that Segment is receiving your Segment attributes in the debugger: segment.com/your-segment/sources/looker/debugger.
Your payload might look like the following:
New in Looker 7.8, you can delivered pivoted data to Segment.