With the Segment integration, available in the Looker Action Hub, you can send Looks and Explores to a variety of integrations managed by Segment, including third-party applications like Marketo, Hubspot, and others.
To start using Segment in Looker:
- A Looker admin sets up a Segment integration. This step is only required once.
- A Looker developer sets up Segment tags. This step is only required once.
- A Looker user selects Segment as the destination of a delivery.
Setting up a Segment integration
You must be a Looker admin to set up a Segment integration.
To set up a Segment integration:
In your Segment workspace, search the Catalog for the Looker source and select it.
In Source setup, give your source a name (typically
Looker
), and select Add Source.Segment will display a write key for your source. Copy this write key.
In your Looker instance, navigate to the Actions page in the Platform section of the Admin panel.
Select Enable next to the Segment action you want to enable.
Paste the Segment write key from step 3 into the Segment Write Key field.
Select Save.
To finish setting up your Segment integration, add Segment tags to your LookML model.
Adding Segment tags to your LookML model
To send or schedule Looks and Explores with Segment attributes, first add LookML tags to the appropriate fields in your Looker model. For a complete list of allowed tags for each action, see the tags (for fields) documentation page.
Most actions require at least the email
and user_id
tags. Add these tags to the fields in your LookML model that correspond to Segment user email addresses and user IDs, respectively. For example:
dimension: email {
sql: ${TABLE}.email ;;
tags: ["email"]
}
dimension: user_id {
sql: ${TABLE}.user_id ;;
tags: ["user_id"]
}
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.
Sending a Look or an Explore to Segment
Once you have set up the Segment integration and defined LookML tags, you can send Looks and Explores to Segment.
Create a Look or build an Explore using one or more fields with a Segment LookML tag.
Select the gear icon. For Looks, select either Send or Schedule. For Explores, select either Send or Save and schedule.
Select your Segment destination.
Configure other delivery settings as desired and select Send or Save.
Your payload will be delivered in JSON format.
Confirm that Segment is receiving your Segment attributes using the Segment debugger.