# Klaviyo integration

Integrate Klaviyo with Afflr to send personalized emails or SMS based on affiliate actions. This helps improve engagement using data-driven automation.

### **Why Use Klaviyo with Afflr?**

Klaviyo enables targeted communication using affiliate events and properties. This helps drive sales and build long-term relationships.

## **Integrate Afflr with Klaviyo**

Generate a Private API Key in Klaviyo and add it in **Afflr → Settings → Integrations** to enable the connection.

<figure><img src="/files/dnRQTZwJj6c92Llrrlmq" alt=""><figcaption></figcaption></figure>

From **Klaviyo → Settings → API Keys**, create a Private API Key with **full access** and copy it.

<figure><img src="/files/qaiMcQvnY7vq4zUJ8jdW" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/Ot2ZJA0tnmTVoImm3pIs" alt=""><figcaption></figcaption></figure>

Go to **Afflr → Settings → Integration**, enable Klaviyo, paste the API Key, and click **Save**.

<figure><img src="/files/oCe9OC3EBolaPleye2ew" alt=""><figcaption></figcaption></figure>

#### **Verify Klaviyo Integration**

Check **Klaviyo → Audience → Profile** and confirm that **Afflr Bot** appears under the profile.

<figure><img src="/files/x7r9foEO9vTTps5xRbX8" alt=""><figcaption></figcaption></figure>

### **Klaviyo Trigger Events in Afflr**

Afflr provides multiple triggers to automate emails or SMS when affiliate actions occur.

<table><thead><tr><th width="80.56640625">S.No</th><th>Trigger</th><th>Functi</th></tr></thead><tbody><tr><td>1</td><td>Referral code changed</td><td>Triggered when referral code of affiliate is changed</td></tr><tr><td>2</td><td>New referral sale</td><td>Triggered when an affiliate makes a new sale</td></tr><tr><td>3</td><td>Payout sent</td><td>Triggered when payout is sent to the affiliate</td></tr><tr><td>4</td><td>Signed up as an affiliate via sign up form</td><td>Triggered when an affiliate signs up using sign up form</td></tr><tr><td>5</td><td>Signed up as an affiliate via manual creation</td><td>Triggered when an affiliate is added manually by the admin</td></tr><tr><td>6</td><td>Signed up as an affiliate via manual upload</td><td>Triggered when an affiliate list is imported to the app</td></tr><tr><td>7</td><td>Affiliate rejected for a program</td><td>Triggered when an affiliate is rejected from joining a program</td></tr><tr><td>8</td><td>Affiliate changed program</td><td>Triggered when an affiliate is assigned a new program</td></tr><tr><td>9</td><td>Affiliate approved for a program</td><td>Triggered when an affiliate is approved into a program</td></tr></tbody></table>

### **Custom Properties in Afflr**

Custom properties allow you to personalize messages using affiliate, program, commission, and store data.

#### **Common Affiliate Properties**

You can personalize content using affiliate code, link, status, commissions, sales revenue, program name, and currency.

<table><thead><tr><th width="299.0859375">Property</th><th width="246.5546875">Definition</th><th>Example</th></tr></thead><tbody><tr><td>{{afflr_affiliate_code}}</td><td>The affiliate code of the affiliate you are sending mail to will be displayed</td><td>Welcome10</td></tr><tr><td>{{afflr_affiliate_commission}}</td><td>The lifetime commission earned by the affiliate will be displayed</td><td>1000</td></tr><tr><td>{{afflr_affiliate_link}}</td><td>The affiliate link of the affiliate you are sending mail to will be displayed</td><td>your-store-domain.myshopify.com?afflr_id=Welcome10</td></tr><tr><td>{{afflr_affiliate_paid_commission}}</td><td>The commission already paid to the affiliate will be displayed</td><td>300</td></tr><tr><td>{{afflr_affiliate_sales_revenue}}</td><td>The total revenue earned through the affiliate's sales will be displayed</td><td>5000</td></tr><tr><td>{{afflr_affiliate_source}}</td><td>The source through which the affiliate joined the program is displayed</td><td>Manual_Create</td></tr><tr><td>{{afflr_affiliate_status}}</td><td>The status of the affiliate is displayed</td><td>Approved</td></tr><tr><td>{{afflr_affiliate_unpaid_commission}}</td><td>The commission balance yet to be paid will be displayed</td><td>400</td></tr><tr><td>{{afflr_currency_code}}</td><td>The currency in which transactions take place will be displayed</td><td>USD</td></tr><tr><td>{{afflr_program_name}}</td><td>The program name of the trigger is displayed</td><td>Give 10 Get 10</td></tr><tr><td>{{updated_at}}</td><td>The time and date of any updation that occurred will be displayed</td><td>2024-05-09T09:30:34.202Z</td></tr><tr><td>{{affiliate_name}}</td><td>The name of the affiliate is displayed</td><td>John</td></tr><tr><td>{{affiliate_email}}</td><td>The email ID of the affiliate is displayed</td><td>john@xymail.com</td></tr></tbody></table>

The following are the additional properties available in some events:

<table><thead><tr><th width="172.14453125">Event</th><th width="182.859375">Property</th><th width="209.703125">Definition</th><th>Instance</th></tr></thead><tbody><tr><td>REFERRAL_CODE_CHANGE</td><td>{{affiliate_new_referralCode}}</td><td>The new referral code after the change is displayed</td><td>WelcomeJohn10</td></tr><tr><td>PAYOUT_SEND</td><td>{{payout_amount}}</td><td>The amount sent as a payout to the affiliate is displayed</td><td>1000</td></tr><tr><td>PAYOUT_SEND</td><td>{{payout_date}}</td><td>The date when the payout is sent is displayed</td><td>25-04-2024, 3:37:48 PM</td></tr><tr><td>PAYOUT_SEND</td><td>{{payout_method}}</td><td>The mode of payment is displayed</td><td>Coupon</td></tr><tr><td>PAYOUT_SEND</td><td>{{payout_affiliate_notes}}</td><td>Any additional note mentioned during the payout will be displayed</td><td>Payment Sent</td></tr><tr><td>NEW_REFERRAL_SALE</td><td>{{sales_amount}}</td><td>The total value order of the sales is displayed</td><td>250</td></tr><tr><td>AFFILIATE_CHANGE_PROGRAM</td><td>{{new_program_name}}</td><td>The name of the new program assigned to the affiliate is displayed</td><td>Get 15% Give 15%</td></tr></tbody></table>

### **Create an Email Flow in Klaviyo**

You can build automation flows in Klaviyo using Afflr triggers to send event-based emails.

Create a flow using **Afflr –> New Referral Sale**, apply a profile filter by program name, and save the trigger.

<figure><img src="/files/6Vo9MFNS97x3cldnVcCi" alt=""><figcaption></figcaption></figure>

Add personalization using custom properties, preview the content, and save the email.

Review the flow, set the status to **Live**, and turn it on to start sending automated emails.

<figure><img src="/files/uhWUG9TcLFcCvlj31Xpv" alt=""><figcaption></figcaption></figure>

With Klaviyo integration, Afflr enables powerful automation using real-time affiliate events and personalized messaging.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.afflr.io/settings/klaviyo-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
