Marketo Embed forms not allowing submission when cookies rejected

snic1
Level 1

Marketo Embed forms not allowing submission when cookies rejected

Hi All, 

 

I am struggling to figure out how to fix this issue. For context I am not a web developer. We host our website through Craft CMS, and we utilize a tool called CookieYes for cookie consent. 

 

I discovered today that when I reject all cookies on our website, I am unable to submit any of our forms. I go to click on the submit button & nothing happens. When I go and accept all cookies, the forms work just fine. 

 

We embed our Marketo forms in Craft CMS in the Marketo form field. The script is copied directly from Marketo & pasted in. 

 

It doesn't seem like this was previously an issue, but now suddenly is. I am struggling to figure out how to get this fixed & avoid any future issues. Is there anyone that can help with this? Marketo Support is unable to help as the forms are hosted on non-Marketo pages & are pointing to a custom code issue with our website. 

5 REPLIES 5
SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo Embed forms not allowing submission when cookies rejected

It's impossible to answer this without a link to your page!

snic1
Level 1

Re: Marketo Embed forms not allowing submission when cookies rejected

Hi Sanford! 

 

Here is a link to the "contact us" page, but we are seeing this across pages with Marketo forms. 

https://www.alloy.com/contact

 

I thought I solved the issue by moving the marketo cookie to"necessary" cookies in CookieYes categorization, and that seemed to solve the issue. But our forms are not working again today if you reject our cookies. 

SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo Embed forms not allowing submission when cookies rejected

Still has nothing to do with the Marketo form itself. (Noting this because FUD spreads very easily from Nation threads, and we hear people claim “they heard about” probs w/Marketo forms + cookies.)

 

You’re adding in Clearbit’s Marketo Forms JS, which deliberately disables the native submittability of the Marketo form to replace it with its own enrichment logic (and not particularly elegantly).

 

But you’re allowing CB to load partially when the person rejects cookies — neither completely allowing it nor completely blocking it. So CB still loads, which is enough to disable the form. But CB doesn’t actually function beyond that, so it never reenables the form.

 

You need to completely stop CB from loading if cookies are rejected.

snic1
Level 1

Re: Marketo Embed forms not allowing submission when cookies rejected

Hi Sanford, 

 

Thank you for taking a look - I really appreciate it! 

 

Curious to understand where you saw Clearbit as the issue - I want to know where to look if the issue persists. 

 

Also just so I understand, how can I/do I stop Clearbit from loading is cookies are rejected? Unclear where to make this update. 

SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo Embed forms not allowing submission when cookies rejected


Curious to understand where you saw Clearbit as the issue - I want to know where to look if the issue persists.

In the Clearbit JS loader you can see the button click’s default action (that is, submitting the form) is aborted using preventDefault():

 

    "g4bq": [function(require, module, exports) {
        "use strict";
        function e(e, t) {
            var n = document.createElement("script")
              , r = new URL(e)
              , o = window.location.pathname;
            r.searchParams.set("page_path", o),
            n.setAttribute("src", r.toString()),
            t && (n.onerror = t),
            document.body.appendChild(n)
        }
        function t(e) {
            e.preventDefault(),
            e.stopPropagation()
        }

 

 


Also just so I understand, how can I/do I stop Clearbit from loading is cookies are rejected? Unclear where to make this update. 

I don’t use the CookieYes library so couldn’t tell you — usually there’s a way to change the script type to a data block, like <script type="conditionally/loaded" class="enrichment">  so that way the real script won’t be injected at all unless the matching cookie type is accepted. Your JS dev should be able to figure that out quickly.