The SendGrid Event Webhook lets you stream all email events directly to Keen for nearly real-time analysis and long term storage.
It only takes a couple of minutes to start streaming email event data from SendGrid to Keen, and once you do, you'll get tools to create flexible email analytics and stunning email marketing dashboards.
Before continuing with this guide, you should first create SendGrid and Keen accounts if you do not have them already.
https://api.keen.io/3.0/projects/<YOUR_KEEN_PROJECT_ID>/email/sendgrid/1.0?api_key=<YOUR_KEEN_WRITE_KEY>
Whether starting with a new webhook or editing an existing one, you will set a Post URL, which is where you'll add your Keen URL.
Once your webhook's Post URL is set by following the linked directions above, you will be able to click Test Your Integration in the SendGrid webhook dialog to send a test payload to Keen. The sample email data from SendGrid is an example and not data related to your actual email send.
Once you send a test payload from SendGrid, navigate to the Keen application to see the sample data.
Each email event type that is selected will be recorded as a separate Event Collection in your Keen project. We recommend sending all event types from SendGrid to Keen to access the full functionality of Keen's reporting.
The email events that are recorded in Keen are:
email_bounce
email_click
email_deferred
email_delivered
email_dropped
email_group_resubscribe
email_group_unsubscribe
email_open
email_processed
email_spamreport
email_unsubscribe
As SendGrid email data streams to Keen, it will be enhanced using Keen's Data Enrichment capabilities. Keen's data enrichment turn IP addresses into geographic locations and break out timestamps, URLs, and user agent strings into data such as device_type
, day_of_the_week
, and URL path
.
Use the property message_id
or singlesend_name
contained in each event to track a particular email across all of these possible actions. Similarly, you can follow a particular user's behavior via the email
property.
With Keen, you will have access to all of your raw data for as long as you need it. An archive of all of your email data is created, which means you will have access to your historical data and can query for past user behavior.
Just like SendGrid, Keen is 100 percent powered by APIs. This means you can embed rich analytics anywhere you can write code.
The following resources provide more information about working with your data once it's in the Keen platform. See the "Additional Resources" section of this page for more SendGrid and Keen documentation.