Skip to main content
Customer Portal v2 templates can read Klaviyo profile properties and segment membership for the customer that is logged in. Use this when you want to personalize the portal based on data you already maintain in Klaviyo. For example, you can:
  • Show a VIP message to customers in a VIP members segment
  • Show a product recommendation when a Klaviyo profile property has a certain value
  • Hide or show a portal action based on campaign, loyalty, churn-risk, or lifecycle data
  • Pair a personalized Customer Portal message with a Klaviyo metric that tracks when a customer acts on it

Before you start

You need:
  • Customer Portal v2 enabled for your project
  • The Native Klaviyo integration preview enabled for your project
  • Permission to connect your Klaviyo account to Firmhouse
  • Access to Customer Portal > Templates so you can edit Liquid templates
Ask Firmhouse to enable Native Klaviyo integration for your project if you do not see the OAuth connection option in the Klaviyo app settings.

Connect Klaviyo with OAuth

  1. In Firmhouse, open Apps > Klaviyo.
  2. Click Connect Klaviyo.
  3. Sign in to Klaviyo and approve the requested access.
  4. Return to Firmhouse and confirm that the Klaviyo settings show OAuth connected.
Firmhouse requests access to send events, read profiles and segments, and keep customer profile properties current. OAuth tokens are stored encrypted and refreshed automatically. You do not need to create or paste a private API key. If Firmhouse shows New permissions required, click Reconnect Klaviyo and approve the current permissions. Legacy public API keys can still send existing Klaviyo metric events, but they cannot read profile properties or segment membership. Connect with OAuth to use Klaviyo data in Customer Portal templates. Read Klaviyo’s OAuth overview for more information about how Klaviyo authorizes connected applications.

Use the Klaviyo profile Liquid object

Klaviyo data is available through the current subscription:
The klaviyo_profile object exposes: Firmhouse looks up the Klaviyo profile by the subscription email address. If Klaviyo is not connected with OAuth, the subscription has no email address, or Klaviyo does not return a profile, the object renders as empty data.

Show content based on a profile property

Use subscription.klaviyo_profile.properties when the decision is based on a custom property on the Klaviyo profile.
Klaviyo property keys can be accessed with dot notation when the key is Liquid-friendly, such as customer_tier. For keys with spaces or special characters, use bracket notation or normalize the property name in Klaviyo first.

Show content based on segment membership

Use segment_names when you want to check whether a customer is in a named Klaviyo segment.
Use segment_ids instead of segment_names when you want the template logic to keep working if a segment is renamed in Klaviyo.

Combine Klaviyo data with Customer Portal actions

You can combine Klaviyo conditions with Customer Portal components. For example, show an add-product action only for customers in a specific segment:

Track Customer Portal actions in Klaviyo

Use Klaviyo’s public Client Event API when you want to track that a Customer Portal message was shown or clicked. This is a browser-side API, so use your Klaviyo public API key, also called the Site ID. Never expose OAuth access or refresh tokens in Customer Portal HTML or JavaScript. A practical pattern is to define one helper function in the shared_head template, and then call that helper from any page, dialog, or button where you want to track a Customer Portal action.
After that helper is available, call it from the template where the event happens. For example, track that a VIP dialog was shown:
Or track a button click:
Klaviyo accepts the event request asynchronously. Check the profile or metric in Klaviyo to confirm the event was received.

Caching and freshness

Firmhouse caches Klaviyo profile properties and segment membership for 10 minutes. This keeps Customer Portal pages fast, because Firmhouse does not have to request data from Klaviyo on every page load. This means changes to Klaviyo profile properties or segments can take up to 10 minutes to show up in the Customer Portal. When you are developing Customer Portal templates in preview mode, Klaviyo caching is disabled. Preview mode always requests the latest profile properties and segment membership from Klaviyo so you can test template changes faster. When you update Klaviyo properties that influence segment membership, open the segment in Klaviyo and click Update segment. This makes sure the segment reflects the latest matching profiles before you test the Customer Portal.

Troubleshooting

The OAuth connection option is not visible Ask Firmhouse to enable Native Klaviyo integration for your project. While this feature is in preview, the connection option is only shown for selected projects. The template does not show my Klaviyo content Check that Klaviyo shows OAuth connected in Firmhouse and that the current subscription email address exists as a profile in Klaviyo. Reconnect Klaviyo if Firmhouse reports that new permissions are required. A segment change in Klaviyo is not visible immediately Klaviyo segment membership can take time to update in Klaviyo. If you changed profile properties that affect segment membership, open the segment in Klaviyo and click Update segment. Outside Customer Portal template preview mode, Firmhouse can take up to 10 minutes to show the latest Klaviyo data. The Customer Portal page still loads when Klaviyo is unavailable This is expected. Firmhouse treats Klaviyo profile data as optional personalization data. When the API cannot be reached or returns an error, the Liquid object returns empty properties and segment lists.