Tracking Settings

Get Tracking Settings [GET]

URI Parameter Required Requirements Description
limit No number Number of settings to return.
Example: 20
offset No number Paging offset.
Example: 1

Request

1
GET https://api.sendgrid.com/v3/tracking_settings?limit={limit}&offset={offset} HTTP/1.1

Response

1
2
3
4
5
6
7
8
9
10
11
HTTP/1.1 200
{
  "result": [
    {
      "name": "open",
      "title": "Open Tracking",
      "description": "lorem ipsum... .",
      "enabled": true
    }
  ]
}

Get Click Tracking Settings [GET]

Request

1
GET https://api.sendgrid.com/v3/tracking_settings/click HTTP/1.1

Response

1
2
3
4
HTTP/1.1 200
{
  "enabled": true
}

Update Click Tracking Settings [PATCH]

Request

1
PATCH https://api.sendgrid.com/v3/tracking_settings/click HTTP/1.1
Request Body
1
2
3
{
  "enabled": true
}

Response

1
2
3
4
HTTP/1.1 200
{
  "enabled": true
}

Get Google Analytics Settings [GET]

Request

1
GET https://api.sendgrid.com/v3/tracking_settings/google_analytics HTTP/1.1

Response

1
2
3
4
5
6
7
8
9
HTTP/1.1 200
{
  "enabled": true,
  "utm_source": "sendgrid.com",
  "utm_medium": "email",
  "utm_term": "",
  "utm_content": "",
  "utm_campaign": "website"
}

Update Google Analytics Settings [PATCH]

Request

1
PATCH https://api.sendgrid.com/v3/tracking_settings/google_analytics HTTP/1.1
Request Body
1
2
3
4
5
6
7
8
{
  "enabled": true,
  "utm_source": "sendgrid.com",
  "utm_medium": "email",
  "utm_term": "",
  "utm_content": "",
  "utm_campaign": "website"
}

Response

1
2
3
4
5
6
7
8
9
HTTP/1.1 200
{
  "enabled": true,
  "utm_source": "sendgrid.com",
  "utm_medium": "email",
  "utm_term": "",
  "utm_content": "",
  "utm_campaign": "website"
}

Get Open Tracking Settings [GET]

Request

1
GET https://api.sendgrid.com/v3/tracking_settings/open HTTP/1.1

Response

1
2
3
4
HTTP/1.1 200
{
  "enabled": true
}

Update Open Tracking Settings [PATCH]

By default, the open tracking image used to determine when an email is opened is inserted at the end of your email. It is possible to specify an alternative location by using a replacement tag and the open tracking SMTP API header.

If you are sending through the v3 Mail Send endpoint then you can specify the substitution tag you want to use by setting the enable parameter to true within the open_tracking object and specifying the text you would like to use in the substitution_tag parameter. SendGrid will replace your substitution_tag text with the open tracking pixel wherever you insert it in your email.

Request

1
PATCH https://api.sendgrid.com/v3/tracking_settings/open HTTP/1.1
Request Body
1
2
3
{
  "enabled": true
}

Response

1
2
3
4
HTTP/1.1 200
{
  "enabled": true
}

Get Subscription Tracking Settings [GET]

Request

1
GET https://api.sendgrid.com/v3/tracking_settings/subscription HTTP/1.1

Response

1
2
3
4
5
6
7
8
9
HTTP/1.1 200
{
  "enabled": true,
  "landing": "landing page html",
  "url": "url",
  "replace": "replacement tag",
  "html_content": "html content",
  "plain_content": "text content"
}

Update Subscription Tracking Settings [PATCH]

Request

1
PATCH https://api.sendgrid.com/v3/tracking_settings/subscription HTTP/1.1
Request Body
1
2
3
4
5
6
7
8
{
  "enabled": true,
  "landing": "landing page html",
  "url": "url",
  "replace": "replacement tag",
  "html_content": "html content",
  "plain_content": "text content"
}

Response

1
2
3
4
5
6
7
8
9
HTTP/1.1 200
{
  "enabled": true,
  "landing": "landing page html",
  "url": "url",
  "replace": "replacement tag",
  "html_content": "html content",
  "plain_content": "text content"
}