# Lead's source attribution for SaaS

**URL:** <https://community.hubspot.com/t/leads-source-attribution-for-saas/100202>\
**Category:** APIs & Integrations\
**Tags:** professional\
**Created:** [February 15, 2024, 9:11am UTC](https://community.hubspot.com/t/leads-source-attribution-for-saas/100202 "2024-02-15T09:11:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![OCheikha](https://avatars.discourse-cdn.com/v4/letter/o/e47c2d/32.png) [@OCheikha](https://community.hubspot.com/u/OCheikha)\
**Post date:** [February 15, 2024, 9:11am UTC](https://community.hubspot.com/t/leads-source-attribution-for-saas/100202/1 "2024-02-15T09:11:20Z")

</div>

Hi guys,  
Because we’re a PLG company once a prospect is signing up it is usually not being performed with a HubSpot form. This lead will go into the system (HS) through API and his original source would be offline sources.  
If it was an ordinary HubSpot form, the system would have known to attribute all previous site visits to this lead and tag him with the right source which he really came from.

Obviously, we would like to be able to see the true source of that lead. What solutions are there for immediately syncing the lead’s details to HubSpot, on the same session without using custom integration?  
Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Berangere](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/berangere/32/220784_2.png) [@Berangere](https://community.hubspot.com/u/Berangere)\
**Post date:** [February 22, 2024, 10:40am UTC](https://community.hubspot.com/t/leads-source-attribution-for-saas/100202/2 "2024-02-22T10:40:40Z")

</div>

Hi @OCheikha,  
Thank you for reaching out to the Community!  
First, I’d like to share these resources for information:  
- [Update the lead source property](https://knowledge.hubspot.com/contacts/what-is-lead-source-and-how-does-the-property-get-updated)  
- [Understand Original and Latest source properties](https://knowledge.hubspot.com/properties/understand-source-properties)  
- [Understand HubSpot’s traffic sources in the traffic analytics tool](https://knowledge.hubspot.com/reports/understand-hubspots-traffic-sources-in-the-traffic-analytics-tool)  
I found similar threads that might be of interest:  
- The solution from @IsaacTakushi on this post “[API Post into an existing source in Hubspot](https://community.hubspot.com/t5/APIs-Integrations/API-Post-into-an-existing-source-in-Hubspot/m-p/239845)”  
- The solution from @Willson on this post “[Lead Source API](https://community.hubspot.com/t5/APIs-Integrations/Lead-Source-API/m-p/325551)”  
I also wanted to invite a couple of subject matter experts to this conversation: Hi @MBERARD, @DanielJeal and @Teun do you have suggestions to help @OCheikha, please?  
If anybody else has anything to add and/or share, please feel free to join in the conversation 🙂  
Thanks so much and have a lovely day!  
Best,  
Bérangère

---

<div class="post-metadata">

**Author:** ![OCheikha](https://avatars.discourse-cdn.com/v4/letter/o/e47c2d/32.png) [@OCheikha](https://community.hubspot.com/u/OCheikha)\
**Post date:** [February 22, 2024, 1:13pm UTC](https://community.hubspot.com/t/leads-source-attribution-for-saas/100202/3 "2024-02-22T13:13:33Z")

</div>

Thank you for your answer and resources! I’ll look into it 🙂 [@BérangèreL](https://community.hubspot.com/t5/user/viewprofilepage/user-id/230185)  
Looking forward to @MBERARD, @DanielJeal and @Teun’s response.

---

<div class="post-metadata">

**Author:** ![OCheikha](https://avatars.discourse-cdn.com/v4/letter/o/e47c2d/32.png) [@OCheikha](https://community.hubspot.com/u/OCheikha)\
**Post date:** [February 28, 2024, 12:19pm UTC](https://community.hubspot.com/t/leads-source-attribution-for-saas/100202/4 "2024-02-28T12:19:28Z")

</div>

Hey guys,

Perhaps I should just embed the tracking code on our app domain? I feel like it could solve it

@MBERARD, @DanielJeal @Teun

---

<div class="post-metadata">

**Author:** ![Berangere](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/berangere/32/220784_2.png) [@Berangere](https://community.hubspot.com/u/Berangere)\
**Post date:** [March 7, 2024, 11:59am UTC](https://community.hubspot.com/t/leads-source-attribution-for-saas/100202/5 "2024-03-07T11:59:23Z")

</div>

Hi @OCheikha, I hope that you are well!  
Thank you for your patience!  
I’d like to invite a couple of subject matter experts to this conversation:  
Hi [@Phil\_Vallender](https://community.hubspot.com/t5/user/viewprofilepage/user-id/74), @DanielSanchez, @mangelet, @Jnix284 and @danmoyle do you have suggestions to help @OCheikha, please?  
Also, if anybody else has anything to add and/or share, please feel free to join in the conversation 🙂  
Thank you so much and have a great day!  
Best,  
Bérangère

---

<div class="post-metadata">

**Author:** ![danmoyle](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/danmoyle/32/91166_2.png) [@danmoyle](https://community.hubspot.com/u/danmoyle)\
**Post date:** [March 7, 2024, 3:42pm UTC](https://community.hubspot.com/t/leads-source-attribution-for-saas/100202/6 "2024-03-07T15:42:18Z")

</div>

Hi @OCheikha and welcome to thje Community! I agree, adding the HubSpot tracking code to your assets (app, website, etc.) is critical. This will help track contacts as the interact, and add source information to their journey.

---

<div class="post-metadata">

**Author:** ![azisbak](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/azisbak/32/205484_2.png) [@azisbak](https://community.hubspot.com/u/azisbak)\
**Post date:** [March 16, 2026, 5:26am UTC](https://community.hubspot.com/t/leads-source-attribution-for-saas/100202/7 "2026-03-16T05:26:55Z")

</div>

The challenge you’re having is that HubSpot’s native attribution only works when someone completes an actual HubSpot form. When leads come in via API (like from your app signup), HubSpot has no way to connect that new contact to their previous website activity, so it defaults to “Offline Sources.”

The best way to solve this is to capture the attribution data when visitors first land on your website, store it in your database when the user signs up, and then include it in the API payload you send to HubSpot to create a new contact.

Tools like Attributer can help with this. You put their code on your site, and when a visitor lands on your site, it stores the UTM parameters, referrer data, and other attribution information in a first-party cookie. Then, when the user signs up in your app, you can pull that data from the cookie using JavaScript and store it in your database (usually on the users or accounts table). Finally, you send it along with the contact creation API call to HubSpot (and you can also send it to other tools as well, like billing platforms such as Stripe, product analytics tools like Amplitude, etc).

With this approach, even though the signup didn’t happen through a HubSpot form, you’re still sending HubSpot the original source information (Paid Search, Organic Search, Paid Social, etc.) plus campaign details, landing page, and other context.

You could also write custom JavaScript to handle the cookie storage and retrieval yourself, but that requires ongoing maintenance as browsers update and your site structure evolves.

The key is capturing the attribution data early in the visitor journey and then making sure it gets passed through when the API creates the contact in HubSpot.

P.S If this all sounds technical, it’s not that hard. Your developers could probably get this all set up in about an hour.

P.P.S: I used an AI assistant to help structure this response because I’m not great at writing, but the advice comes from my experience and I’ve reviewed it before posting.
