Portal id 5664924, website www.fauxwoodbeams.com. Hubspot script is loaded on the top of the page.
I am trying to solve a problem of most contacts and deals being attributed to “offline source”, which looks unrealistic and prevents us from having a marketing overview.
Most of our contacts are added via API. Customers are asked to provide their email address when they begin checkout. That email is then used to look up their contact id in Hubspot using API, or, if contact was not found, create a new contact, also via API. The id of the contact is then associated with a new deal, which is also created in Hubspot via API.
The problem we face is the following: because most contacts are created via API, they are always being attributed to “Offline source”, even though all of them visit the website prior to creation, and thus need to be attributed to other sources (PPC, organic search, etc.).
I spent a decent amount of time researching this and reading all sorts of threads and documentation. One thing I found was this article: Solving “Offline Sources” Problem In HubSpot And Fixing Attribution, which suggests the HS script should always be at the top. Even though I placed the script to the top, I added “
async defer
” attributes to it for the sake of increasing page loading speed. So now I removed it.
Second thing I came across is “Identify a visitor” feature described here: https://developers.hubspot.com/docs/methods/tracking_code_api/identify_visitor
What I did was I added the following lines of code into the script that executes when customer clicks “Proceed to checkout” button:
var _hsq = window._hsq = window._hsq || [];
_hsq.push([“identify”,{ email: memb_email }]);
Where “
memb_email
” is the variable that holds the email address customer typed in.
My question here is really: am I moving in the right direction? There won’t be immediate results, but I would like to know, if, from Hubspot tech’s point of view, these steps would help me solve the problem.