How can I integrate in page button to accept and activate content?

Description

On one of the sites pages (Offers) users can request an offer. I integrated typeform to ask for certain user data. Typeform shall only be loaded if personalization cookies are accepted. As long as they are not accepted, an “error” message is shown. Instead of going through cookie preferences I’d like to place a button in the error message to directly accept all cookies. I created various buttons in which I set the fs-consent-element = “allow”. However this has no effect. Going through cookie preferences works but it requires users three instead of one click.

Site URL

Required: Please provide a staging/production URL where we can see the issue

Steps to Reproduce

  1. Go to page, click any of the buttons that sets fs-consent-element = “allow” in the “error message”
  2. No change is visible
  3. Click cookie preferences, accept all cookies and typeform loads

Expected Behavior

Wen clicking any of the buttons the cookies are allowed and the typeform loads.

Actual Behavior

Cookie settings are not changed and typeform does not load.

Video/Screenshots

Required: Please provide a short screen recording showing the issue

  • Video link: Available but I can only place two links in this post.

Additional Context

  • Browser: Google Chrome Version 139.0.7258.157 (Offizieller Build) (arm64)

NDA Notice: If you’re under an NDA, please feel free to send us a Direct Message/Email with the above information.

Video: link to loom video

Hey @florian.ma.faessler!

The reason the clicks aren’t being registered is likely because your new fs-consent-element="allow" buttons are placed outside the fs-consent_component element. In that case, the script can’t properly locate them.

You have two options to solve this:

  1. Use Attributes Mirror Click to mirror user interactions from the overlayed buttons to the actual allow button.
  2. Use the Consent API to update the Consent Preferences after the user interacts with the buttons.

Let me know if you’d like help setting up either option!

Hey @Support-Luis ,

Thank you! I implemented Mirror Click and it worked. I was not aware of the function.

Best regards,

Florian

1 Like