# Adding URL parameters to links

Adding URL parameters to your links enables you to better track and analyze customers’ interactions with the messages you send from Customer.io. You can set up templated URL parameters and automatically add them to links in your emails.

## How it works[](#how-it-works)

While Customer.io supports [link tracking](/journeys/link-tracking/), you might want to add URL parameters to links to track clicks from specific campaigns, messages, or other factors.

You can manually add URL parameters to links in messages, but this can be tedious and error-prone. You probably have a repeatable set of parameters that you want to use for links in different messages.

That’s where our URL parameters feature comes in. It makes it easy to automatically append a templated set of URL parameters to links in your messages. When you enable URL parameters, you’ll append them to any link use the `cio_link` [liquidA syntax that supports variables, letting you personalize messages for your audience. For example, if you want to reference a person’s first name, you might use the variable `{{customer.first_name}}`.](/using-liquid) tag.

```fallback
{% cio_link url:"https://example.com" %}
```

## Enable URL parameters[](#enable-url-parameters)

Go to **[Workspace Settings > URL Parameters](https://fly.customer.io/workspaces/last/settings/actions/url_params)** to enable and set up URL parameters. When you enable URL parameters, they’re automatically appended to any link where you use the `cio_link` liquid tag.

[![URL Paramters show as Disabled besides the title. There is a button to enable on the right.](https://docs.customer.io/images/url-parameters-disabled.png)](#224835b23088e39651c2fab3e6277274-lightbox)

### Default parameters[](#default-parameters)

Our default URL parameters are commonly used properties in analytics platforms like Google Analytics. The values help you tie clicks back to the messages and campaigns your audience interacts with.

Parameter

Default value

Description

`utm_source`

`customer.io`

The source of the link.

`utm_medium`

`{{message.type}}`

The source “medium” for the link the user clicked, like `email_action`.

`utm_campaign`

`{{campaign.name}}`

The campaign the message (and link) belonged to.

`utm_content`

`{{message.name}}`

The name of the message that contained the link.

 Disable `campaign.name` if you use URL parameters outside of campaigns

Empty liquid variables aren’t valid, if you leave the `utm_campaign` set to `campaign.name` and try to use `cio_link` to include URL parameters on links in a broadcast, newsletter, or transactional message, your message will fail.

### Default URL parameters in action[](#default-url-parameters-in-action)

For example, imagine you have a campaign and message with the following details.

*   **Campaign name**: Retention Campaign 1 \[Marketing\] \[Internal\]
*   **Email name**: Hello World Email

With our default URL parameters, you’d add a link like this: `{% cio_link url:"https://example.com" %}`.

And we automatically append the URL parameters in your rendered email, like this:

`https://example.com/?utm_content=Hello+World+Email&utm_medium=email_action&utm_name=Retention+Campaign+1+%5BMarketing%5D+%5BInternal%5D&utm_source=customer.io`

### Using URL parameters in SMS and WhatsApp messages[](#using-url-parameters-in-sms-and-whatsapp-messages)

URL parameters and make links significantly longer. If you use URL parameters (or Customer.io’s [link tracking](/journeys/link-tracking/) feature) in these kinds of messages, make sure that you [enable link shortening](/journeys/sms-link-shortening/) so that your links fit in your messages.

### How do I check that my URL parameters work?[](#how-do-i-check-that-my-url-parameters-work)

In an email, you can click **Review Links** to see your URL parameters in action.

[![image.png](https://docs.customer.io/images/image%28167%29.png)](#a0fc46b91055835e5841f74d44ac5ac7-lightbox)

## Add URL parameters to a link[](#add-url-parameters-to-a-link)

To add URL parameters to a link, use the `cio_link` tag with the `url` parameter.

```fallback
{% cio_link url:"https://example.com" %}
```

## Add or remove URL parameters[](#add-or-remove-url-parameters)

In your [URL parameter settings](https://fly.customer.io/workspaces/last/settings/actions/url_params), click **Edit Parameters** to add, remove, or edit your URL parameters. Any changes you make apply to links using the `cio_link` tag immediately.

[![image.png](https://docs.customer.io/images/image%28168%29.png)](#cf4ff2d76e3f1fe4762518ed2bf0e7d4-lightbox)

 You can shorten long campaign or newsletter names

You can use the [Liquid truncate filter](/journeys/liquid-tag-list/?version=latest#truncate-latest) to shorten long values in links, like this: `{{ campaign.name | truncate: 15, "" }}`. This example truncates your campaign name to 15 characters.

## Disable URL parameters for a link[](#disable-url-parameters-for-a-link)

You can simply omit the `cio_link` tag to remove URL parameters from a link if you don’t want us to append URL parameters to a link. Or, if you want to differentiate between links that include and don’t include URL parameters, you can add the `url_params:false` parameter to the `cio_link` tag.

```fallback
{% cio_link url:"https://example.com" url_params:false %}
```

If you use our drag-and-drop editor, you can add the `disable-url-params` class to any item that acts as a link—links, buttons, images, etc.

## URL parameters and link tracking[](#url-parameters-and-link-tracking)

[Link tracking](/journeys/link-tracking/) helps you understand which links your audience clicks and the percentage of your audience that clicks each link.

URL parameters can help you track performance and engagement outside of Customer.io—in platforms like Google Analytics, for example. They also give you more control over the data you track—down to the campaign and message level.

## Liquid in URL parameters[](#liquid-in-url-parameters)

Here’s a list of common liquid values you might use in your URL parameters.

Tag

Output

`{{layout.id}}`

The numerical ID associated with the email layout you've used. \*\*Only available for emails made with the code or rich text editors.\*\*

`{{layout.name}}`

The name you've assigned to the email layout you've used. \*\*Only available for emails made with the code or rich text editors.\*\*

`{{campaign.id}}`

Your campaign's numerical ID. This can be found in your campaign URL. For example, the campaign ID here is 2000: https://fly2.customer.io/env/12345/v2/campaigns/**2000**/overview

`{{campaign.name}}`

This tag will output the name you've given your campaign or newsletter in the Customer.io interface. For example: "Q2 Anvil Onboarding Campaign \\\\\\\\\\\[Coyotes\]"

`{{campaign.type}}`

This returns whether or not your campaign is **behavioral** (segment triggered), **transactional** (event triggered), or a **newsletter**

`{{delivery_id}}`

A URL-compatible base64 string that identifies a specific message created for an end-user. This is generated when the message is drafted or sent but will be set to "unsent" in test messages and composer previews.

`{{message.id}}`

The numerical ID associated with a message action in the workflow— i.e. an SMS action might have a `{{message.id}}` of 200 while every SMS it generates will have a different `{{delivery_id}}`.

`{{message.name}}`

The name you give your message in the workflow. E.g. "Welcome to ACME!"

`{{message.type}}`

This refers to a particular message's type. Possible values are: `email_action`, `twilio_action`, `slack_action`, `webhook_action`, `attribute_update_action`

`{{customer.id}}`

Whatever you're using to uniquely identify your customer—usually numeric**\***.

 Your analytics provider (like Google) may prohibit you from sending personal information or have specific guidelines for tracking; make sure you’re aware of any restrictions.