We have the enterprise level of Hubspot, and I've been trying to use Behavioural Events > 'clicked element' to be able to track clicks on a non-Hubspot-hosted website. The Hubspot tracking code is already installed on said website.
Basically I want to track clicks the way GTM does, but I want everything reported in Hubspot, so I wanted to see if there's a way to do it all within the Hubspot platform.
Unfortunately, it has not been working. Here's what we've done so far:
1. Created and added a Click ID to the website pages where we want to track the clicks
2. Added the ID to the Element Selector in Hubspot under 'ID'
Am I missing a step? Because there are no clicks being reported and I know people are clicking on those links.
@Holly_Thomson - I can definitely understand what you are trying to get at. How easily that will be to surface in a report for web analytics may be something that requires a deeper dive.
At first glance a couple things. First, I would always recommend removing spaces from IDs when you make them. Spaces in names are a bad practice on the web. Use of capitalization, hyphens, or underscores is a much better practice. In most names like a file name it is converted to the encoded "%20". It is even recommended against in HTML docs: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id .
The next thing I would consider moving the ID to the a element. In your instance, the A element inside of the LI has padding added to it, so what may be getting picked up is the A element being clicked and not the containing LI element.
See if one of those steps work first and we can go from there.
We were able to resolve the issue! We had just put one word initially as the click ID, but even though it was one word, there were still spaces, as you indicated Ben. So we made a new click ID with a few words, using underscores. And that solved it. Thank you very much for your help!
We were able to resolve the issue! We had just put one word initially as the click ID, but even though it was one word, there were still spaces, as you indicated Ben. So we made a new click ID with a few words, using underscores. And that solved it. Thank you very much for your help!
@Holly_Thomson - I can definitely understand what you are trying to get at. How easily that will be to surface in a report for web analytics may be something that requires a deeper dive.
At first glance a couple things. First, I would always recommend removing spaces from IDs when you make them. Spaces in names are a bad practice on the web. Use of capitalization, hyphens, or underscores is a much better practice. In most names like a file name it is converted to the encoded "%20". It is even recommended against in HTML docs: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id .
The next thing I would consider moving the ID to the a element. In your instance, the A element inside of the LI has padding added to it, so what may be getting picked up is the A element being clicked and not the containing LI element.
See if one of those steps work first and we can go from there.
Based on what you describe it should be working. Would you be able to share a link of a sample page?
A few thoughts are going through my mind at the moment without seeing the code:
There could be a code issue on the page preventing the script from working as it should.
Depending on your cookie setup, if cookies are not accepted Hubspot won't load so if they are not already Hubspot cookies need to be made essential on your site to ensure all clicks are tracked.
Hi Ben, thank you for your response. We want to track clicks on the Driver Login and Fleet Manager Login at the top left of the page: https://www.fossnational.com/
I can look into the cookie situation and see if that yields anything. Thank you!
Hi David, it's because those portals are for existing clients. When the clients login to those portals, they are taken to a separate website entirely, and therefore, we can't track their movements anymore. So I just want to have an idea of how many people are coming to the website to login to those portals, vs how many people come for information or other reasons.
Ahhh very valid! In that case, I would just recommend looking at the GA of the website that it leads to, and see how many came from that source. That would be a lot easier!
Hi David, yes I could try that if this doesn't work. I was just trying to keep all the reporting in Hubspot since GA and Hubspot have different methods of reporting. Thank you!