APIs & Integrations


Log activity information from a separate web app onto contact record

We have a custom web application that our customers use. The app has the Hubspot tracking pixel on it. I want to be able to track when a user logs into our app and populate a propertyy on the contact record of their last login date and time. 


I've tried to do this by using a non-hubspot form for our login page but it tracks everytime its submitted (even if the attempt is not successful or spam... which creates bogus accounts in our system that need to deleted manually). Our login page can also be bypasssed if the users cookie is valid which missses the login form completly, so I miss the tracking.


Is there another way for me to track when a user is logs in and add that activity to the contact record? Do I need an API to do this? We have marketing hub professional and sales enterprise. It's not clear to me if we can use any of the API's because some say they require Marketing Hub Enterprise.


Thanks for your help.

1 Reply 1
HubSpot Employee
HubSpot Employee

Log activity information from a separate web app onto contact record

Hi, @mattarnzen.


Thanks for reaching out.


I generally recommend two APIs for login use cases:
• The Tracking Code API's identify function

• The Timeline API.


Neither of these APIs require a specific subscription level and both are capable of passing HubSpot cookie data and setting or updating contact property values.


The identify function can be triggered with client-side JavaScript and, as such, is a more quick and dirty option than the Timeline API, which necessitates server-side calls.


That said, the Timeline API is far more powerful in that you can configure custom events to appear on contact timelines and enable other users in your account to segment on these events in HubSpot lists and workflows rather than just the "Last login date" custom property alone.


Please let me know if I can clarify further.

Isaac Takushi

Associate Certification Manager