HubSpot Community Blog

TomM2
by: Key Advisor | Partner
Key Advisor | Partner

How HubSpot works with cookies and why they’re important.

Cookies! Or as we in Ireland like to call them, biscuits. 

 

Cookies are standard practice in websites these days, and are a huge part of identifying contact activity in HubSpot. But how do they work in HubSpot? And why do I have all of these “direct traffic” contacts in my account? 

In this article I’m going to go through how HubSpot cookies get from a browser to a contact record, and how HubSpot forms uses these. 

 

In the beginning, there was a tracking code. 

 

The HubSpot tracking code is essential to begin tracking any analytics within HubSpot. This should be embedded on any pages you want to be tracked in HubSpot. If you’re using the HubSpot CMS this is automatically included in all pages, if you’re using an external site, you need to ensure you embed this into your site. Once embedded and set up, this will automatically drop a cookie on a visitor’s browser when they visit your site (unless your privacy policy dictates otherwise). 

As soon as a visitor gets a cookie, they are assigned a unique ID. This begins logging web activity across your site, such as page views, CTA clicks, Event clicks and any other tracked information from HubSpot. From the drop, there is no way for HubSpot to “identify” the contact, they will simply be given a unique ID to log their tracking information. This is where forms come in. 

 

A HubSpot form does two things for new contacts:
1. It allows them to enter their information to create a contact in your system.

  1. It associates that anonymous cookie with this new contact record, along with all previously tracked analytics information. 

 

TomM2_3-1690808032770.png

 

From there, we can associate that dropped cookie with the new or existing contact record within HubSpot. Meaning we can effectively track them via their contact record and deliver any personalization based on their contact record to them (such as personalization tokens or list membership smart content). 

 

So, can the cookie track contacts everywhere?

 

In short, no. Cookies are domain and browser specific. This means if a contact submits a cookie on their work browser, then on their way home goes onto their personal browser on their phone and visits your website once again, they will receive a new cookie and be treated as a brand new visitor, until they submit a form again on that browser. 

If a visitor clears their cookies or uses private browsing they will also receive a new cookie and be recognised as a new visitor. 

 

If they submit a form on that new browser, with the same email address, HubSpot will automatically associate this new cookie with the existing contact record, allowing that browser to now be targeted for personalization too. 

 

 

Why am I seeing my contacts always overwrite? 

 

This is one of the most common issues that comes up with HubSpot forms. As we saw earlier, when a form is submit it submits the information included in the fields along with the cookie and it’s relevant tracking information. By default, this causes the form to associate all that information, including the submit fields, with the existing contact record which already has that cookie.

In a lot of situations this is unwanted. For example, if I had a tablet setup at a conference booth for sign-ups, this would mean every single sign-up would append to a single contact record. No ideal! 

 

So what can be done? 

 

This is where the feature to “always create contacts for new email addresses” comes in. With this setting enabled, when a cookie is already associated with a contact but the email address does not match the existing contact’s email, it will create a new contact instead of appending the information to the existing contact record. 

 

Sounds great right? But “why wouldn’t I always just use this?” I hear you ask! Well a lot of reasons. 

Most of these stem from the fact that a cookie is a 1:1 relationship with the browser. It’s not “smart”, it cannot detect who is sitting behind the keyboard, it simply just logs activity on that browser. This means while a new contact will be created, no cookie will be associated with them. The original cookie will still be associated with the original contact record along with any analytics information. 

Let’s take a look at what this might look like. 

 

Cookie Path.png

 

Cookies can only exist on one contact record within Hubspot. If the same cookie existing in both contact records, then we would see all analytics for both users on the browser log to both records, which would introduce its own set of problems. 

 

With this in mind, this also explains why progressive fields are disabled with this feature enabled. If they were enabled, the second visitor (John in this case) would not be shown the initial information asked for within the form and would only be submitting information to update the original visitors (Julie) information. 

 

With this in mind, the question of “why don’t I always enable this feature” because a lot clearer. Both sides of this have their pros and cons. There’s no right or wrong answer to this, the best question to ask yourself is what this form is for, what is the primary goal of capturing this information and is it more important to have consistent contact record creation, or consistent tracking information for contacts after they submit this form? 

Your automation, list segmentation and engagement points will help inform this. For some situations, if you do see the form being used on the same machine multiple times, this can definitely be a no-brainer decision. 

 

That’s the way the cookie crumbles

It can be important to remember that analytics tracking isn’t magical and will always have considerations and limitations. With this in mind, hopefully you feel more enabled to push your CRM to make even more of an impact to your business! 

 

Happy HubSpotting! 

5 Comments