# Help automatically triggerring the cookies-by-category selection modal

**URL:** <https://community.hubspot.com/t/help-automatically-triggerring-the-cookies-by-category-selection-modal/145553>\
**Category:** CMS Development\
**Tags:** enterprise\
**Created:** [January 29, 2026, 7:30pm UTC](https://community.hubspot.com/t/help-automatically-triggerring-the-cookies-by-category-selection-modal/145553 "2026-01-29T19:30:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SBarkley](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@SBarkley](https://community.hubspot.com/u/SBarkley)\
**Post date:** [January 29, 2026, 7:30pm UTC](https://community.hubspot.com/t/help-automatically-triggerring-the-cookies-by-category-selection-modal/145553/1 "2026-01-29T19:30:48Z")

</div>

Hi all, my customer wants to automatically trigger the **cookies-by-category selection modal** on page load for a specific “Privacy Preferences” page, similar to HubSpot’s own privacy site. They are looking to provide a better user experience by skipping the initial consent banner and going straight to granular opt-out settings.

**Roadblock:** Standard `_hsp.push(['showBanner'])` API calls are not firing correctly on load, even with a `setTimeout` delay. As the request involves custom JavaScript implementation to modify standard banner behavior, it has been deemed **out of scope** for Technical Support.

I’m posting on her behalf. Is someone able to help her?

---

<div class="post-metadata">

**Author:** ![RubenBurdin](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rubenburdin/32/75212_2.png) [@RubenBurdin](https://community.hubspot.com/u/RubenBurdin)\
**Post date:** [January 29, 2026, 9:23pm UTC](https://community.hubspot.com/t/help-automatically-triggerring-the-cookies-by-category-selection-modal/145553/2 "2026-01-29T21:23:04Z")

</div>

Hi @SBarkley ,

This is a tricky one because the `_hsp` object often isnt fully initialized when your page script runs, even with a setTimeout. The timing depends on when HubSpot’s tracking script loads and initializes the cookie banner functionality. What usually works better is listening for the HubSpot script to be ready before calling the banner method. Something like this approach tends to be more reliable:

```lia-code-sample
var checkHsp = setInterval(function() {
 if (typeof _hsp !== 'undefined' && _hsp.push) {
 _hsp.push(['showBanner']);
 clearInterval(checkHsp);
 }
}, 100);

```

You might also want to try `_hsp.push([‘revokeCookieConsent’])` first if the user has already consented, as `showBanner` sometimes wont fire if consent was previously given. Theres some documentation on the cookie banner API here ([Accounts Dashboard | HubSpot](https://developers.hubspot.com/docs/api-reference/legacy/tracking-code-v1/revoke-cookie-consent) ) ([Consent banner API - HubSpot docs](https://developers.hubspot.com/docs/api-reference/cookie-banner/cookie-banner-api) )

Another thing to check is whether the page has the cookie banner enabled in page settings. If its disabled for that specific page the API calls wont do anything regardless of timing.

If none of that works, some teams have resorted to triggering a click event on the cookie settings link element directly. Note: The content is based on my personal experience and was refined using AI for better clarity.

Hope this gets your customer unstuck!
