# 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="https://1200751259-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4IvcT7tXOmKAPrjmBCkP%2Fuploads%2FpyALo1ZsWGCnjtPtRpGW%2Fimage.png?alt=media&#x26;token=2a51528c-c5c0-403d-ba56-9f5ca0398c04" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://1200751259-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4IvcT7tXOmKAPrjmBCkP%2Fuploads%2FC7dvaWdrLDSKzYc4TDEH%2Fimage.png?alt=media&#x26;token=d531fd2a-0c3a-4e93-9166-bb83c837e53d" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1200751259-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4IvcT7tXOmKAPrjmBCkP%2Fuploads%2FHSc5IDhQYsaCG0KkvdpB%2Fimage.png?alt=media&#x26;token=f9210cf0-3349-4528-abc6-b75086b352b3" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://1200751259-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4IvcT7tXOmKAPrjmBCkP%2Fuploads%2FmIJ36hkOHZLIsFelbMPM%2Fimage.png?alt=media&#x26;token=c62cad89-7de4-4a8e-8dff-615ec0914075" alt=""><figcaption></figcaption></figure>

#### **Verify Klaviyo Integration**

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

<figure><img src="https://1200751259-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4IvcT7tXOmKAPrjmBCkP%2Fuploads%2FxrkVP6IAiHBcNWL64tUP%2Fimage.png?alt=media&#x26;token=94756253-0145-4b1c-8d3f-0a82179a730d" 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="https://1200751259-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4IvcT7tXOmKAPrjmBCkP%2Fuploads%2F7qomiEEJXl42NmQeNbr5%2Fimage.png?alt=media&#x26;token=0897bf53-4f03-44ed-bba6-4c60a9937a19" 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="https://1200751259-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4IvcT7tXOmKAPrjmBCkP%2Fuploads%2FIDkRhaM42rGZRUKI8kUl%2Fimage.png?alt=media&#x26;token=b4bce49b-06d0-4c90-918b-ca5390de2bcd" alt=""><figcaption></figcaption></figure>

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