Finsweet cookie consent not working

Hello,
I need help.

https://preview.webflow.com/preview/badsites?utm_medium=preview_link&utm_source=dashboard&utm_content=badsites&preview=92779a83bf503383dca58993145f2ebe&workflow=preview


Hey @lionel.wassilowsky! I see a couple of issues with the setup that may prevent it from working as it should.

Here are some I have spotted so far:

  • You have two fs-consent_component elements, but only one has the required fs-consent-element = internal-component, this being the fs-consent_componen-4 element which is empty. All consent elements, besides the preferences button, should be children elements of this element.
  • You are missing the fs-consent-element = banner on your published site, although you have set it correctly on Webflow as far as I can see. You can see in the screenshot below the only match for this element is in the style tag
  • I also see more elements missing from the setup :thinking:

I think the best solution would be to remove the current elements and style to start over.

Could you do so and let me know if you are still having issues?

Hello Luis,
thanks for your help.

I deleted all the styles, exept for these four, i cant delete them somehow. I created the consent again from scratch and didn’t style it.

Bildschirmfoto 2024-10-09 um 22.57.36

Still didn’t work, but after a lot of trial and error i decided to test if a simple script as hello world would work, and it does.

<!-- This script is managed by Finsweet Cookie Consent -->
<script fs-consent-categories="essential" fs-consent-scripttype="text/javascript" type="fs-consent">
 document.write("Hello, World!");
console.log("Hello, World!");
</script>

https://www.premiumseite.com (no hello world)

As far as i am concerned, this means the scripts aren’t being activated by finsweet properly,

I dont understand.
Also created a new project, and ran into the same issues with my scripts. Without finsweet they work just fine!

I am completely lost here, even if you don’t have a solution, let me know what you think.

might be related to this?

Could it be that this is only meant for external scripts?
i just discarded scripts like this:

<script>
document.addEventListener('DOMContentLoaded', function() {
    // Function to trigger click on element with class "wistia_click_to_play"
    function clickWistiaPlay() {
        const wistiaPlayButton = document.querySelector('.wistia_click_to_play');
        if (wistiaPlayButton) {
            wistiaPlayButton.click();
        } else {
            console.log('Element with class "wistia_click_to_play" not found');
        }
    }

    // Check if the device is desktop or tablet (width greater than or equal to 768px)
    if (window.innerWidth >= 768) {
        // Add click event listener to Play-Video element
        const playVideo = document.getElementById('Play-Video');
        if (playVideo) {
            playVideo.addEventListener('click', clickWistiaPlay);
        } else {
            console.log('Element with ID "Play-Video" not found');
        }
    } else {
        console.log('Not a desktop or tablet device');
    }
});
</script>

and still used externals scripts like this:

<!-- This script is managed by Finsweet Cookie Consent -->
<script src="https://fast.wistia.com/assets/external/E-v1.js" async="" fs-consent-categories="essential" fs-consent-scripttype="text/javascript" type="fs-consent"></script>

now it works, hahaa 1 week down the drain.

Hey @lionel.wassilowsky, apologies. I don’t really follow the message above. Could you spot what was breaking them?

Hello Luis,

I hope this fins you well. I wanted to update you on our recent script implementations and the challenges we’ve encountered.

We’ve been testing various scripts with finsweet, and we’ve observed inconsistent behavior. Some scripts are functioning as intended, while others are not. I’d like to provide you with specific examples:

(all the scripts work without finsweet cookie consent)

this script didnt work

<script>
document.addEventListener('DOMContentLoaded', function() {
    // Function to trigger click on element with class "wistia_click_to_play"
    function clickWistiaPlay() {
        const wistiaPlayButton = document.querySelector('.wistia_click_to_play');
        if (wistiaPlayButton) {
            wistiaPlayButton.click();
        } else {
            console.log('Element with class "wistia_click_to_play" not found');
        }
    }

    // Check if the device is desktop or tablet (width greater than or equal to 768px)
    if (window.innerWidth >= 768) {
        // Add click event listener to Play-Video element
        const playVideo = document.getElementById('Play-Video');
        if (playVideo) {
            playVideo.addEventListener('click', clickWistiaPlay);
        } else {
            console.log('Element with ID "Play-Video" not found');
        }
    } else {
        console.log('Not a desktop or tablet device');
    }
});
</script>

this script did work:

<!-- This script is managed by Finsweet Cookie Consent -->
<script src="https://fast.wistia.com/assets/external/E-v1.js" async="" fs-consent-categories="essential" fs-consent-scripttype="text/javascript" type="fs-consent"></script>

For the time being, we’ve implemented a temporary solution by retaining the scripts that work with finsweet consent and setting aside those that don’t. However, I’m uncertain whether the issue lies with our implementation or if there are other factors at play.

I’ve reviewed our implementation process, and to the best of my knowledge, we’ve followed the correct procedures for each script. Given the inconsistency in behavior, I believe we may need to investigate further to identify the root cause.

Your insights would be invaluable in resolving these challenges.

Thank you for your time and assistance.

Best regards,
David