Skip to main content
Creating a double opt-in flow

Collect WhatsApp subscribers and trigger a double opt-in flow to ensure GDPR compliance.

Updated over 2 months ago

In Klaviyo:

  1. Create the opt-in request flow

  2. Go to Audience > Lists & segments > Create List /Segment and build your double opt-in segment. We suggest the following:

    1. Email: should contain @ as we want to ensure that the customer’s contact information is valid

    2. Phone number: should contain + in the beginning to make sure it has a country code and is therefore valid for receiving WhatsApp messages

    3. Properties about someone - charles_opt_in_status: should be false or not set, so that we only request opt-in from contacts that haven’t given their consent to receive WhatsApp message via charles already

    4. Properties about someone - created: choose a date for profiles that are created after you have set up the flow, so that the double opt-in flow would only be triggered for newly created contacts

3. Go to Flows > Create flows

4. Select the Segment we created in step 2. as the trigger

5. Add a conditional split to make sure that only contacts where charles_opt_in_status is false or not set would receive the double opt-in request message to avoid spamming

6. Add a time delay of up to 2 minutes to avoid overwhelming the system

7. Add a Webhook Action

Follow these steps to connect Klaviyo Flows to charles Journeys:

charles:

  1. Create a new Journeys flow and add Klaviyo as the Trigger:

Klaviyo:

2. Build your flow and add Webhook action:

For example: try creating a double opt-in request to ensure GDPR compliance.

charles → Klaviyo:

3. Copy the URL, Key and value from the charles Klaviyo trigger into the Klaviyo Webhook action:

If you’re not sure how the Webhook action works, check out the Klaviyo guide here.

Klaviyo:

4. Configure the JSON payload with the information you wish to share from Klaviyo to charles

The field "phone_number" is required and therefore needs to be included in the JSON payload.

Click “View profile properties” to see what variable properties are available, including any custom properties you may have created.

By using double curly braces and the "event_properties" object, the JSON can dynamically retrieve the values of these properties from the event that triggers the flow in Klaviyo. In the "JSON Payload" section, enter the following code, replacing the variables with your data:

For example: {{ recent_purchase.product_name }} will pull in the name of the recent product purchased by your customer.

{ 
"phone_number": "{{ person.phone_number }}",
"message": "{{ event_properties.message }}",
"first_name": "{{ person.first_name }}"
}

5. Set the Webhook live

Klaviyo → charles:

6. Copy the JSON payload configure in step 4 and paste it into the Payload Body within the charles Klaviyo trigger:

Make sure the JSON payload is copied exactly from Klaviyo to charles. Even a small difference will result in errors.

Did this answer your question?