Skip to main content

How to Add a Privacy Policy and Cookie Consent Pop-Up

This article explains how to add an “Accept Cookies & Privacy Policy” pop-up to a Kyrios website or funnel using a Custom JS/HTML element.

Updated over 2 months ago

Add the Cookie Consent Pop-Up to a Page

Step 1: Open the Page Editor

  1. Go to Sites.

  2. Open the Website or Funnel you want to edit.

  3. Click Edit on the page where the pop-up should appear.

Step 2: Add the Custom JS/HTML Element

  1. Click Add Element.

  2. Scroll to the Custom section.

  3. Select Custom JS/HTML.

  4. Drag the element to the top of the page layout.

Screenshot description:
This image shows the Custom JS/HTML element highlighted in the Add Element > Custom section.

Step 3: Open the Code Editor

  1. Select the Custom JS/HTML element you added.

  2. Open the Settings panel on the left.

  3. Click Open Code Editor.

Step 4: Paste the Cookie Consent Script

Paste the entire script below into the code editor:

<script>

window.hlptcb = {};/*

* Editable Options

*/

window.hlptcb.popup_title = 'Accept Cookies & Privacy Policy?';

window.hlptcb.popup_message = 'This website uses cookies to improve your user experience.';

window.hlptcb.popup_more_title = 'More information';

window.hlptcb.popup_more_link_url = '#';

window.hlptcb.popup_accept_button_title = 'Accept Cookies';

window.hlptcb.popup_style_width = '50%';

window.hlptcb.popup_style_mobile_width = '100%';

window.hlptcb.popup_style_z_index = '100';

window.hlptcb.popup_style_bgcolor = '#333333';

window.hlptcb.popup_style_title_color = '#1571a8';

window.hlptcb.popup_style_more_link_color = '#1571a8';

window.hlptcb.popup_style_button_color = '#FFFFFF';

window.hlptcb.popup_style_button_bgcolor = '#1571a8';

/////Editable options end here. Please don't change the code below.

</script>


Important:
Only edit values inside quotation marks (' ').

Customize the Pop-Up Content

You can safely edit the following fields:

Edit the Pop-Up Message

  • Update the text shown in the banner:

window.hlptcb.popup_message = 'Your cookie message here';

Screenshot description:
This image highlights the popup_message line where the main cookie consent text is edited, and the popup_more_link_url field where a Privacy Policy URL is added.

Add Your Privacy Policy Link

  • Replace the # with your Privacy Policy URL:

window.hlptcb.popup_more_link_url = 'https://yourdomain.com/privacy-policy';

Optional Customizations

You may also customize:

  • Pop-up title text

  • Button label

  • Background and button colors

  • Desktop and mobile width

Do not edit code outside the “Editable Options” section.

Save and Publish

  1. Click Save in the code editor.

  2. Publish or update your page.

  3. Visit the page in an incognito window to confirm the pop-up displays correctly.

Common Issues and Fixes

The pop-up does not appear

  • Confirm the Custom JS/HTML element is placed at the top of the page.

  • Clear browser cache or test in a private window.

Privacy Policy link does nothing

  • Ensure the URL replaces # and includes https://.

Styling looks incorrect

  • Revert changes outside quotation marks.

  • Confirm hex color codes are valid.

FAQ

Does this make my site legally compliant?

No. This article only shows how to add a pop-up. Legal compliance depends on your region and must be reviewed by a qualified legal professional.

Can I change the text after publishing?

Yes. Edit the same Custom JS/HTML element and update the quoted text values.

Does this work on mobile devices?

Yes. The script includes a mobile-specific width setting.

Will visitors see the pop-up again after accepting?

No. Acceptance is stored in the browser using local storage.

Did this answer your question?