How to custom code consent pages
You will learn
Learn how to enable and use Klaviyo's hosted pages feature, which allows you to custom code your own preference pages, subscribe pages, and unsubscribe pages.
This article is for developers; Klaviyo does not currently offer services to help build out custom code, nor do we provide support for custom code troubleshooting. To learn about our built-in app consent pages, head to our article on getting started with consent pages.
Before you begin
Only accounts with paid email features that have passed account verification can enable custom hosted pages.
Before configuring a hosted page, enable this feature:
- Navigate to Settings > Other.
- Choose Consent pages.
- Under Custom hosted pages, click Enable Custom Pages.

A custom dedicated domain is optional; you do not need to configure one to enable hosted pages.
Create a custom consent page
- Head to Settings > Other.
- Click Hosted pages.
- Next to Pages, click the + symbol to add a new page.
- Name this page (e.g., unsubscribe.tmpl), then click Add Page. You can use it for a preference, subscribe, or email unsubscribe page, and create more than 1 page if needed.
Hosted page names cannot contain spaces, as this leads to an error. Avoid spaces or use underscores to break up titles.
- Design an HTML page that includes the fields and features of your choice. Example fields that can be inserted for a custom consent page include:
- Choices for email frequency:
- An option to unsubscribe
- An option to receive all emails
- Frequency options for daily, weekly, monthly, etc. newsletters
- Information that can be used to target and segment:
- A checkbox for whether or not the user wants sale announcements
- A checkbox for whether or not the user wants product announcements
- A checkbox for whether or not the user wants blog updates
- Other lists the user may want to join
- Choices for email frequency:
Example of HTML code for a consent page
Use this example in your unsubscribe.tmpl to collect email type and frequency preferences. Replace the sample logo, company name, and privacy policy link with your own before using it.