Skip to contentSkip to navigationSkip to topbar
On this page
Looking for more inspiration?Visit the
(information)
You're in the right place! Segment documentation is now part of Twilio Docs. The content you are used to is still here—just in a new home with a refreshed look.

SendGrid Marketing Campaigns Source


Source Info
  • The SendGrid Marketing Campaigns Source is an Event Cloud source. This means that it sends data as events, which are behaviors or occurrences tied to a user and a point in time. Data from these sources can be loaded into your Segment warehouses, and also sent to Segment streaming destinations. Learn more about cloud sources.
  • This source is in Beta

SendGrid Marketing Campaigns lets you automatically stream your email events directly into Segment for use inside your warehouse or other downstream destinations.

This is an Event Cloud Source that can not only export data into your Segment warehouse but also federate the exported data into your other enabled Segment destinations.

This source is maintained by SendGrid Marketing Campaigns. For any issues with the source, contact their Support team.


Getting started

getting-started page anchor
  1. From your workspace's Sources catalog page(link takes you to an external page) click Add Source.
  2. Search for "SendGrid Marketing Campaigns" in the Sources Catalog, select SendGrid Marketing Campaigns, and click Add Source.
  3. On the next screen, give the source a name configure any other settings.
    • The name is used as a label in the Segment app, and Segment creates a related schema name in your warehouse. The name can be anything, but Segment recommends using something that reflects the source itself and distinguishes amongst your environments (for example, Sendgrid_Prod, Sendgrid_Staging, Sendgrid_Dev).
  4. Click Add Source to save your settings.
  5. Copy the Write key from the Segment UI.
  6. Log in to your SendGrid Marketing Campaigns account - navigate to Integrations > Segment -> Connect and paste the key. Select the matching region and any email events you want to receive.

SendGrid Marketing Campaigns uses Segment's stream Source component to send Segment event data. It uses a server-side Track method to send data to Segment. These events are then available in any destination that accepts server-side events and available in a schema in your data warehouse so you can query using SQL.

SendGrid Marketing Campaigns passes a SHA256 hash of the recipient's email address as anonymousId. The raw email address is passed in context.traits.email.


The following table lists events that SendGrid Marketing Campaigns sends to Segment. These events appear as tables in your warehouse, and as regular events in other Destinations.

Event NameDescription
Email ProcessedEmail was sent successfully
Email DeliveredEmail delivered successfully
Email OpenedRecipient opened the email
Email Machine OpenedEmail was opened anonymously
Email Link ClickedRecipient clicked the tracking link
Email DroppedEmail was dropped by Sendgrid
Email BouncedEmail servers rejected the email
UnsubscribedRecipient unsubscribed globally
Unsubscribed From GroupRecipient unsubscribed from a group
Resubscribed To GroupRecipient resubscribed to a group
Email Marked as SpamRecipient reported the email as spam

The table below list the properties included in the events listed above. Some properties are only available for Single Sends or Automations.

Property NameDescription
eventEmail event type
anonymousIdSHA256 hash of the recipient email
email_type"Singlesend" or "Automation"
template_idEmail template ID
email_subjectSubject line of the email, when available
test_phasetrue if the Single Send is an A/B Test in the test phase
unsubscribe_group_idID of the unsubscribe group, when available
link_urlURL of the link clicked
categoriesCategories associated to the email
campaign_nameName of the Single Send
campaign_idID of the Single Send
automation_nameName of the Automation
automation_idID of the Automation
automation_step_idID of the Automation step
context.traits.emailThe recipient's raw (unhashed) email address
context.traits.ipThe opening computer's public IP address
context.traits.user_agentThe opening browser's user agent

Now that your source is set up, you can connect it to destinations.

Log into your downstream tools and check to see that your events appear as expected and that they contain all of the properties you expect. If your events and properties don't appear, check the Event Delivery tool and refer to the Destination docs for each tool for troubleshooting.

If there are any issues with how the events are arriving to Segment, contact the SendGrid Marketing Campaigns support team.