SendGrid: Import Audiences
Importing user and activity data from SendGrid results in new users and/or existing user profiles supplemented with SendGrid campaign activity data. You can use this data to build and refine your existing Lytics audiences to power better, cross-channel campaigns.
Integration Details
- Implementation Type: Server-side.
- Implementation Technique: User import REST API, Activity Webhooks.
- Frequency: User data is batch imported daily. Activity data, if configured, is received real-time.
- Resulting data: Full user profiles for all SendGrid contacts or users in the selected lists. If configured, activity data related to marketing campaigns and transactional emails at the event level will be collected as additional user fields.
This integration utilizes the SendGrid APIs to receive user data. On each run of the job, it will:
- Export all contacts in your SendGrid account, or if you've configured import lists or segments, it will filter to only contacts in the selected lists and segments.
- For each contact imported it will:
- Get that contact's list membership.
- Ingest the collected user data into the
sendgrid_users
stream.
If the Import email events option is selected during the configuration process, on the first run of the job it will also:
- Check if webhooks are set up in the SendGrid account.
- Automatically apply the proper settings to your SendGrid account to enable activity data to be sent to Lytics.
- After this, user activity is received in Lytics via webhook, reformatted on ingestion, and available in the
sendgrid_activity
stream.
Fields
The following fields are included in the default mapping of the sendgrid_users
stream:
Source Field | Lytics User Field | Description | Type |
---|---|---|---|
email unique id | string | ||
id | sendgrid_id unique id | SendGrid User ID | string |
emaildomain | Email Domain | string | |
first_name | first_name | First Name | string |
last_name | last_name | Last Name | string |
last_clicked | sg_last_clicked | Last Clicked (SendGrid) | date |
last_emailed | sg_last_emailed | Last Emailed (SendGrid) | date |
last_opened | sg_last_opened | Last Opened (SendGrid) | date |
list_ids | sg_list_ids | SendGrid List IDs | []string |
list_names | sg_list_names | SendGrid Lists | []string |
segment_ids | sg_seg_ids | SendGrid Segment IDs | []string |
Lytics will import all custom fields from SendGrid, however this stream does not automatically map these fields. If you would like to map the imported custom fields to Lytics user fields, contact customer support for assistance.
The following fields are included in the default mapping of the sendgrid_activity
stream:
Source Field | Lytics User Field | Description | Type |
---|---|---|---|
email unique id | string | ||
n/a | channels | the channel this event was received from, set to email | []string |
event | email_bounce_ct | Email Bounced | int |
category | email_category | Email Categories | map[string]intsum |
event | email_click_ct | Email Clicked | int |
event | email_complaint_ct | Email Complaint | int |
timestamp | email_first_bounce_ts | First Email Bounced | date |
timestamp | email_first_complaint_ts | First Email Complaint | date |
timestamp | email_first_sent_ts | First Email Sent | date |
timestamp | email_firstclick_ts | First Email Clicked | date |
timestamp | email_firstopen_ts | First Email Opened | date |
timestamp | email_last_bounce_ts | Last Email Bounced | date |
timestamp | email_last_complaint_ts | Last Email Complaint | date |
timestamp | email_last_sent_ts | Last Email Sent | date |
timestamp | email_lastclick_ts | Last Email Clicked | date |
timestamp | email_lastopen_ts | Last Email Opened | date |
event | email_open_ct | Email Opened | int |
event | email_sent_ct | Email Sent | int |
url | email_urls | Email Urls Clicked on | []string |
emaildomain | Email Domain | string | |
url | hashedurls | Hashed Urls Visited | map[string]intsum |
timestamp | last_active_ts | Last Active | date |
last_channel_activities | Last Activity By Channel | map[string]time | |
bounce_type | sg_bounce_type | SendGrid Bounce Type | []string |
marketing_campaign_name | sg_campaigns | SendGrid Campaigns | []string |
experience_id | sg_conversions | Converted on SendGrid Experience | map[string]int |
event | sg_email_action | SendGrid Email Actions | map[string]intsum |
event | sg_email_opens | SendGrid Email Opens | int |
reason | sg_error_reason | string | |
experience_id | sg_impressions | Reached with SendGrid Experience | map[string]int |
Configuration
Follow these steps to set up and configure an import of SendGrid in the Lytics platform. If you are new to creating jobs in Lytics, see the Jobs Dashboard documentation for more information.
- Select SendGrid from the list of providers.
- Select the Import Audiences job type from the list.
- Select the Authorization you would like to use or create a new one.
- Enter a Label to identify this job you are creating in Lytics.
- (Optional) Enter a Description for further context on your job.
- Select the Import Email Events checkbox, to allow email event data to be sent to Lytics via webhooks. This will only turn on webhooks if they are not already configured to another destination within your SendGrid account. You can also manually set up SendGrid webhooks to go to Lytics by following these instructions.
- From the Import Lists input, select the list(s) to import users from. If left blank, users will not be filtered by list.
- From the Import Segments input, select the segment(s) to import users from. If left blank, users will not be filtered by segment.
- Click Start Import.