SOLVED

Re: Unbundled script to pre-fill/hide consent fields on forms?

Go to solution
CPARobertM
Level 1

Unbundled script to pre-fill/hide consent fields on forms?

Hi,

 

I wondered if anyone's come across this scenario before who might be able to help:

We use a checkbox to log consent for marketing emails on our forms. Form pre-fill being what it is, a lot of our marketing activity serves to remove marketing consent, i.e. if someone in the database with consent or a "legitimate interests" lawful bases fills out a contact form and doesn't check the consent box. Furthermore, we require cookie/tracking consents which means things with marketing functions like the Munchkin code are not loaded consistently.

 

In theory we can - if we know a person has given consent, or has a "legitimate interests" lawful basis (both are independently defined in their own respective fields) - hide the consent field and information on the form. This could be managed using a standalone script/cookie which we wouldn't need cookie consent for.

 

But that's as far as I've got without a serious background in web development, so I wondered if anyone had encountered a similar issue in the past and a: built a method that works, b: thought up a better solution?

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Unbundled script to pre-fill/hide consent fields on forms?

If I'm understanding your situation correctly, you don't need custom code for this. (I assume that's what you meant by "unbundled script" — FYI, bundling has a specific and different meaning when it comes to JS, so that's kind of confusing!)

 

Since you have a Legitimate Interest field, you can add that to the form as a Hidden field and use Visibility Rules to determine whether the other consent fields are present on the form at all. Fields that aren't present on the form due to VRs are not submitted to the server at all so, you do not have to worry about those consents being set to false.

View solution in original post

2 REPLIES 2
SanfordWhiteman
Level 10 - Community Moderator

Re: Unbundled script to pre-fill/hide consent fields on forms?

If I'm understanding your situation correctly, you don't need custom code for this. (I assume that's what you meant by "unbundled script" — FYI, bundling has a specific and different meaning when it comes to JS, so that's kind of confusing!)

 

Since you have a Legitimate Interest field, you can add that to the form as a Hidden field and use Visibility Rules to determine whether the other consent fields are present on the form at all. Fields that aren't present on the form due to VRs are not submitted to the server at all so, you do not have to worry about those consents being set to false.

CPARobertM
Level 1

Re: Unbundled script to pre-fill/hide consent fields on forms?

Thanks for the answer Sanford - good to know re. unbundled, I was using the data protection terminology (consents/methods of processing are described as "unbundled" when they are split into granular pieces/options for each type of data processing, and "bundled" when lumped together as one all-or-nothing option).

 

Sorry for the confusing language. AFAIK using a hidden field and visibility rules would work in the circumstance where forms are pre-filled, which occurs when the person loads the page with mkt_tok parameter. So out-of-the-box that won't allow me to pre-fill most forms (hence I was thinking about custom code to work around this).

 

That said, I just found your blog post which looks like a much more robust solution to the underlying pre-fill issue, so could still use VRs reliably.

 

Cheers!