Below is a basic example to show how Klaviyo can be used with Subscribe Pro.
For this example, we will be setting up a Klaviyo Flow using Subscribe Pro's customer.subscribed
and subscription.created
webhook endpoints.
-
First, log in to Klaviyo and nagivate to Account > Settings > API Keys. Copy the Public API Key and save it for an upcoming step.
-
Log in to the Subscribe Pro Merchant App and navigate to System > Webhook Endpoints. Click New.
-
On the New Endpoint page, enter any example URL in the "Endpoint URL" field (e.g. https://www.example.com/) since we will be updating this field later. Uncheck the box "Subscribe To All Event Types" and uncheck all boxes underneath, leaving only the
customer.subscribed
andsubscription.created
events selected. -
Copy the contents of the "Shared Secret" field and save it for an upcoming step. Save the new webhook endpoint.
-
Click the Deploy to Netlify button at the top of this page.
-
Click Connect to Github, then log in using your github credentials and click Authorize Netlify.
-
A clone of this repo will be created in your Github account. First, give it a name and enter the Klaviyo Public API Key and the Subscribe Pro Webhook Shared Secret from steps 3 and 4.
-
Click Save & Deploy.
-
Once the site is finished deploying in Netlify, click Site Settings and Change site name.
-
Once you've given the site a name, go to Functions > klaviyo. Copy the Endpoint URL and save it for the next step.
-
In the Subscribe Pro Merchant App, go back to System > Webhook Endpoints. Click the Edit button on the endpoint that you created in step 3 and paste in the Endpoint URL. Click Save.
-
Under the Edit button, click the Enable button. Then click Test Connection - Ping Endpoint. In Netlify, you should see some new activity in Functions > klaviyo.
-
To test that everything is configured properly, go to the site that is connected to the Subscribe Pro environment used in the above steps. Create a new test customer and sign up for a subscription.
-
In Klaviyo, click on Profiles. We should see a new customer profile that was created. This customer profile will also now contain the Subscribe Pro customer ID.
-
Clicking on the new customer profile should show the two events that were triggered: Customer Subscribed and Subscription Created. Clicking Details underneath the Subscription Created event will show all of the data that sent from Subscribe Pro's webhook.
-
This data can now be used in Klaviyo's Flows. For example, go to Flows and click Create Flow. Click "Create From Scratch" and give it a name (e.g. Subscription Created).
-
For the Trigger, select Metric and choose the new Subscription Created event. Click Done when finished.
-
Drag an Email into the flow underneath the Trigger and configure the contents of this email however you'd like. In our example, we'll select a Klaviyo template and add in the customer's name, email address, and the product SKU that they subscribed to. (See Klaviyo's docs for more information about event variables.)
-
After creating the email template, we can use the Preview feature using our sample customer to ensure we've used the right variable names and test the appearance of the email.
-
We can then click "Manage Flow" and click "Back-Populate Flow Recipients" to send our new Subscription Created email to the sample customer we created.
-
Finally, we see that our email has sent and includes the information we pulled from the Subscribe Pro webhook.