# CookieBot blocking HubSpot forms from loading unless statistics accepted (using wordpress)

**URL:** <https://community.hubspot.com/t/cookiebot-blocking-hubspot-forms-from-loading-unless-statistics-accepted-using-wordpress/56288>\
**Category:** GDPR\
**Tags:** marketing, forms\
**Created:** [May 5, 2022, 1:54pm UTC](https://community.hubspot.com/t/cookiebot-blocking-hubspot-forms-from-loading-unless-statistics-accepted-using-wordpress/56288 "2022-05-05T13:54:29Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![CMarritt](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/cmarritt/32/62359_2.png) [@CMarritt](https://community.hubspot.com/u/CMarritt)\
**Post date:** [May 5, 2022, 1:54pm UTC](https://community.hubspot.com/t/cookiebot-blocking-hubspot-forms-from-loading-unless-statistics-accepted-using-wordpress/56288/1 "2022-05-05T13:54:29Z")

</div>

## Basic details

- Wordpress Website
- CookieBot implemented using WP plugin
- HubSpot forms added using Shortcodes & HS plugin
- GTM is installed but neither HS or CookieBot is implemented via GTM - only plugins

## **The issue**

CookieBot is blocking our HS forms from loading, they are being tagged as ‘statistics’. We had previously fixed this by adding ‘data-cookieconcent=ignore’ to the **form script** however there has since been an update to either HS plugin, forms or WS and we are no longer able to do this.

We have Google Tag Manager installed but CB & HS are implemented via plugins, would implement them via GTM help this situation? Or just HS via GTM and using google consent mode

1. Do we need the HS plugin on WP for the forms to work correctly?
2. Would embedding the forms instead of using the shortcode help?
3. If 1 is no, should we deploy HS tracking code via GTM & embedding codes?

## Tried, tested and failed

- Changing the HS form cookie to necessary - this isnt GDPR compliant as the forms still track the user’s journey across the website
- Adding ‘data-cookieconcent=ignore’ for the HS tracking script - this isnt GDPR compliant as it would ignore all HS tracking

---

<div class="post-metadata">

**Author:** ![kvlschaefer](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/kvlschaefer/32/71076_2.png) [@kvlschaefer](https://community.hubspot.com/u/kvlschaefer)\
**Post date:** [May 6, 2022, 4:04pm UTC](https://community.hubspot.com/t/cookiebot-blocking-hubspot-forms-from-loading-unless-statistics-accepted-using-wordpress/56288/2 "2022-05-06T16:04:01Z")

</div>

Hi @CMarritt,

Thanks for reaching out to the Community, and for providing this helpful information!

I wanted to share some similar threads regarding HubSpot + GTM and Cookiebot:

- [Issue with HubSpot Forms not loaded in combination with Cookiebot and Tag Manager](https://community.hubspot.com/t5/GDPR/Issue-with-HubSpot-Forms-not-loaded-in-combination-with/m-p/395955)
- [Implementing 3rd party cookies](https://community.hubspot.com/t5/GDPR/Any-best-practices-on-how-to-implement-3rd-party-cookie-tools/m-p/354136)
- [Best practices for HubSpot + Cookiebot with GTM](https://community.hubspot.com/t5/GDPR/Looking-for-the-best-practice-for-HubSpot-Cookiebot-with-GTM-and/m-p/528366)

I also wanted to tag a couple of other users and internal contributors to see if they can share their experience with Cookiebot, GTM and HubSpot forms.

Hey @MatthewShepherd, @Aakar, [@jenni\_vere](https://community.hubspot.com/t5/user/viewprofilepage/user-id/91288), @jobfounda, @marcbergeraf, @Thomas-HyHyve do you have any tips for @CMarritt?

I also wanted to point out that you have access to our [Technical Support Team](https://help.hubspot.com/). I would recommend contacting them as they can provide real time assistance and get on a screen share. You can include this information from the original post so our technicians know which steps you’ve taken so far.

Best,

Kristen

---

<div class="post-metadata">

**Author:** ![CMarritt](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/cmarritt/32/62359_2.png) [@CMarritt](https://community.hubspot.com/u/CMarritt)\
**Post date:** [May 6, 2022, 4:12pm UTC](https://community.hubspot.com/t/cookiebot-blocking-hubspot-forms-from-loading-unless-statistics-accepted-using-wordpress/56288/3 "2022-05-06T16:12:22Z")

</div>

Hi Kristen,

Thank you for your reply!

After reading through the suggested posts in seems they are referring to a HubSpot website and ours is a WordPress site using HubSpot forms as a lead capture perspective

Any further help is greatly appreciated

---

<div class="post-metadata">

**Author:** ![JohnFletcher](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/johnfletcher/32/99678_2.png) [@JohnFletcher](https://community.hubspot.com/u/JohnFletcher)\
**Post date:** [July 13, 2023, 2:07pm UTC](https://community.hubspot.com/t/cookiebot-blocking-hubspot-forms-from-loading-unless-statistics-accepted-using-wordpress/56288/4 "2023-07-13T14:07:59Z")

</div>

Hi there, we are encountering the same problem. Did you ever manage to relove this issue (I know it is over year now, so sorry if you have forgotten it or moved on).

---

<div class="post-metadata">

**Author:** ![CMarritt](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/cmarritt/32/62359_2.png) [@CMarritt](https://community.hubspot.com/u/CMarritt)\
**Post date:** [July 13, 2023, 2:29pm UTC](https://community.hubspot.com/t/cookiebot-blocking-hubspot-forms-from-loading-unless-statistics-accepted-using-wordpress/56288/5 "2023-07-13T14:29:08Z")

</div>

Hi John, yeah we are using Wordpress and not HubSpot website builder, im not sure if this will help.

We got into contact with HubSpot Plugin developers and they suggested inputting some code into the plugin code. I believe they were implementing it into their next update. Let me know if youd like me to dig the emails out!

---

<div class="post-metadata">

**Author:** ![JohnFletcher](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/johnfletcher/32/99678_2.png) [@JohnFletcher](https://community.hubspot.com/u/JohnFletcher)\
**Post date:** [July 13, 2023, 2:40pm UTC](https://community.hubspot.com/t/cookiebot-blocking-hubspot-forms-from-loading-unless-statistics-accepted-using-wordpress/56288/6 "2023-07-13T14:40:15Z")

</div>

Hi yes that is how we are doing it as well, if you would be kind enough to dig out those emails that might be a terrific help. We have being scouring these boards but t o avail.

---

<div class="post-metadata">

**Author:** ![CMarritt](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/cmarritt/32/62359_2.png) [@CMarritt](https://community.hubspot.com/u/CMarritt)\
**Post date:** [July 13, 2023, 3:17pm UTC](https://community.hubspot.com/t/cookiebot-blocking-hubspot-forms-from-loading-unless-statistics-accepted-using-wordpress/56288/7 "2023-07-13T15:17:14Z")

</div>

I found the email, I’ve added a link at the bottom to the video they sent me as well. Fingers crossed!

Go to Tools \> Plugin File Editor

Select **HubSpot All-In-One Marketing - Forms, Popups, Live Chat**

At the right side select the file **leadin/src/class-pagehooks.php**

At the constructor add

_add\_filter( ‘script\_loader\_tag’, array( $this, ‘add\_ignore\_cookie\_consent’ ), 10, 2 );_

and then below the method  
_/\*\*  
\* Add the data attribute to forms script  
\*  
\* [@param](https://community.hubspot.com/t5/user/viewprofilepage/user-id/228859) String $tag tag name.  
\* [@param](https://community.hubspot.com/t5/user/viewprofilepage/user-id/228859) String $handle handle.  
\*/  
public function add\_ignore\_cookie\_consent( $tag, $handle ) {  
if ( ‘leadin-forms-v2’ !== $handle )  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return $tag;  
return str\_replace( ’ src’, ’ data-cookieconsent=“ignore” src’, $tag );  
}_

[Here’s a video on how to do so](https://8115262.fs1.hubspotusercontent-na1.net/hubfs/8115262/Screenshare%20-%202022-05-17%2010_00_39%20AM.mp4)

---

<div class="post-metadata">

**Author:** ![JohnFletcher](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/johnfletcher/32/99678_2.png) [@JohnFletcher](https://community.hubspot.com/u/JohnFletcher)\
**Post date:** [July 13, 2023, 4:08pm UTC](https://community.hubspot.com/t/cookiebot-blocking-hubspot-forms-from-loading-unless-statistics-accepted-using-wordpress/56288/8 "2023-07-13T16:08:11Z")

</div>

Thank you for that I will forward it to our Dev team

---

<div class="post-metadata">

**Author:** ![CMarritt](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/cmarritt/32/62359_2.png) [@CMarritt](https://community.hubspot.com/u/CMarritt)\
**Post date:** [July 13, 2023, 4:13pm UTC](https://community.hubspot.com/t/cookiebot-blocking-hubspot-forms-from-loading-unless-statistics-accepted-using-wordpress/56288/9 "2023-07-13T16:13:31Z")

</div>

Make sure to rescan with CookieBot after they’ve completed the changes! Ours is still working a year on so fingers crossed

---

<div class="post-metadata">

**Author:** ![HPreston](https://avatars.discourse-cdn.com/v4/letter/h/d07c76/32.png) [@HPreston](https://community.hubspot.com/u/HPreston)\
**Post date:** [June 20, 2024, 7:39am UTC](https://community.hubspot.com/t/cookiebot-blocking-hubspot-forms-from-loading-unless-statistics-accepted-using-wordpress/56288/10 "2024-06-20T07:39:00Z")

</div>

I’ve followed the instructions here but still experiencing the issue with forms not appearing unless marketing cookies are accepted for [Contact Livewell Vending - Coffee and Vending Solutions](https://www.livewellvending.co.uk/contact) . I edited the class-pagehooks.php at this location: /wp-content/plugins/leadin/public as outlined here. Is there an update I need to be aware of?

---

<div class="post-metadata">

**Author:** ![CMarritt](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/cmarritt/32/62359_2.png) [@CMarritt](https://community.hubspot.com/u/CMarritt)\
**Post date:** [June 24, 2024, 3:02pm UTC](https://community.hubspot.com/t/cookiebot-blocking-hubspot-forms-from-loading-unless-statistics-accepted-using-wordpress/56288/11 "2024-06-24T15:02:27Z")

</div>

Hi Friend, I just checked on your site and I can see your form before I accept and when I only accept necessary cookies

---

<div class="post-metadata">

**Author:** ![DianaGomez](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dianagomez/32/48035_2.png) [@DianaGomez](https://community.hubspot.com/u/DianaGomez)\
**Post date:** [July 17, 2023, 3:51pm UTC](https://community.hubspot.com/t/cookiebot-blocking-hubspot-forms-from-loading-unless-statistics-accepted-using-wordpress/56288/12 "2023-07-17T15:51:49Z")

</div>

Hi @CMarritt,

Thanks for sharing!

Best,

Diana
