How to pass UTM information when creating a contact through the API

SOLVE
Mansoor
Member

Hey! 


I am currently able to create a contact using the hubspot API. 


I'd like to pass the UTM information so when creating it doesn't say created by the API but created by the correct campaign. 

 

I've tried adding the hutk cookie value and passed it as a property in hubspot but nothing. 


Maybe my approach is wrong would love some insight on how to accomplish this. 

 

Current: 

Analytics says we are creating the contact from the API (which is technically correct)

 

Expected outcome:
Create a contact and have the Analytics say its from the campaign we put together rather then created by the API. 

 

Any help is appreciated!

 

1 Accepted solution

Accepted Solutions
Teun
Solution
Guide | Diamond Partner

Hi @Mansoor ,

 

You are probably using the Contacts API. But what you want is the Form submission API.

 

The Form submission API expects you to create a certain form and send the contact data as a form submission to this endpoint. You can also pass it the 'hutk' cookie value and it will show you everything you need (including website behaviour etc.) if you have the HubSpot tracking script installed.

 

It will show up as a form submission on the form you created and the contact will have all data you need in the timeline and the properties.

Did my answer solve your issue? Help the community by marking it as the solution.

View solution in original post

0 Upvotes
3 Replies 3
Teun
Solution
Guide | Diamond Partner

Hi @Mansoor ,

 

You are probably using the Contacts API. But what you want is the Form submission API.

 

The Form submission API expects you to create a certain form and send the contact data as a form submission to this endpoint. You can also pass it the 'hutk' cookie value and it will show you everything you need (including website behaviour etc.) if you have the HubSpot tracking script installed.

 

It will show up as a form submission on the form you created and the contact will have all data you need in the timeline and the properties.

Did my answer solve your issue? Help the community by marking it as the solution.

View solution in original post

0 Upvotes
Mansoor
Member

Hey @Teun ,


That is correct I am using the Contacts API. 

So what does the flow look something like this.

Create a form that on submission creates a contact

API will then submit to the form and send over the hutk.

Does this work with deals? Does it mean that I always have to create a new form? 


Teun
Guide | Diamond Partner

Hi @Mansoor ,

 

This will only work with contacts, but you could create a workflow that creates a deal when a form is submitted. You could use one single form for all submissions, but you could create unique forms for each submission type.

The process you described is correct.

Did my answer solve your issue? Help the community by marking it as the solution.
0 Upvotes