Klaviyo

klaviyo-poplar

Before integrating and sending tests with Klaviyo, make sure you've completed the following:

  • Create a campaign in Poplar
  • Upload creative (can be a placeholder creative for testing purposes)
  • Locate both your Production Access Token and Test Access Token on the API page of your Poplar Account
For the webhook request to successfully hit the Mailing API endpoint, the campaign_id must be pointing to an Active campaign that has creative artwork uploaded - otherwise you will receive a 400 HTTP error.

1

Flows

From your Dashboard, navigate to your Flows page and use the Create Flow button, or select an existing one by clicking Edit Flow.

2

Actions

If you're creating a flow from scratch, select your Trigger event, set any necessary filters, and click Save, then Done to access the Actions step.

Drag and drop the Webhook action into your flow:

3

Webhook Configuration

Under the configuration settings on the left, you'll want to enter the following values so that you can trigger a mailing by sending data to our Mailing API:

URL
https://api.heypoplar.com/v1/mailing/
HEADERS Text
Authorization Bearer * Test or Production API Access Token*

We strongly recommend using the Test Access Token provided in the API section of your Poplar account, to ensure your trigger is set up successfully. 
After confirming the requests are successfully coming through to the History tab of your campaign for a period of time, swap in the Production token to go live.

Your JSON payload should contain all the data you'd like to share with the platform. This includes recipient info such as name, address, customer ID, and/or email, along with any custom merge tags that may be present if you're using dynamic creative.

campaign_id and optionally creative_id will also have to be included in the payload, to tell the trigger which Poplar campaign and (if multiple creatives in a campaign), a specific creative to point to. If creative_id is not specified, the platform will automatically randomize between all active creative under the campaign (ideal setup for A/B testing). If a creative is set to Default, the trigger will only fire the defaulted creative.

Emails for Address Enrichment

If you have customer email addresses and want to use them to mail with Poplar's Address Enrichment feature, use the code below as a template for your JSON Body:

{
  "recipient": {
    "email" : "{{ person.email|default:'' }}"
  },
  "campaign_id": "***Insert Campaign ID***",
  "creative_id": "***Insert Creative ID***"
}
	

Address Data

If you have customer Shipping or Billing addresses stored in Klaviyo and want to use them for mailing, use the code below as a template for your JSON Body:

{
  "recipient": {
      "email" : "{{ person.email|default:'' }}",
      "first_name": "{{ person.first_name|default:'' }}",
      "last_name": "{{ person.last_name|default:'' }}",
      "company": "{{ person|lookup:'$organization'|default:'' }}",
      "address_1": "{{ person|lookup:'$address1'|default:'' }}",
      "address_2": "{{ person|lookup:'$address2'|default:'' }}",
      "city": "{{ person|lookup:'$city'|default:'' }}",
      "state": "{{ person|lookup:'$region'|default:'' }}",
      "postal_code": "{{ person|lookup:'$zip'|default:'' }}"
  },
  "campaign_id": "***Insert Campaign ID***",
  "creative_id": "***Insert Creative ID***"
}
	

Conditional Splits

If some of your customers in the flow have properties filled out for only email or an email & address you'll want to use a conditional split block to filter on a customer address field. Then you can set up two webhooks one specific for email append and one with address fields.

Without the conditional split we'll respond with a 400 error on any customers triggered in the flow that have blank address data. 

Setting up a conditional slit to handle both address records and email only records.


4

Preview Webhook & Test Trigger

After entering your JSON Body code, click Preview Webhook to view a sample customer profile and ensure all the desired data is being pulled into each field.

The Profile Properties will show all the data for the sample customer, and the Payload Preview will show what data is being pulled into the webhook to be passed to the platform.

Data that appears under Profile Properties isn't guaranteed to be passed to the platform, always make sure the desired data is present in the Payload Preview as well.

klaviyo-preview-webhook

Send Test Request to push the webhook preview to Poplar to confirm the connection is successful. If the trigger goes through successfully, you'll see a green "Successfully sent webhook" in Klaviyo:

201 indicates a successful trigger

If you receive anything but a green success or if you receive a 400 error, consult our Common Questions section below or reach out to support@heypoplar.com for assistance.

History Tab

Head to the History tab of your campaign within your Poplar account to see successful tests come through:

Click into one of the mailers to see a PDF proof with the user data applied. Scroll down to the Request Details to confirm the data coming through the platform matches your Klaviyo JSON payload. 


5
Go Live!
Once you've confirmed the connection is successful and customer data is coming through to Poplar as desired, swap your Production Access Token in place of your Test token under HEADERS. Make sure to Save your updates, the set your Webhook action to Live!

klaviyo-golive

Manual

The manual setting will accumulate customers when they reach this step in the flow, and will only get passed onto Poplar if they are triggered manually.


Common Questions

Why am i receiving a 403 Error after cloning an existing webhook that worked?

For security purposes, if you clone a webhook the access token entered under HEADERS will be hashed at the end:

klaviyo-hashed

We recommend copying and pasting your access token again, then re-trying the test to see if it is successful.

Need help? Reach out to support@heypoplar.com for assistance.