# Klaviyo Preference Center Hosted Page Setup

This guide explains how to use a **second** Klaviyo hosted page so subscribers who click **manage preferences** (or your preference center link) are redirected to your Last Chance **preferences** screen—using the same Last Chance script as the unsubscribe hosted page, with one extra attribute.

## Overview

Klaviyo can host custom HTML for consent flows, including a page used when someone opens their email preferences. By creating a dedicated hosted page and assigning it in Klaviyo’s consent settings, you can send those visitors to Last Chance with `entry=preferences` so they land directly on your preferences experience (topics, frequency, pause, etc.).

### Benefits

- **Same pattern as unsubscribe** — One script URL; add `data-entry="preferences"` for the preference-center page only
- **No template surgery** — Works with Klaviyo’s default preference links once the consent page is wired
- **Recommended** — Unsubscribe hosted page setup is unchanged; this second page closes the manage-preferences entry point so more subscribers see Last Chance before they unsubscribe

---

## Prerequisites

Before you begin:

- ✅ Unsubscribe hosted page setup is complete (or you understand that flow) — see the [Klaviyo Unsubscribe Hosted Page Setup Guide](./klaviyo-hosted-page-setup.md)
- ✅ Your Last Chance page is published and includes an enabled **preferences** screen in the flow
- ✅ Klaviyo hosted pages are enabled (same as for unsubscribe)
- ✅ Admin access to Klaviyo
- ✅ **Manage preferences** links in your Klaviyo templates use `{% manage_preferences %}` or `{% manage_preferences_link %}` where appropriate (see [Klaviyo unsubscribe and preference links in emails](./klaviyo-email-links-and-consent-pages.md))

---

## Setup Process

### Step 1: Create a second hosted page

1. Go to [Klaviyo Hosted Pages](https://www.klaviyo.com/settings/other/hosted-pages)
2. Click **Create New Hosted Page**
3. Name it clearly (e.g. `last_chance_preferences`)

### Step 2: Paste the HTML code (preference center variant)

Copy the personalized HTML below. It is the same as the unsubscribe snippet **plus** `data-entry="preferences"` on the script tag so Last Chance opens the preferences screen.

> **Note:** If you view this guide while signed in at **Settings → Email Providers → Klaviyo**, your team ID is filled in below. In the public docs, sign in and refresh to see your code.

<!-- PERSONALIZED_CODE_BLOCK -->

### Step 3: Assign the page in Klaviyo consent settings

1. Open [Klaviyo Consent Pages Settings](https://www.klaviyo.com/settings/other/consent-pages)
2. Find the section for **email preferences** / **manage preferences** (wording may vary by account)
3. Choose **Use hosted page** (or equivalent) and select the hosted page you created
4. Save

For Klaviyo’s own UI details, see their help center: [Getting started with consent pages](https://help.klaviyo.com/hc/en-us/articles/115005251848), [Understand custom hosted pages in Klaviyo](https://help.klaviyo.com/hc/en-us/articles/360057676272-Understand-custom-hosted-pages-in-Klaviyo), and [How to add an unsubscribe link to Klaviyo emails](https://help.klaviyo.com/hc/en-us/articles/115006054267) (same tag patterns apply to preference links—see our [email links guide](./klaviyo-email-links-and-consent-pages.md)).

---

## How It Works

```
1. Subscriber opens manage preferences from email or profile
   ↓
2. Klaviyo loads your preference-center hosted page
   ↓
3. Last Chance script runs (with data-entry="preferences")
   ↓
4. Browser redirects to /unsub?...&entry=preferences&source=klaviyo
   ↓
5. Last Chance shows the preferences screen when it exists and is enabled
```

If the preferences screen is missing or disabled in your published template, visitors fall back to the normal entry screen (`initial`).

---

## Verifying Setup

1. Use Klaviyo to send a test that includes a manage-preferences link, or trigger the preference URL Klaviyo provides
2. Confirm you land on your Last Chance **preferences** UI
3. **Dashboard** — The onboarding step **Set up Klaviyo preference center hosted page** can auto-complete after a real visit with `source=klaviyo` and `entry=preferences`

---

## One-click preference apply links

After your manage-preferences flow sends subscribers to Last Chance (hosted page or direct link), you can append query parameters to `{% manage_preferences_link %}` so a single click saves topic and/or frequency preferences automatically. Apply params work without `entry=preferences`; use `entry=preferences` only when you also want the preferences screen as the landing page. See [Klaviyo unsubscribe and preference links in emails](./klaviyo-email-links-and-consent-pages.md#one-click-preference-apply-links) for parameter reference and HTML examples.

In Last Chance, open **Settings → User preferences → Topics** or **Frequencies** to copy generated snippets or per-topic/per-frequency links from the **One-click preference apply links** card.

---

## Reverting

In **Consent Pages** settings, switch the preference / manage-preferences flow back to Klaviyo’s default (or another page) instead of your Last Chance redirect hosted page.

---

## Troubleshooting

- **Lands on initial page, not preferences** — Ensure the published flow has **preferences** enabled; check the script includes `data-entry="preferences"` on this hosted page only (not on the unsubscribe hosted page)
- **Hosted page not loading script** — Compare with the working unsubscribe HTML; only the `data-entry` line should differ
- **Unsubscribe still works** — Keep your **unsubscribe** hosted page as a **separate** Klaviyo page **without** `data-entry`

---

## Related

- [Klaviyo Unsubscribe Hosted Page Setup](./klaviyo-hosted-page-setup.md)
- [Klaviyo unsubscribe and preference links in emails](./klaviyo-email-links-and-consent-pages.md)
- [Getting Started](./getting-started.md)

For support: support@yourlastchance.app
