# Custom API Event Tracking

**URL:** <https://community.hubspot.com/t/custom-api-event-tracking/16403>\
**Category:** APIs & Integrations\
**Tags:** events\
**Created:** [September 24, 2019, 9:51pm UTC](https://community.hubspot.com/t/custom-api-event-tracking/16403 "2019-09-24T21:51:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kjavan05](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/kjavan05/32/99678_2.png) [@kjavan05](https://community.hubspot.com/u/kjavan05)\
**Post date:** [September 24, 2019, 9:51pm UTC](https://community.hubspot.com/t/custom-api-event-tracking/16403/1 "2019-09-24T21:51:54Z")

</div>

I am in Marketing Operations at a startup and am falling short from a technical perspective to solve a problem that our team is having, so I wanted to ping the community to hopefully find a solution!

Our problem: we have a trial signup flow on our marketing site and I have been having difficulty setting up tracking for new signups. From an attribution perspective, I am trying to create a contact in Hubspot once they click to signup and record the original source and conversion information on the record. Currently, our flow is as such: Prospect clicks sign up button → Connects using their g-suite or o365 credentials (soon will be just via email and a series of additional informational questions) → gets access to product → product sends information to Stripe to create customer record → Stripe syncs with Salesforce → Salesforce syncs with Hubspot (very lengthy I know!). Since we don’t have the event tracking at point of conversion working, Hubspot is recording these signups as coming from Salesforce, which is obviously breaking our attribution.

At a previous company, I had worked with engineering on solving this issue with an API call workaround, but I can’t remember the details. I am hoping this community can point me in the right direction!

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [September 25, 2019, 9:31pm UTC](https://community.hubspot.com/t/custom-api-event-tracking/16403/2 "2019-09-25T21:31:57Z")

</div>

Hi, @kjavan05.

Happy to help.

We generally recommend using the [Forms API](https://developers.hubspot.com/docs/methods/forms/forms_overview) to create contacts in HubSpot whenever web analytics or attribution information is crucial.

[This endpoint](https://developers.hubspot.com/docs/methods/forms/submit_form_v3), for instance, accepts a `context` object in which you can include the `hubspotutk` cookie value in the `hutk` field. Assuming the HubSpot tracking code is installed on your website, the contact will be attributed [according to their referrer and tracking parameters](https://knowledge.hubspot.com/articles/kcs_article/reports/how-does-hubspot-categorize-visits-contacts-and-customers-in-the-sources-report).

You mentioned that “[you] don’t have the event tracking at point of conversion working.” Are you referring to some setup already involving HubSpot APIs, or are you starting from scratch?
