The Engagement Tracking feature allows you to detect how your email recipients are interacting with messages sent to them; specifically, if they are opening the message, clicking on links within the message, or if the recipient has requested to be unsubscribed from the messages they are receiving.
To use the Engagement Tracking feature, you must confgure one or more Tracking Domains. Tracking Domains are used to label the links and images in your email messages, allowing the domains in the URL to match your own domain while still allowing SocketLabs to track engagement.
Setup
Prior to setting up a Tracking Domain, a CNAME record must be established with your DNS service provider. This CNAME must point a subdomain to tracking.socketlabs.com. NOTE: You can re-use the CNAME record created for engagement tracking to set up your engagement tracking domain.
Endpoint
https://api.socketlabs.com/v2/subaccount/:subaccountId/tracking
Path Variables
- subaccountId (number, required)
Attributes
Property Name | Data Type | Details |
domain | string | Domain or subdomain you want to set up for engagement tracking |
opensEnabled | boolean | |
clicksEnabled | boolean | |
unsubscribesEnabled | boolean | |
automaticTrackingEnabled | boolean | |
googleAnalyticsEnabled | boolean | |
isDefault | boolean |
Example Request
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.socketlabs.com/v2/subaccount/:subaccountId/tracking");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"domain\": \"tracking.example.com\",\n \"opensEnabled\": false,\n \"clicksEnabled\": true,\n \"unsubscribesEnabled\": false,\n \"automaticTrackingEnabled\": true,\n \"googleAnalyticsEnabled\": false,\n \"httpsEnabled\": true,\n \"isDefault\": true\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Example Response
{
"data": {
"domain": "tracking.example.com",
"opensEnabled": true,
"clicksEnabled": false,
"unsubscribesEnabled": true,
"automaticTrackingEnabled": false,
"googleAnalyticsEnabled": true,
"isDefault": true,
"encryptedTrackingStatus": "Pending",
"createdOn": "1948-08-01T06:26:00.183Z",
"updatedOn": "1993-03-18T11:43:19.565Z"
}
}
Ready to send mail? You have some options. First, let’s move on to our Injection API.