APIs & Integrations

globello
Teilnehmer/-in

Checkbox option for cookie tracking via form

Hello friends

In a scenario where the visitor has not accepted cookie tracking.
Subsequently he sends a contact form, we want to insert a checkbox option (checked) or after he clicks submit the form will automatically accept the cookie tracking.

I don't understand if there is a possibility via JavaScript or GTM to enable this tracking.

Note: There will be a legal text that when submitting the form he will be aware of the tracking.

0 Upvotes
6 Antworten
Kevin-C
Trendsetter/-in | Partner
Trendsetter/-in | Partner

Checkbox option for cookie tracking via form

Hey @globello and Thanks for the tag @dennisedson 

 

I'm not 100% sure about this but you could  add an event listener to the checkbox, and on click set the cookie. Maybe something like this:

 

 

 

 

$('#formId').on('click', 'input.classId', function(e) {
  _hsq.push(['revokeCookieConsent']); //clear cookies
  document.cookie = ' __hs_opt_out=no; __hs_initial_opt_in=true;' //set cookies
});

 

 

 

 

Kevin Cornett - Sr. Solutions Architect @ BridgeRev
globello
Teilnehmer/-in

Checkbox option for cookie tracking via form

Hi Kevin!

Thanks... 😁

 

Wonderful, I will test, thank you very much!

I thought about using the standard HubSpot form, I will hire the paid version.
I have a question, can I check the default GDPR option?

0 Upvotes
Kevin-C
Trendsetter/-in | Partner
Trendsetter/-in | Partner

Checkbox option for cookie tracking via form

Hey @globello 

 

From my understanding "pre-checked" GDPR consent checkboxes ARE NOT considered valid. See this article

Kevin Cornett - Sr. Solutions Architect @ BridgeRev
dennisedson
HubSpot-Produktteam
HubSpot-Produktteam

Checkbox option for cookie tracking via form

Thanks for flagging @Kevin-C !

0 Upvotes
globello
Teilnehmer/-in

Checkbox option for cookie tracking via form

1. Yes

2. Yes

3. Yes

 

It would be an option to work with remarketing with that visitor who accessed the landing page.

0 Upvotes
dennisedson
HubSpot-Produktteam
HubSpot-Produktteam

Checkbox option for cookie tracking via form

Hi @globello ,

Just want to make sure that I am clearly reading the scenario

  1. User goes to site and declines cookie tracking
  2. User fills out form with a checked checkbox option and clicks submit
  3. By clicking, user agrees to cookie tracking and tracking is enabled

First, I would ask why there is a checkbox if just submitting the form enables cookie tracking.  I would view it as if when I uncheck the box, I would not be tracked. 

Secondly, I would careful review any regulations on this.  I am not well versed on EU regulations so am unsure if this would be OK.

 

 

@Jsum , @Anton , @Kevin-C   do you all have thoughts on this? 

 

Thanks!

 

0 Upvotes