Getting the IP Address of the Recipient "Who" Engaged with the Email

Question

How do I get the IP addresses of users who interacted with my emails?

 

Product

SendGrid Email API and Marketing Campaigns.

 

Answer

This information is not available on SendGrid Dashboard | Activity Feed. Customers are able to retrieve the IP address of the recipient who engaged with the email through the Event Webhook. The webhook response returns the following object when talking about "engaged" IPs:

1. For Group Unsubscribe or Resubscribe:

[
{
"email": "example@test.com",
"timestamp": 1513299569,
"smtp-id": "<14c5d75ce93.dfd.64b469@ismtpd-555>",
"event": "group_unsubscribe",
"category": "cat facts",
"sg_event_id": "ahSCB7xYcXFb-hEaawsPRw==",
"sg_message_id": "14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0",
"useragent": "Mozilla/4.0 (compatible; MSIE 6.1; Windows XP; .NET CLR 1.1.4322; .NET CLR 2.0.50727)",
"ip": "255.255.255.255",
"url": "http://www.sendgrid.com/",
"asm_group_id": 10
}
]
[
{
"email": "example@test.com",
"timestamp": 1513299569,
"smtp-id": "<14c5d75ce93.dfd.64b469@ismtpd-555>",
"event": "group_resubscribe",
"category": "cat facts",
"sg_event_id": "w_u0vJhLT-OFfprar5N93g==",
"sg_message_id": "14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0",
"useragent": "Mozilla/4.0 (compatible; MSIE 6.1; Windows XP; .NET CLR 1.1.4322; .NET CLR 2.0.50727)",
"ip": "255.255.255.255",
"url": "http://www.sendgrid.com/",
"asm_group_id": 10
}
]

2. For Clicks and Opens

[
{
"email": "example@test.com",
"timestamp": 1513299569,
"event": "click",
"category": "cat facts",
"sg_event_id": "kCAi1KttyQdEKHhdC-nuEA==",
"sg_message_id": "14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0",
"useragent": "Mozilla/4.0 (compatible; MSIE 6.1; Windows XP; .NET CLR 1.1.4322; .NET CLR 2.0.50727)",
"ip": "255.255.255.255",
"url": "http://www.sendgrid.com/"
}
]
[
{
"email": "example@test.com",
"timestamp": 1513299569,
"event": "open",
"sg_machine_open": false,
"category": "cat facts",
"sg_event_id": "FOTFFO0ecsBE-zxFXfs6WA==",
"sg_message_id": "14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0",
"useragent": "Mozilla/4.0 (compatible; MSIE 6.1; Windows XP; .NET CLR 1.1.4322; .NET CLR 2.0.50727)",
"ip": "255.255.255.255"
}
]

 

Additional information 

http_remote_ip becomes just "IP" when we report it to the webhook, so customers should be using that to get the IP reported on engagement events.

Important: IP - is the IP address used to send the email. For unsubscribes*, clicks and open events, it is the IP address of the recipient who engaged with the email. The IP address will not be available in the response JSON for certain events such as *global unsubscribes, deferral and bounce.

Have more questions? Submit a request