# How to update automated UTM codes

**URL:** <https://community.hubspot.com/t/how-to-update-automated-utm-codes/106926>\
**Category:** Email Marketing Tool\
**Tags:** workaround, how-to, marketing-email\
**Created:** [May 10, 2024, 6:04pm UTC](https://community.hubspot.com/t/how-to-update-automated-utm-codes/106926 "2024-05-10T18:04:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ymt77](https://avatars.discourse-cdn.com/v4/letter/y/bbe5ce/32.png) [@ymt77](https://community.hubspot.com/u/ymt77)\
**Post date:** [May 10, 2024, 6:04pm UTC](https://community.hubspot.com/t/how-to-update-automated-utm-codes/106926/1 "2024-05-10T18:04:53Z")

</div>

Good afternoon.

Our team setup a personalization token that we add to our links which just contains a user’s ID number, and by adding this to the end of our URLs we’ve been able to track people who click on our HubSpot email links using our CDP. If needed for reference, the token we use is esp\_id={{contact.hs\_object\_id}}

We found, however, that the token is not being added to our automated and transacational emails.

After reaching out to the team members who manage those emails, they weren’t sure how to add the code, as they said that all they do is add just a regular website link into the email (like [www.ourwebsite.com](http://www.ourwebsite.com)), and then HubSpot adds all the tracking codes/UTM codes for them, like . Is there a single place in HubSpot where we can go update the codes that HubSpot automatically adds to our links, so that the platform will update all the links in all our emails on its own? We send a lot of automated and transactional content.

I was thinking if that’s not possible, would it still work alright if we go manually update all the base links in the body of each email so that the token is at the end of the URL? And then HubSpot would still add all the automated UTM codes at the end like how it’s been doing, like utm\_content, utm\_source, etc. So it would be like:

[www.ourwebsite.com?esp\_id={{contact.hs\_object\_id}}](http://www.ourwebsite.com?esp_id=%7B%7Bcontact.hs_object_id%7D%7D)

Thank you.

---

<div class="post-metadata">

**Author:** ![aviafriat26](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/aviafriat26/32/82610_2.png) [@aviafriat26](https://community.hubspot.com/u/aviafriat26)\
**Post date:** [May 10, 2024, 10:54pm UTC](https://community.hubspot.com/t/how-to-update-automated-utm-codes/106926/2 "2024-05-10T22:54:24Z")

</div>

Hey @ymt77,

Hey there! If you’re looking to automatically append the personalization token (`esp_id={{contact.hs_object_id}}`) to URLs in all your automated and transactional emails in HubSpot, there’s not a single central place to update all UTM parameters that HubSpot automatically appends to links. HubSpot generally handles UTM parameters automatically for tracking purposes, but appending additional custom parameters like your personalization token needs to be done manually for each link.

Here’s what you can do:

1. **Manual Update** : Manually add your token to the base URLs in your email templates, as you suggested. For example, your URL would look like `www.ourwebsite.com?esp_id={{contact.hs_object_id}}`. HubSpot will still append UTM parameters after your custom parameters.
2. **Email Template Configuration** : Edit the HTML of your email templates to include this token in the hyperlink structure. This way, whenever the template is used, your links will automatically have the personalization token.
3. **Consistency Check** : Make sure to update all existing email templates and workflows that include links to ensure the token is included going forward.
4. **Test Before Sending** : Always test your emails with a few internal contacts to ensure that the personalization token and UTM parameters are appended correctly and that they work as intended with your CDP.

Adding the token manually to each link is a bit of extra work, but it’s a reliable way to ensure the token is included in all the right places and tracked appropriately. If you find this process a bit cumbersome as you scale, consider reaching out to a HubSpot solutions partner who might offer a more automated approach through custom integration or scripting within HubSpot.

---

<div class="post-metadata">

**Author:** ![ymt77](https://avatars.discourse-cdn.com/v4/letter/y/bbe5ce/32.png) [@ymt77](https://community.hubspot.com/u/ymt77)\
**Post date:** [May 13, 2024, 2:40pm UTC](https://community.hubspot.com/t/how-to-update-automated-utm-codes/106926/3 "2024-05-13T14:40:47Z")

</div>

Good morning.

Thank you so much for the thorough response! I will connect with my team and see if we can update all the base links in our emails, then.

Thank you.
