# Using UTMs when creating contacts from API

**URL:** <https://community.hubspot.com/t/using-utms-when-creating-contacts-from-api/60180>\
**Category:** CRM\
**Created:** [July 1, 2022, 8:31am UTC](https://community.hubspot.com/t/using-utms-when-creating-contacts-from-api/60180 "2022-07-01T08:31:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ialonso](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ialonso/32/27089_2.png) [@ialonso](https://community.hubspot.com/u/ialonso)\
**Post date:** [July 1, 2022, 8:31am UTC](https://community.hubspot.com/t/using-utms-when-creating-contacts-from-api/60180/1 "2022-07-01T08:31:53Z")

</div>

Hi there,

I am facing the following situation:

- My Hubspot account is synced with my product via API.
- I am creating contacts by sending the user detaills (name, email…) I collect in the registration process to a Hubspot Form.

What’s happening now, is that I am not getting proper data for Original and Last Source, and I’m neither getting the information of utms.

How can I have this information filled in the CRM. Are there any utm properties available in Hubspot, If so, how can I send the data to Hubspot throught the API?

Thanks! This is really being a huge headache!

---

<div class="post-metadata">

**Author:** ![JPanama](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jpanama/32/43754_2.png) [@JPanama](https://community.hubspot.com/u/JPanama)\
**Post date:** [July 4, 2022, 3:32pm UTC](https://community.hubspot.com/t/using-utms-when-creating-contacts-from-api/60180/2 "2022-07-04T15:32:13Z")

</div>

Hi @ialonso, thanks for getting in touch.

There are a couple of items here. I understand you wish to create Contacts by sending data to a HubSpot Form and in doing so pass their UTMs to the Contact record. I think it’s worth providing some fuller context as to how we set the Original Source properties. Here’s how that works:

1. Generally speaking, we look at the First Page Seen property for a Contact.
2. We scan the URL for various parameters (utm\_source, utm\_medium etc)
3. [The **1st** rule in this table](https://knowledge.hubspot.com/reports/understand-hubspots-traffic-sources-in-the-traffic-analytics-tool#how-traffic-is-categorized-into-each-source) that is successfully met then determines this Original Source.

Usually, any Contacts created by Form Submission that do not meet the rules mentioned above will be set as [Offline Sources with a Drill Down value that contains the Form ID](https://knowledge.hubspot.com/contacts/understand-source-properties#:~:text=Form%20%3E%20%5Bform%20ID,HubSpot%20Sales%20extension.).  
HubSpot automatically sets a contact’s _Original Source_ (`hs_analytics_source`) value based on analytics data associated with the [`hutk`](https://knowledge.hubspot.com/reports/what-cookies-does-hubspot-set-in-a-visitor-s-browser#:~:text=hubspotutk,when%20deduplicating%20contacts.) value passed in a form submisson and the afforementioned criteria. It is not possible to set `hs_analytics_source` or `hs_analytics_source_data_1` directly via a form submission.

You can set the Original Source property _after_ the Contact is created either via Workflow, or via the Contacts API.

I hope that’s cleared some of this up for you. Let me know if there’s anything you’d like me to clarify.

Best,  
Joe (HubSpot Moderator)

---

<div class="post-metadata">

**Author:** ![ialonso](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ialonso/32/27089_2.png) [@ialonso](https://community.hubspot.com/u/ialonso)\
**Post date:** [July 4, 2022, 4:57pm UTC](https://community.hubspot.com/t/using-utms-when-creating-contacts-from-api/60180/3 "2022-07-04T16:57:32Z")

</div>

Thank you so much for the response. So, let’s say I create 3 contact properties:

- utm\_source
- utm\_medium
- utm\_campaign

When I create the contact sending the data to the form via API, I could send these 3 values.

Additionally, I should create a workflow which will populate the following properties:

- Original Source: following the rules you’ve mentioned in the article.
- Original Source Analytics 1: do you have some extra information on what usually goes in here so I can create a workflow taht replicates this?
- Original Source Analytics 2: do you have some extra information on what usually goes in here so I can create a workflow taht replicates this?

If there are not “standard” rules, or it doesn’t have an effect on Hubspot Analytics, I will just create my own rules based on utm parameters to set these 2 extra properties.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![JPanama](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jpanama/32/43754_2.png) [@JPanama](https://community.hubspot.com/u/JPanama)\
**Post date:** [July 5, 2022, 7:48am UTC](https://community.hubspot.com/t/using-utms-when-creating-contacts-from-api/60180/4 "2022-07-05T07:48:51Z")

</div>

Hi @ialonso,

At this time it’s _only_ possible to change the Original Source property. It’s not possible to change the Drilldown values as they are read-only. One thing to note is when you change the Original (or Latest Source) property, the Drill Down values will be cleared to their original values. You can learn more about how those Drill Down values are set in this article [here](https://knowledge.hubspot.com/contacts/understand-source-properties#:~:text=Facebook%20ad%20campaign.-,The%20drill-down%20properties,contain%20the%20same%20information.,-The%20following%20table).

Best,  
Joe (HubSpot Moderator)
