Academy

How to add Alvas to a flow in Klaviyo

How to add Alvas to a flow in Klaviyo

Step 1 - Integration Mode

Inside the Alvas platform, you should go -> Emails. 

Click on an email, and go into Texts.

Guide image

 

Now you should turn on Integration Mode by flipping the "Integration Mode" switch:

Guide image

 

Once the switch is flipped, your screen will look like this: 

Guide image

In the middle of your screen, you can see the URL, Headers, and Payload. 

 

Step 2 - Add Webhook and Wait

You should now go to the tab with your Klaviyo flow, and open the flow editor. 

 

For this example, I will show you a Browse Abandoned flow, yet it could be any other event-triggered flow. 

 

A simple flow would look something like this:

Guide image

 

You should add a Webhook and a 10-minute wait like this:

 

Guide image

Note you will need 1 webhook for each email template that you want to personalize using Alvas. 

 

Step 3 - Configuring the Klaviyo webhook

Now you should go back into Alvas and click on the Destination URL - which will copy it to your clipboard.

 

Guide image

 

Then you should insert it into the "Destination URL" inside the Klaviyo webhook.

Guide image

 

And similarly, you should do the same with the JSON Body.

Guide image

 

Replace all the JSON code with what you've copied like this:

Guide image

 

Finally, click save on the webhook.

 

Step 4 - Adding webhook Headers

On the right menu of the webhook, you can see input fields for a Header Key and Value.

Guide image

 

You should now copy the Header Key from Alvas.

Guide image

 

It will always have this value:

 

Then paste it into the Header Key input field inside the Klaviyo Webhook.

Guide image

 

Now, do the same for the Header Value.

Guide image

 

And paste it into the value input field.

Guide image

 

When you've done that, remember to click "Save" on the webhook.

Guide image

 

 

 

Step 5 - Send test request

Now you can preview the webhook Payload, and see the data you are going to send over to Alvas. 

 

To do this, click on the "Preview" button in the right menu of the Webhook settings.

Guide image

 

When you do that you see a pop-up with all the event data.

 

Scroll all the way to the bottom of the pop-up window, where you will see an example payload.

Guide image

 

Here you should check that all data is present. 

 

Note - the profile_id for some accounts will not be present. That is fine - you should leave it empty if it's not displayed. All other data points should be populated.

 

If you're having trouble seeing other data points, please read this guide.

 

When you've confirmed that all data is present, click on the "Send Test Request" button. 

Guide image

You should see a green bar saying "Successfully sent webhook".

 

When that happens, head over to the Alvas platform, and go -> Logs. 

Guide image

Here you will see a new log being generated.

If you encounter issues when sending the log, or get a 701 error inside Alvas, it's likely due to the JSON body in the Klaviyo not being configured correctly.

Typically, it happens for stores that are not using Shopify as their CMS.

We've made a guide on how to fix that, and you can see it here.

Step 6 - Add Mergetags

Now, the AI will write an email any time a person triggers the Webhook step.

Then we need to insert these texts into the email inside Klaviyo, and for that you need to add mergetags to the email.

Turn on integration mode.

Guide image

Then for the Subject Line click "Copy Mergetag".

Guide image

Go into the flow in Klaviyo and paste it into the Subject Line field for the email below the webhook.

Guide image

Guide image

Guide image

Now do it again for the Preview Line.

Copy the Mergetag from Alvas.

Guide image

And paste it into Klaviyo.

Guide image

Remember to save the email in Klaviyo.

Guide image

After adding the Subject and Preview line, you should open the HTML editor inside Klaviyo.

Guide image

Then go back into Alvas and copy the mergetag for the Headline.

Guide image

And inside the HTML editor, you should replace the former headline with the mergetag.

Guide image

Guide image

Continue replacing the entire email with mergetags.

Guide image

To ensure that it works, you can preview the email by clicking "Preview" in the top hand right side.

Guide image

Step 7 - Add Tracking

Inside the template where you've just added Mergetags, go up to the URL and copy the Message ID that is shown after "/message/".

The Message ID is always 6 characters and can be a mix of letters and numbers.

Guide image

Then go into the email in Alvas and to the Self Learning tab.

Guide image

And paste the Message ID into the Alvas Message ID.

Guide image

Save the email, and you've completed this step.

Guide image

Next step: Prompting

After adding Alvas to your Klaviyo flow, you should start prompting Alvas, to make the emails have your desired message.

You can follow this guide.