Properly identify source of contacts added via API (currently most attributed to “offline source”)

Hi, @ym42324.

Thanks for the detailed post!

To expand upon @eduardoavargas’s post, if you are creating contacts with either the v3 CRM Contacts API or v1 Contacts API, the Original Source value “Offline Sources” is expected for new contacts, per this article.

While you can change the Original Source (hs_analytics_source) property value manually and via API, the only way to assign a value based on a contact’s web activity is to associate the visitor’s hubspotutk cookie with a contact record.

There are a few ways to do this. The three most relevant include:

  • The Forms API is by far the most popular method, since it allows you to create and update contacts with property values and cookies in a single request. We recommend this creation method for most web applications.
  • The Tracking Code API’s identify method can also associate hubspotutk usertoken values with resulting contacts, but many customers I’ve worked with have found it more difficult to implement successfully.
  • The Timeline API is also an option to create contact records and associate them with usertoken values, but this API requires server-side requests and more infrastructure (i.e. a HubSpot developer app and OAuth authentication) than the two methods above.

Regarding your use of the identify method, it could help you set or retroactively update “Offline Sources” contacts with web activity-informed values if it is implemented correctly.

Are you triggering trackPageView after _hsq.push(["identify",{ email: memb_email }]);?