How to Identify Contacts Who Downloaded a File from a HubSpot Page

If you are an avid reader of our blog, you will notice that our main focus is currently on 3 things: security, performance, and marketing. Marketing is an extremely vast domain and our clients always have exciting challenges for us. For example, we just finished working on a huge HubSpot-Tealium-Constant Contact integration project. Essentially, the project consisted of identifying visitors to the website from their HubSpot profile (using the hubspotutk), getting their reading habits (audiences) from Tealium, and then dynamically subscribing them to newsletter lists in Constant Contact that match their reading habits. It was a tremendously exciting project and we will have a separate post about it in the near future.

Going back to the title of this article, a major client of ours with a very high traffic Joomla site asked us if they can track who downloaded a certain (zip) file from a HubSpot page. They essentially wanted to know the names of those who downloaded the file from that page. A thorough research about the subject revealed that HubSpot do not have this functionality built-in, which is weird, considering that HubSpot is a major player in the online marketing world and is used by many Fortune 500 companies out there. So, we had to implement this functionality, but how?

We quickly thought it out and figured out (a very smart) workaround:

  • We create a PHP file called hubpsot-who-downloaded.php on the Joomla website (say under a scripts folder).
  • The file hubpsot-who-downloaded.php will take the hubspotutk of the person who tried to download the zip file as a _POST parameter. The file will then send an API request to HubSpot asking it about the email of the person with that hubspotutk. Once that information is received from HubSpot, it will be saved in a MySQL table called hubspot_who_downloaded. The aforementioned table will have 3 fields: the id of the row, the hubspot token (hubspotutk or hutk), and the email of the person.

  • We then, on click of the file in HubSpot, add a JS script that will send the hubspotutk to the hubpsot-who-downloaded.php file using an AJAX POST request (note that the hubspotutk is always stored in the cookies).

  • That’s it!

We implemented the above method immediately, and it worked like a charm on first try! We were impressed and so was the client. Note that an alternative method, if you don’t want to use a MySQL database, is to create a new property (such as downloaded_file), have it default to “No”, and then update it to “Yes” from the API for those who actually download the file.

We hope that you found this post informative. Now if you need help with the implementation then just contact us. Our experience in HubSpot and its API is unquestionable, our work is super clean, and our fees are ultra affordable!

No comments yet.

Leave a comment