Klaviyo CRM connects Drupal to Klaviyo, the email and SMS marketing platform. Send webform submissions to Klaviyo as profiles, add people to lists, record email marketing consent, trigger Klaviyo Flows and embed Klaviyo signup forms, all configured from Drupal.

Features

Webform integration

  • Profiles: every submission creates or updates a Klaviyo profile. Map any webform element to a standard profile attribute (name, phone, location, etc.) or to a custom property.
  • Multiple lists: add a profile to any number of lists, each one either always or only when a chosen checkbox is checked.
  • Email marketing consent: subscribe people always, only when a consent checkbox is checked, or never. Uses Klaviyo's subscription API, so double opt-in lists send their confirmation email.
  • "Submitted Webform" event: an optional event with the webform's ID and title, to trigger a Klaviyo Flow for one specific form.
  • Readable values: checkbox, radio and select fields send their option labels; multi-value fields are sent as list properties.

Onsite tracking

  • Adds Klaviyo's onsite JavaScript to the site automatically (can be turned off).
  • Identifies visitors in the browser after they submit a webform, so their later activity is tied to their profile.

Klaviyo forms and lists in Drupal

  • Klaviyo Form Embed field type, to place Klaviyo signup forms on any content.
  • Admin pages and blocks listing the account's Klaviyo forms and lists.

Secondary account

  • Connect a second Klaviyo account and send selected webforms to it with the Klaviyo CRM (Secondary Account) handler.

Drush

  • drush klaviyo_crm:backfill-subscriptions WEBFORM_ID applies a webform's current consent and list settings to past submissions, with --dry-run, --limit and --sids options.

Requirements

  • Drupal 10 or 11
  • Webform
  • The Klaviyo PHP SDK (klaviyo/api), installed automatically by Composer
  • A Klaviyo account and a private API key

Installation

Install with Composer:

composer require drupal/klaviyo_crm

Then enable the module as usual. See Installing modules for more information.

Configuration

  1. In Klaviyo, create a Custom Key with these scopes: Accounts (Read), Forms (Read), Lists (Full), Profiles (Full), Subscriptions (Full) and Events (Full).
  2. In Drupal, go to Configuration > Web services > Klaviyo CRM (/admin/config/services/klaviyo-crm) and enter the private key. The module connects and enables onsite tracking.
  3. On any webform, go to Settings > Emails / Handlers, add the Klaviyo CRM handler, map your fields and choose the lists and consent rule.

API keys can also be set in settings.php, so they stay out of exported configuration. See the README for details.

Upgrading from 1.0.x

Run drush updb after updating. Existing webform handlers keep their previous behavior (list membership without consent) until you change them. See the 1.1.0 release notes for details.

Supporting organizations: 
Full/Active development

Project information

Releases