# Using Link Parameters to insert UTM codes


Save time and collect more data using Link Parameters in Dyspatch to
automatically add campaign (UTM) parameters for Google Analytics.

UTM parameters can be set [globally and per workspace](/emails/using_utm_parameters/#using-global-and-workspace-link-parameters), [per template](/emails/using_utm_parameters/#adding-utm-parameters-to-an-email), or directly in the URL string in the email builder. [See specificity rules here](/emails/using_utm_parameters/#what-order-are-these-applied).

<div class="highlight note">To set global and workspace utm parameters you must have <a href="/administration/dyspatch_roles/">Admin access</a></div>

## Adding UTM Parameters to an Email

Anyone that can build an email can add and remove Link Parameters. To get
started, navigate to the Metadata tab then Link Parameters to start adding UTM
codes.

![Email Level UTMs](https://docs.dyspatch.io/img/emails/utms-email.png)

When the email is next exported, every link will now include the specified
UTM codes.

<div class="highlight note"> Having trouble adding UTM codes for one off links?
<a href="https://ga-dev-tools.google/ga4/campaign-url-builder/">Try using
Google's URL builder!</a> </div>

## Using Global and Workspace Link Parameters

Global and Workspace Link Parameters are set up in [Admin > Data > Link Parameters](https://app.dyspatch.io/admin/data/link-parameters). Note that you
**must** be an Admin to configure them.

To edit Global Link Parameters, click the three-dot menu (⋮) in the Global entry and select "Edit".

![Email Level UTMs](https://docs.dyspatch.io/img/emails/utms-workspace.png)

To set up Workspace level Parameters, click "Create Parameter", select the workspace(s), and add the parameters. These will be applied to every email in a workspace.

## Using Custom Parameters

In addition to UTM codes, you can use custom link parameters to pass other
values in your links.

Custom Parameters can be set per template from the bottom of the Link Parameters tab (Metadata > Link Parameters) in the Email Builder, and/or added globally or per workspace from
[Admin > Data > Link Parameters](https://app.dyspatch.io/admin/data/link-parameters).

![Custom Parameters input and edit section of Metadata Link Parameters tab](https://docs.dyspatch.io/img/emails/utms-custom-params.png)

<div class="highlight tip">Preview final link values with all parameters applied by hovering over a link in the Email Builder preview, or right-clicking and copying the link address.</div>

## FAQ
### What order are these applied?
The UTM codes "closest" to the actual link take precedence. Meaning that any
UTM codes on a link take precedence over any being applied to the whole
email. Workspace Link Parameters take precedence over Global parameters.

### Can I use variables in Link Parameters?
You betcha! Make sure they're proper DML syntax, like `@{variable}`, to ensure
they will be formatted correctly when exported.

### How do I disable Global UTMs?
Remove any content from the UTM fields in the Global Link Parameters settings.
Setting them to empty will prevent Global Link Parameters from being used and
only Workspace and Template level link parameters are applied.

### How do I stop UTMs from being added to a link in a block?
Add the `data-no-utm` attribute to an anchor tag to prevent Dyspatch from adding
UTM codes. For example:
```html
<dys-text>
  <a href="@{unsubscribe_url}" data-no-utm>Unsubscribe</a>
</dys-text>
```

### What is the Tracking Alias link parameter used for?
The tracking alias field includes an `alias='your-input-value'` attribute to the link element.
This is different than a traditional UTM parameter in that it is only used by Salesforce
Marketing Cloud for click tracking. Other ESPs will ignore this attribute.