I have a website, which I am now trying to overhaul by creating my own cookie consent banner.
How exactly can I simulate hubspot banner clicks or to set hubspot cookie consents for marketing/analytics/essentials programmatically?
The given HubSpot documentation has not provided a way to set specific cookie consents, which is why I am thinking of emulating hubspot consent banner clicks. If there is an easier way, feel free to share it.
While it may not answer all the questions, it gives some javascript examples on how cookies can be enabled/disabled, as well as getting privacy consent status per category (analytics, advertisement, functionality).
✔️ Did this post help answer your query? Help the community by marking it as a solution.
@WinstonN An easier way would be to also look at cookie banner solutions that are much simpler to implement. They're called consent management platform (CMP). You can start with free CMP solutions first for instance. Just sharing this out there. Hope this helps, and good luck!
I know it's been a few months, but you can look into other cookie banner solutions that can do what you're looking for in a much simpler way. As you scale and grow your website, and with new legislations being passed in the US and around the globe, you will need a more robust solution to respect your users consent everywhere, called consent management platform (CMP). You can start with free CMP solutions first too. Hope this helps!
Implementing your cookie consent mechanism with HubSpot requires careful consideration due to privacy laws like GDPR. While you can use JavaScript to interact with HubSpot's cookie settings, simulating consent clicks or setting consents directly isn't straightforward due to the legal implications involved. This is why there are not any HubSpot official documents or solutions for this type of project. Ensure your custom consent process complies with all relevant laws by consulting legal experts. This step is crucial to maintain compliance and uphold user privacy standards.
Best,
Jaycee
Join us on March 27th at 12 PM for the Digital Essentials Lab, an interactive session designed to redefine your digital strategy!
Engage with expert Jourdan Guyton to gain actionable insights, participate in live Q&A, and learn strategies to boost your business success. Don't miss this opportunity to connect and grow—reserve your spot today!
Did you know that the Community is available in other languages? Join regional conversations by changing your language settings !
Hi @Jaycee_Lewis ! I was wondering if there will be API calls that allow us to SET, instead of READ only consents, or if there is any workaround. I am already using the consent banner API, e.g. to fire scripts or allow external embeds based on consent choices of the user. However, in cases where we are required to use an external CMP system like usercentrics, I'd need to remote-control the HubSpot consents. This would require an API call to SET (instead of read, only) the consents for each category in HubSpot programmatically via JavaScript based on the choices in the external CMP.
My workaround for the classic HubSpot Banner (with option allow/deny) was to hide the HubSpot banner and click on the appropriate Button on the hidden HubSpot Banner using Javascript.
But I need to switch to the HubSpot Banner that supports different categories for some of our projects, because I need to control HubSpot tracking (stats) and ad pixel integrations (marketing) separately without showing the HubSpot Banner (because we need to show the external CMP, only). I was wondering if there is any workaround for this purpose or feature update, as solving this by programmatically with JS by clicking into the categories of the hidden HubSpot banner would require a lot of Code and would be error-prone.
do you have any suggestion on how we could integrate HubSpot with other leading CMP systems like usercentrics while beeing able to use integrated pixels (like Google Ads) within HubSpot. We need this, so our clients may continue to use HubSpot's integrated ads features. I've studied all documentation and I know HubSpot and usercentrics inside out - it's easy to deny or allow all HubSpot Cookies with some workarounds like simulated clicks etc. But I didn't find any stable way to control the opt-in for a specific category like marketing (which controls whether e.g. Google Pixel is loaded), because there are no functions like setConsent in the HubSpot consent API. We need usercentrics to handle this amount of consents (16 regions, 30 languages, pre-defined service templates), this is why we can't switch to the HubSpot banner system.
Is there any chance on allowing us to set HubSpot consent categories via API?
I've seen that your scripts post settings via a click on "save settings"
I do know that in order to be in accordance with privacy laws like the GDPR, many regulations have to be complied with, but I am already working together with legal experts to follow these.
I am simply asking for a small example on how to simulate those clicks. I have asked the Hubspot Support, but they told me that I would be better off at finding a solution, if I post my issue in the HubSpot community.
Since I want to use a custom developed consent banner, I would need to find an implementation of this, because I want to use HubSpot cookies on my website.
Do you have an example of a javascript script, which could simulate hubspot consent clicks?
Hope you (or anyone else) can help me out with my problem!
just to update this thread: HubSpot has introduced a new "SET" method, that allows you to set consents by category. This means, that you can use a 3rd party consent management and map those consents to HubSpot consents. The cookie banner API has been updated to support SET like so:
I do know that in order to be in accordance with privacy laws like the GDPR, many regulations have to be complied with, but I am already working together with legal experts to follow these.
I am simply asking for a small example on how to simulate those clicks. I have asked the Hubspot Support, but they told me that I would be better off at finding a solution, if I post my issue in the HubSpot community.
Since I want to use a custom developed consent banner, I would need to find an implementation of this, because I want to use HubSpot cookies on my website.
Do you have an example of a javascript script, which could simulate hubspot consent clicks?
Hope you (or anyone else) can help me out with my problem!
While it may not answer all the questions, it gives some javascript examples on how cookies can be enabled/disabled, as well as getting privacy consent status per category (analytics, advertisement, functionality).
✔️ Did this post help answer your query? Help the community by marking it as a solution.