GDPR

CMarritt
Contributor

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

SOLVE

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
0 Upvotes
1 Accepted solution
CMarritt
Solution
Contributor

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

SOLVE

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 String $tag tag name.
* @param String $handle handle.
*/
public function add_ignore_cookie_consent( $tag, $handle ) {
   if ( 'leadin-forms-v2' !== $handle )
      return $tag;
   return str_replace( ' src', ' data-cookieconsent="ignore" src', $tag );
}

 

Here's a video on how to do so 

 

View solution in original post

11 Replies 11
kvlschaefer
Community Manager
Community Manager

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

SOLVE

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:

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@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. 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


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!

CMarritt
Contributor

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

SOLVE

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 

0 Upvotes
JohnFletcher
Participant

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

SOLVE

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).

0 Upvotes
CMarritt
Contributor

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

SOLVE

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! 

0 Upvotes
JohnFletcher
Participant

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

SOLVE

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.

0 Upvotes
CMarritt
Solution
Contributor

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

SOLVE

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 String $tag tag name.
* @param String $handle handle.
*/
public function add_ignore_cookie_consent( $tag, $handle ) {
   if ( 'leadin-forms-v2' !== $handle )
      return $tag;
   return str_replace( ' src', ' data-cookieconsent="ignore" src', $tag );
}

 

Here's a video on how to do so 

 

DianaGomez
Community Manager
Community Manager

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

SOLVE

Hi @CMarritt

 

Thanks for sharing!

 

Best,

Diana


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!


¿Sabías que la Comunidad está disponible en Español?
¡Participa hoy en conversaciones en el idioma de tu preferencia,cambiando el idioma en tus configuarciones!
0 Upvotes
JohnFletcher
Participant

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

SOLVE

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

CMarritt
Contributor

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

SOLVE

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

0 Upvotes
HPreston
Member

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

SOLVE

I've followed the instructions here but still experiencing the issue with forms not appearing unless marketing cookies are accepted for 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?

0 Upvotes
CMarritt
Contributor

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

SOLVE

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

0 Upvotes