SendGrid: Import Audiences (Legacy)
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.
For more information, see how to migrate from legacy marketing campaigns. If you are using the current Marketing API in SendGrid, please use the standard Import Users job.
Integration Details
- Implementation Type: Server-side.
- Implementation Technique: REST API, Webhooks.
- Frequency: User data is batch imported daily, on a continuous basis. Activity data, if configured, is received in 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:
- Query for all contacts in your SendGrid account, or if you've configured Import Lists, it will query for recipients of those lists.
- For each contact that has been updated since the last run of the workflow (or for all users on the first run of the job) it will:
- Query for list membership of that user.
- 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.
Note: If you've already configured webhooks to send to another destination in your account, this job will not overwrite your existing settings. You can manually set up SendGrid webhooks to go to Lytics by following these instructions.
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 | ||
emaildomain | Email Domain | string | |
first_name | first_name | First Name | string |
id | sendgrid_id unique id | SendGrid User ID | string |
last_clicked | sg_last_clicked | Last Clicked | date |
last_emailed | sg_last_emailed | Last Emailed | date |
last_name | last_name | Last Name | string |
last_opened | sg_last_opened | Last Opened | date |
list_ids | sg_list_ids | SendGrid List IDs | []string |
list_names | sg_list_names | SendGrid Lists | []string |
Lytics will import any and 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 |
---|---|---|---|
event | email_open_ct email_sent_ct email_click_ct email_complaint_ct email_bounce_ct sg_email_opens sg_email_action | Email Opened Email Send Email Clicked Email Complaint Email Bounced SendGrid Email Opens SendGrid Email Actions | int int int int int int map[string]int |
timestamp | last_active_ts email_lastopen_ts email_firstopen_ts email_last_sent_ts email_first_sent_ts email_lastclick_ts email_firstclick_ts email_last_complaint_ts email_first_complaint_ts email_last_bounce_ts email_first_bounce_ts | Last Active Last Email Opened First Email Opened Last Email Sent First Email Clicked First Email Sent Last Email Clicked Last Email Complaint First Email Complaint Last Email Bounced First Email Bounced | date date date date date date date date date date date |
bounce_type | sg_bounce_type | SendGrid Bounce Type | []string |
reason | sg_error_reason | string | |
category | email_category | Email Categories | map[string]int |
url | email_urls hashedurls | Email Urls Clicked on Hashed Urls Visited | []string map[string]int |
marketing_campaign_name | sg_campaigns | SendGrid Campaigns | set |
"email" | channels last_channel_activities | Channels Last Activity By Channel | []string map[string]date |
email unique id emaildomain | Email Email Domain | string string | |
experience_id | sg_impressions sg_conversions | Reached with SendGrid Experience Converted on SendGrid Experience | map[string]int map[string]int |
Configuration
Follow these steps to set up and configure a legacy import of SendGrid users 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(Legacy) 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.
- (Optional) Select the Import email events checkbox if you want to import activity data via webhooks. As noted above, 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.
- (Optional) Under Advanced Options you may select a limited number of lists to import using the Import Lists selection. If not selected, the import will default to collect data on all contacts.
Click Start Import.