> For the complete documentation index, see [llms.txt](https://doc.batch.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.batch.com/guides-and-best-practices/email-deliverability/email-authentication-and-sending-structure/click-tracking-and-tracking-subdomain-setup/setting-up-a-click-tracking-subdomain.md).

# Setting Up a Click Tracking Subdomain

Get to know how to set up a new click tracking subdomain with Batch to use your own domain in tracking links.

## About Subdomains <a href="#h_be6e237ec3" id="h_be6e237ec3"></a>

An email subdomain is **a prefix** added to your main domain name.

<figure><img src="https://509463063-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfiAYaWDWqtFZeXxyg67F%2Fuploads%2FloedP0I5EpVqxZTD1REy%2Fdeliverability_tracking-subdomain_300925.png?alt=media&amp;token=0f63c84c-572c-4028-9767-d6ad77559efe" alt=""><figcaption></figcaption></figure>

If your company domain is **`company.com`**, you can create any subdomain that will be usef for your tracking links: `click.company.com`, `track.company.com`, etc.&#x20;

{% hint style="danger" %}
The following examples are not subdomains:

* **Separate domain with hyphen**: domain-x.com (e.g., `click-company.com`)
* **Different root domain**: domain.x.com (e.g., `company.click.com`)
  {% endhint %}

## Setup Overview

To use **your own subdomain for tracking links** (such as `click.yourdomain.com` ), you need to configure a Content Delivery Network (CDN) / proxy that:

* Intercepts clicks on your tracking subdomain
* Forwards the requests to Batch servers
* Maintains the tracking functionality while preserving your domain branding

Here is how this would work:

<figure><img src="https://509463063-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfiAYaWDWqtFZeXxyg67F%2Fuploads%2FOAMvh9HlRu1CZQMSaDUA%2Fdeliverability_custom-click-tracking_300925.png?alt=media&amp;token=8202dba9-ad39-4a09-86e1-fcb8a18ad57c" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
All tracking links will use HTTPS to ensure encrypted, secure connections when recipients click through from emails.
{% endhint %}

{% hint style="info" %}
If you are not familiar with how click tracking work for emails, please take a look at our dedicated article: [Email Click Tracking Explained](https://doc.batch.com/guides-and-best-practices/email-deliverability/email-authentication-and-sending-structure/click-tracking-and-tracking-subdomain-setup/email-click-tracking-explained.md)
{% endhint %}

## Setting Up a Tracking Subdomain

{% stepper %}
{% step %}

### Choosing a Subdomain Name

Choose a subdomain name that is clear, short and trustworthy. Here are some advices to find a good subdomain name:

#### ❌ DON'T

* **Technical solution names** (e.g., batch.domain.com): While technical teams may prefer this approach to simplify DNS management, it's not recommended. Solution-specific subdomains are rarely used in production email infrastructure and can confuse recipients.
* **Single-letter abbreviations** (e.g., b.domain.com): Avoid abbreviated subdomains that could be confused with technical subdomains like bounce records, and make DNS management difficult.
* **Random names** (e.g. xp3kd8.domain.com): These may be confusing for your recipients and spam filters.

#### ⚠️ PROCEED WITH CAUTION

* **Suspicious terms:** Avoid using terms that might worry users because they are too trechnical or privacy concerning (e.g., `proxy.company.com`, `analytics.company.com`, `tracking.company.com`, etc).
* **Long prefixes**: Avoid unnecesarily long prefixes like `email-tracking.company.com`, etc.

#### ✅ DO

Use clear, short (2-5 characters) and trustworthy prefixes. Here are some examples:

* `click.company.com`
* `go.company.com`
* `link.company.com`

{% hint style="warning" %}
Use a subdomain dedicated exclusively to Batch click tracking. Ensure it's\
not already in use for emails or other purposes in your organization.
{% endhint %}
{% endstep %}

{% step %}

### Adding the Required DNS Records

Once done, you will need to add the following DNS record to your DNS zone:

```
click.company.com 3600 IN CNAME eu.v2.spgo.io.
```

{% endstep %}

{% step %}

### Setup Validation&#x20;

Once the configuration is done, please contact us mentioning the tracking subdomain you have chosen. This will help us validate the setup and activate the custom click tracking for your project.

You can contact:

* A Solutions Engineer if an implementation project is ongoing
* Or our Custom Care team through <support@batch.com>
  {% endstep %}

{% step %}

### Custom Click Tracking Activation

*That's it!* As soon as your setup is validated, Batch will start using your custom tracking domain to generate tracking links.
{% endstep %}
{% endstepper %}

## Alternative: Using your own CDN/Reverse Proxy

Your CDN must be configured to forward all HTTPS requests to Batch's tracking endpoint.

Origin Server Configuration:

* **Endpoint:** `eu.spgo.io`
* **Protocol:** HTTPS only
* **Method:** Forward all incoming requests

Our partner, SparkPost, offers step-by-step guides to help you configure your CDN: [Configuring your CDN](https://support.sparkpost.com/docs/tech-resources/enabling-https-engagement-tracking-on-sparkpost#step-by-step-guides)

Alternatively, you can use a reverse proxy following [SparkPost's documentation](https://support.sparkpost.com/docs/tech-resources/using-proxy-https-tracking-domain).

## Troubleshooting

You can verify that your custom tracking domain is properly forwarded to Batch's tracking endpoint using the `curl` command to check the routing and security:

```
curl -v https://subdomain.company.com/f/a/b/c/d
```

Look for the `HTTP/2 302` status code. This redirect indicates that your CDN has successfully forwarded the request to Batch's tracking server.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://doc.batch.com/guides-and-best-practices/email-deliverability/email-authentication-and-sending-structure/click-tracking-and-tracking-subdomain-setup/setting-up-a-click-tracking-subdomain.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
