Cookie banner is not showing on external website

Hi there,

I have implemented the tracking script to enable a configured Cookie banner, but the banner doesn’t show on load.

  • The website is built in Nuxt and served on Vercel.
  • I have added a banner in HubSpot > Settings > Privacy & Consent > Cookies tab for the domain name: divotion.com
  • I have added the script with id=“hs-script-loader” to the head
  • I have added an additional button with id=“hs_show_banner_button” to trigger the banner manually.
  • The script is loaded and can be called from the console.

When I push events manually via the console I get:

_hspb_loaded
> true
_hspb_ran
> true
_hsp.push(['revokeCookieConsent']);
> true
_hsp.push(['showBanner']);
> false

I’m at a loss on how to resolve this issue. There’s not much else I can configure in the HubSpot settings.

Can anyone help?

With regards, Bart

Hi @BGW-Divotion,

If the manual trigger (‎`showBanner`) returns ‎`false`, it might mean the banner logic believes it has already been shown or that consent is set. Have you tried opening it in incognito?

Additionally, check if any Content Security Policy (CSP) headers could be blocking HubSpot scripts or resources.

@BGW-Divotion - Did you add the embed code as suggested by HubSpot? Is anything blocking the HubSpot script?

Hi @BGW-Divotion

Since the script loads and revokeCookieConsent works but showBanner returns false, this could be related to how Nuxt handles page rendering. Try making sure the HubSpot script runs only on the client side, like:

if (process.client) { 
 // Load the script here 
} 

Or try placing the script just before </body> instead of in <head>.

Also, double-check that the banner is published and linked to the correct domain in HubSpot.

If it still doesn’t work, it’s best to connect with the HubSpot support team to check for any backend issues.

All good ideas! Thanks for answering.

The Consent Banner for the domain is active / enabled

We don’t use CSP headers, for as far as I can see.

Loading the script looks fine to me.

It clearly loads and runs fine, since it loads another 4 javascript files:

  1. https://js.hscollectedforms.net/collectedforms.js
  2. https://js.hs-analytics.net/analytics/1751380500000/7481203.js
  3. https://js.hs-banner.com/v2/7481203/banner.js
  4. https://js.hs-banner.com/v2/cf-location

I’m currently loading the script in the head of the default nuxt page template:

<template>
	<div>
		<Header />
		<nuxt />
		<Footer />
	</div>
</template>

<script lang="ts">
import { Vue, Component } from "nuxt-property-decorator";

@Component({
	head() {
		return {
			htmlAttrs: {
				class: this.$theme.theme,
			},
			bodyAttrs: {
				class: this.$route.name ? this.$route.name : "",
			},
			script: [
				{
					id: "hs-script-loader",
					src: "//js.hs-scripts.com/7481203.js?businessUnitId=2302186",
					async: true,
					defer: true
				},
			],
		};
	}
})
export default class Default extends Vue {}
</script>

I’m out of ideas, other than loading the script how @Balaji_Mavlers1 described.

My next step would indeed consist of contacting Hubspot support.