APIs & Integrations

egami
Participant

Form submission is always considered as "From exising contact"

Hi, this is the first time I ask quesitons here.

 

I'm currently developing a SPA (Single Page Application) Web application using Tracking code API and Forms API.

 

<Overview>

・Using tracking code API to identify users and track their pageviews

・Using non-HubSpot form (HTML form) in HTML

・Submitting form data to my HubSpot form using this endpoint on backend.

 

I'm identifing users and tracking their pageviews with codes below.

 

Identify a visitor

 

 

var _hsq = window._hsq = window._hsq || [];
_hsq.push(["identify",{
    id: "visitor-id"
}]);
_hsq.push(["trackPageView"]);

 

 

 

Tie a visitor's data to a contact

 

 

var _hsq = window._hsq = window._hsq || [];
_hsq.push(["identify",{
    email: "test@example.com",
    id: "visitor-id"
}]);
_hsq.push(["trackPageView"]);

 

 

 

Track pageview

 

 

var _hsq = window._hsq = window._hsq || [];
_hsq.push(['setPath', '/about-us']);
_hsq.push(['trackPageView']);

 

 

 

<Issue>

When I track a visitor's pageviews and tie the data to a contact, new contact is created automatically. However, when I submit form data using Forms API after that on backend, the form submission is always considered as "From exising contact". 

 

I think one of the ways to get around it is to submit form on frontend, and then tie visitor's data to a contact. However, I want to submit form on backend if it's possible.

 

Is there any way to solve this issue?

0 Upvotes
1 Reply 1
Jaycee_Lewis
Community Manager
Community Manager

Form submission is always considered as "From exising contact"

Hi, @egami 👋 Thanks for reaching out. Hey, @Mike_Eastwood @Teun, can you lend a hand here? Or offer thoughts on other ways to tackle challenges similar to what @egami is facing?

 

Best,

Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes