# Sync hutk data with Contacts API

**URL:** <https://community.hubspot.com/t/sync-hutk-data-with-contacts-api/71111>\
**Category:** APIs & Integrations\
**Created:** [December 13, 2022, 2:52pm UTC](https://community.hubspot.com/t/sync-hutk-data-with-contacts-api/71111 "2022-12-13T14:52:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![InsightMedia](https://avatars.discourse-cdn.com/v4/letter/i/e9bcb4/32.png) [@InsightMedia](https://community.hubspot.com/u/InsightMedia)\
**Post date:** [December 13, 2022, 2:52pm UTC](https://community.hubspot.com/t/sync-hutk-data-with-contacts-api/71111/1 "2022-12-13T14:52:52Z")

</div>

We are using the Contacts API to create HubSpot contacts when users register on our website. After registering, we pass their e-mail address to the JS push identify method, which syncs page activity to the contact.

```lia-code-sample
_hsq.push(["identify",{
 email: 'test@test.com'
 }]);

```

This works well.

But we also want to sync the tracked page data from before the contact was created. Because now, the contact activity shows the contact has been created from offline sources by integration.  
I understand this data is identified by the hutk cookie. But how can we attach/sync this to the contact ?

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [December 14, 2022, 5:47pm UTC](https://community.hubspot.com/t/sync-hutk-data-with-contacts-api/71111/2 "2022-12-14T17:47:25Z")

</div>

Hi, @InsightMedia 👋 Thanks for reaching out. Hey, @miljkovicmisa [@klloyd\_\_1](https://community.hubspot.com/t5/user/viewprofilepage/user-id/381293), do you have any tips for @InsightMedia?

Thank you! — Jaycee

---

<div class="post-metadata">

**Author:** ![klloyd\_1](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/klloyd_1/32/28881_2.png) [@klloyd\_1](https://community.hubspot.com/u/klloyd_1)\
**Post date:** [December 14, 2022, 10:38pm UTC](https://community.hubspot.com/t/sync-hutk-data-with-contacts-api/71111/3 "2022-12-14T22:38:46Z")

</div>

Thanks for the tag [@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074)

@InsightMedia my recommendation would be to use the [Submit Form Data API](https://legacydocs.hubspot.com/docs/methods/forms/submit_form?_ga=2.252637069.566275615.1658152581-1332086896.1652896717) when a user registers on your site. You’ll of course be able to pass over Contact properties, but you’ll also be able to link the hutk of the cookie previously placed on their browser with the Form Submit API.

 ![2022-12-14 17_37_33-Submit data for a form _ Forms API.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/3/0/3082e8284c01d5f6a0069056dfec8e38fc376ec6.png)

It’s possible there’s an API that is contact-based and attach’s the hutk, but this is certainly my preferred method and would work well with your registration case!
