APIs & Integrations

ntorretti
Member

Contacts created through webapp and forms API showing up as Offline Sources or Direct Traffic

Currently we have a probem where a large amount of our contacts are being created with the original source showing up as either Offline Sources > API or Direct Traffic > Unknown URL. An example of our flow would be someone coming in through a Facebook Ad, going to our marketing wordpress site and clicking a link that takes them to our webapp where they create their account. On that account creation is where we call the forms API. I would expect this to show the original source as coming from Facebook or Social in some way. We are using the v3 Forms API and I have verified that we do have a hubspot tracking code that we are sending over. I have also veified that we have Automatic cross-domain linking turned on in our settings as well. I'm not sure if there is another piece that we are missing or another setting that needs to be turned on.

0 Upvotes
3 Replies 3
WendyGoh
HubSpot Employee
HubSpot Employee

Contacts created through webapp and forms API showing up as Offline Sources or Direct Traffic

Hey @ntorretti,

 

The analytics data are set based on the analytics data associated with the contact. In the context of Forms API, it would be the hutk value. You would need to ensure that the hutk value is being populated with the visitor's hubspotutk cookie value. If you're passing the hutk value in the form submission data and not seeing the correct source, could you share with me the following:

1. A link to an example contact record

2. The form POST data that's getting sent to HubSpot (with the hs_context field)

 

0 Upvotes
ntorretti
Member

Contacts created through webapp and forms API showing up as Offline Sources or Direct Traffic

Hi. Thank you so much for replying.

 

1. Here is an example contact record of a test contact we did. https://app.hubspot.com/contacts/2784414/contact/7242901/

 

2. Here is an example of the form POST data that we are sending over to hubspot with some test data in it.

 

{
      "submittedAt": 1581425177749,
      "fields": [
        {
          "name": "app_ontask_io_last_activity_date",
          "value": 1581379200000
        },
        {
          "name": "email",
          "value": "ntorretti91+testhubspot@gmail.com"
        },
        {
          "name": "firstname",
          "value": "test"
        },
        {
          "name": "lastname",
          "value": "test"
        },
        {
          "name": "jobtitle",
          "value": ""
        },
        {
          "name": "app_ontask_io_original_source",
          "value": "e60a811b0300e4e9b6a441aa1a1e0030"
        },
        {
          "name": "plan_type",
          "value": "TRIAL"
        },
        {
          "name": "trial_transactions_used",
          "value": 0
        },
        {
          "name": "trial_activation_date",
          "value": 1581379200000
        }
      ],
      "context": {
        "hutk": "e60a811b0300e4e9b6a441aa1a1e0030"
      }
    }
0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Contacts created through webapp and forms API showing up as Offline Sources or Direct Traffic

Hey @ntorretti,

 

When looking at contact Test test, it doesn't look like it has any Form Submission on it. 

 

As mentioned by my colleague Isaac here: https://community.hubspot.com/t5/APIs-Integrations/Original-source-set-to-quot-Offline-sources-quot/... , if you do not want original source to be populated as Offline Source, 

 

Don't:
Use the Contacts API, as it cannot pass hutk cookie values.
Use the Events HTTP API, as it also won't pass cookies.

Do:
Use either the trackPageView or trackEvent JavaScript functions after the identify function. These will pass a hutk cookie to the new contact record.
Alternatively, use this Forms API endpoint and pass a hutk value directly in the context object.

In this case, it looks like contact Test test is being created through contact API and not from a form submission (as I'm not seeing any record of form submission on the contact record timeline). That said, if you're certain that contact Test test made a form submission, do you mind sharing with me the form guid/name that the submission was on? 

0 Upvotes