APIs & Integrations

viktor1
Member

Direct traffic and Login via Social Networks

We implemented on our site Login via Social Networks:

  • site redirects user to Google or FB and after success result it returns back to our site
  • our cient side js code prepares data for hubspot like this:
    hs_context: JSON.stringify({
    hutk: ... // the value of "hubspotutk" cookie,
    ipAddress: ....,
    pageUrl: location.href,
    pageName: 'Sign Up'
    })
  • we send data about new user with hs_context object to our server side and server side calls Hubspot Forms API to submit users data and create new contact. We do the same for our main signup flow (sending data to Hubspot API) but the difference is that after login via Social Network the most of the users have "Original Source" = Direct traffic & "Original Source Drill-Down" = "No URL". This is our main issue. Seems like browser and hubspot analytic script lose information about original http referer. Also we can try to update contacts "Original Source Drill-Down" field manually but it looks like read-only property.
0 Upvotes
5 Replies 5
IsaacTakushi
HubSpot Employee
HubSpot Employee

Direct traffic and Login via Social Networks

Thank you for that information, @viktor!

It sounds like you used to use the identify method to create contact records client-side with JavaScript. Am I understanding you correctly?

Would you share links to a few working contacts who did not use social login?

I ask because you shared links to the v3 Forms API endpoint, which accepts the JSON context object while the v2 Forms API endpoint was used to create this contact and this contact and accepts the stringified hs_context object.

Since the hutk and ipAddress are passed slightly differently for each endpoint, can you confirm that you are using the v2 endpoint instead of the v3 endpoint for both your normal login as well as the social login?

Finally, could you share links to both your normal and social sign up pages? I would like to investigate the issue by creating test accounts.

Isaac Takushi

Associate Certification Manager
0 Upvotes
viktor1
Member

Direct traffic and Login via Social Networks

Hi Isaac

It appears that ALL of our users who used social signup were created incorrectly on hubspot.
I could provide links to working contact that did not use social login.

We used to call the client side ( javascript) API to create the profile from the browser. but we found that we got bad data from many customers when we used this method because these customers had some kind of blocking extension installed on their browser or were on a a VPN which blocked any communication between the browser and hubspot from a different domain. We therefor decided to use server side hubspot API to guarantee that the profiles of the users will be created at the same time their account is. since the API was called from our servers it was not blocked and the profiles were created successfully.

We have made sure we pass the correct infromation to the "submit forms" API. (https://developers.hubspot.com/docs/methods/forms/submit_form_v3). that includes the hutk and the ipAddress values. yet users are not created successufly , where "IP Country", "Original Source" and "Original Source Drill Down" is not showing the correct data for users which are doing social signup on our application.

My Assumption is that we are still missing something or doing it wrong specifically in this case. Would it be possible for you to get the technical details of how HB fill this information for a user ? so that we might correct the data that we are submitting when calling the HubSpot submit form API: https://developers.hubspot.com/docs/methods/forms/submit_form_v3

Many Thanks

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

Direct traffic and Login via Social Networks

Hi, @viktor.

Per my request, could you please also provide links to a few working contacts who have the correct Original Source value from the social login? You say that "most of the users" are affected by this issue, implying that some are working. I will need to see examples of these if they exist.

Isaac Takushi

Associate Certification Manager
0 Upvotes
viktor1
Member

Direct traffic and Login via Social Networks

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

Direct traffic and Login via Social Networks

Welcome, @viktor!

Happy to help. Could you share the following?

  • Your Hub ID.
  • Links to a few "working" contacts who have the correct Original Source value from the social login (since you say that "most of the users" are affected by this issue, but not all).
  • Links to a few contacts with the incorrect Original Source value.

Have you been able to replicate the behavior in your own tests? If so, please provide links to example contacts and clarify which Original Source you would expect them to have (e.g. "Paid Search", "Referrals", etc.).

Isaac Takushi

Associate Certification Manager
0 Upvotes