This guide will walk you through how you can generate and add a Cookie Policy page on your Craft CMS website. A Cookie Policy is a document that provides detailed disclosure about the types of cookies used on a website and their purposes. It can help your website meet transparency requirements under privacy laws such as the GDPR and the ePrivacy Directive.
Prerequisites
- A CookieYes account (if you don't have one, sign up for free).
- Admin access to your Craft CMS website.
After you sign up, you will be directed to the installation screens. You can install the cookie banner to support GDPR compliant for your use of cookies. If you prefer to create a cookie policy first, skip the installation and go directly to the CookieYes Dashboard.
Generate a Cookie Policy in CookieYes
Step 1. Access the cookie policy generator
- Log in to your CookieYes account.
- From the top navigation bar, select Legal Policies.
- From the Cookie Policy section, click + Generate.

- Select your primary language. The chosen language will appear with a checkmark.
- (Optional) Enable Generate policy in multiple languages to add more languages. This feature is available on Basic, Pro and Ultimate plans.
- Click Save draft to save your progress or Next to continue.
Step 3. Add about cookies details
In the About cookies section, edit the heading and description to explain what cookies are and why your website uses them. You can keep the default text or edit it to match your website’s practices.
Step 4. Add use of cookies details
In the Use of cookies section, describe how your website uses cookies (for example, functionality, analytics, performance, or advertising). You can keep the default text or update it for accuracy.
When ready, click Preview cookie policy to review the formatting and tone before proceeding.
Step 5. Review and edit types of cookies
In the Types of cookies section, you will see a list of cookies from your most recent website scan. If needed, you can refresh the list by clicking Scan again to capture any new cookies. The cookies are organised into categories such as Necessary, Functional, Analytics, Performance and Advertisement. Review each entry carefully to verify the cookie name, duration, and purpose for accuracy.
Step 6. Set cookie preferences and generate the cookie policy
In the Cookie preferences section, keep the default heading (“Manage cookie preferences”) and description, or update them with instructions specific to your users. Set the Effective Date for the cookie policy. Preview the policy to verify the details and when confirmed, click Generate cookie policy to generate the policy.
The Revisit consent widget enables your website visitors to manage their cookie preferences. You can remove the code in the field if you don’t want a widget to be displayed. For more details, refer to the guide.
Add the Cookie Policy to Craft CMS
After you generate your cookie policy, review the preview in each selected language. Click Add policy to site to open a modal with ways to add your cookie policy.
Choose one option and follow its steps.

Option 1: One-click install (recommended)
Adds the cookie policy using your existing cookie banner script. The published policy updates automatically whenever you make changes in CookieYes.
Step 1: Select One-click install
In the modal, select One-click install.
Step 2: Create a policy page in Craft CMS
- Log in to your Craft CMS website.
- Go to Settings > Fields, then click + New field.

- Enter Body HTML in Name and bodyHtml in Handle. In Field Type, select Plain Text, then click Save.

- Go to Settings > Sections, then click + New section.

- Enter Cookie Policy in Name and cookiePolicy in Handle. In Section Type, select Single.
- Click + Create and add an entry type named Cookie Policy, then click Save.

- In the Sections list, select Cookie Policy, then select its entry type.

- In Field Layout, drag in the Body HTML field, then click Save.

- Copy the URL of the cookie policy page and paste it into the CookieYes web app.

Step 3: Embed the policy code
- In the left-hand menu, click Entries, then select the Cookie Policy entry.

- Paste <div id="cky-auto-cookie-policy"></div> into Body HTML, then click Save.

Step 4: Publish and verify
1. Return to the CookieYes web app.
2. Click Publish cookie policy.

3. Open the live cookie policy page on your Craft CMS website.
Your cookie policy page is now live on your Craft CMS website. You can link the cookie policy in your website footer, and within your cookie banner so visitors can read it before they give consent.
Option 2: Hosted URL
Displays your cookie policy through a hosted link. The policy updates automatically whenever you make changes in CookieYes.
Step 1: Copy the hosted URL
- In the modal, select Hosted URL.
- Click Copy URL.

By default, the policy uses the visitor’s browser language. To set a specific language, add its code to the end of the URL. For example, /fr for French: https://legal.policygenerators.com/cookie-policy/xxxxxxxxxxxxxxxxx/fr
If someone else manages your website, click Send URL to a teammate to share the link with them.
Step 2: Add the link to Craft CMS
These steps add the link to your site footer, though you can place it anywhere on your site.
- In your Craft CMS project files, open the template that contains your footer, such as
templates/_partials/footer.twig. - Add the following line where you want the link to appear. Replace
HOSTED_URL with the URL you copied.
<a href="HOSTED_URL">Cookie Policy</a> - Save the file and deploy the change to your live site.
Option 3: Code snippet
Adds the cookie policy using a JavaScript snippet. The published policy updates automatically whenever you make changes in CookieYes.
Step 1: Copy the code snippet
- In the modal, select Code snippet.
- Click Copy code.

Tip: If someone else manages your website, click Send code to a teammate to share the code with them.
Step 2: Create a policy page in Craft CMS
- Log in to your Craft CMS website.
- Go to Settings > Fields, then click + New field.

- Enter Body HTML in Name and bodyHtml in Handle. In Field Type, select Plain Text, then click Save.

- Go to Settings > Sections, then click + New section.

- Enter Cookie Policy in Name and cookiePolicy in Handle. In Section Type, select Single.
- Click + Create and add an entry type named Cookie Policy, then click Save.

- In the Sections list, select Cookie Policy, then select its entry type.

- In Field Layout, drag in the Body HTML field, then click Save.

Step 3: Embed the policy code
- In the left-hand menu, click Entries, then select the Cookie Policy entry.

- Paste the JavaScript snippet into Body HTML, then click Save.

Adds the cookie policy as static HTML. You update the page manually whenever the policy changes.
Step 1: Copy the HTML
- In the modal, select HTML format.
- Select your preferred language.
- Click Copy code.

Tip
If someone else manages your website, click Send code to a teammate to share the code with them.
Step 2: Create a policy page in Craft CMS
- Log in to your Craft CMS website.
- Go to Settings > Fields, then click + New field.

- Enter Body HTML in Name and bodyHtml in Handle. In Field Type, select Plain Text, then click Save.

- Go to Settings > Sections, then click + New section.

- Enter Cookie Policy in Name and cookiePolicy in Handle. In Section Type, select Single.
- Click + Create and add an entry type named Cookie Policy, then click Save.

- In the Sections list, select Cookie Policy, then select its entry type.

- In Field Layout, drag in the Body HTML field, then click Save.

Step 3: Add the HTML
- In the left-hand menu, click Entries, then select the Cookie Policy entry.

- Paste the HTML into Body HTML, then click Save.

Note
To remove the Cookie Policy heading at the top of the page, delete the following line from the HTML code: <h1 class="cookie-policy-h1">Cookie Policy</h1>
Conclusion
Your cookie policy is now live on your Craft CMS website. Link it in your website footer and within your cookie banner so visitors can read it before they give consent. If you used HTML format, update the page whenever you change the policy in CookieYes.