Lead Capture Tools

UPPER
Member

Capturing Lead Traffic Source through non-hubsport form via API request to Hubspot

Hey everyone,

 

I am currently trying to set up an integration from our non-hubspot to an internal Hubspot from via the API.

Here a code snippet:

$.ajax({
url: window.location.origin + '/wp-content/themes/upper/ajax/get-started.php',
type: 'POST',
data: data,
}).done(function() {
const settings = {
"async": true,
"crossDomain": true,
"url": "https://api.hsforms.com/submissions/v3/integration/submit/6964127/202a0bc3-24fe-403f-b912-1f53a1fed3...",
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"processData": false,
"context": {
"hutk": window.__hsUserToken,
},
"data": JSON.stringify({
"fields": [{
"name": "email",
"value": data.email,
}, {
"name": "firstname",
"value": data.firstName,
}, {
"name": "lastname",
"value": data.lastName,
}, {
"name": "company",
"value": data.company,
}, {
"name": "phone",
"value": data.phone,
}],
"legalConsentOptions": {
"consent": {
"consentToProcess": true,
"text": "I agree to allow Upper to store and process my personal data."
}
}
})
};

$.ajax(settings).done(function(response) {
if (typeof $('input[name="resource[]"]:checked').val() != 'undefined') {
window.location.href = window.location.origin + '/thank-you/';
}
});

 

--

 

The problem here:
- Hubspot is unable to attribute the lead sources to the accounts that get created after the form submit. It's always "Direct Traffic", which has been proven to not be the case

Would be great to get some ideas on how to fix this! 🙂

Thanks in advance

0 Upvotes
1 Reply 1
PamCotton
Community Manager
Community Manager

Capturing Lead Traffic Source through non-hubsport form via API request to Hubspot

Hello, @UPPER I wanted to add a few top experts to share their opinion about this integration you are setting up @JBeatty @DanielSanchez @tjoyce any recommendations?

 

Thank you,

Pam

Você sabia que a Comunidade está disponível em outros idiomas?
Participe de conversas regionais, alterando suas configurações de idioma !


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !




0 Upvotes