# LLM Full Text Content

This file contains aggregated content from all documentation pages.

Each document section includes the source URL for reference.

---

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features.md
===============================================================================

# Features

Talkable provides several optional features that help increase conversions
and make your referral program incredibly easy to manage. Here’s an overview of
each with links to integration details.

| [Automatic Coupon Creation](https://docs.talkable.com/advanced_features/coupons.md#advanced-features-coupons)                                                       | Issue single and multi-use coupons for your campaigns                                                                                                              |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [Shopify Coupon auto-sync](https://docs.talkable.com/advanced_features/shopify_coupons_auto_sync.md#advanced-features-shopify-coupons-auto-sync)                    | Issue coupons automatically for your Shopify store                                                                                                                 |
| [Shopify Coupon auto-apply](https://docs.talkable.com/advanced_features/shopify_coupons_auto_apply.md#advanced-features-shopify-coupons-auto-apply)                 | Issue coupons automatically for your Shopify store                                                                                                                 |
| [Shopify Purchase Syncing](https://docs.talkable.com/advanced_features/shopify_purchase_syncing.md#advanced-features-shopify-purchase-syncing)                      | Automatic purchases synchronization from your Shopify store                                                                                                        |
| [Referral Tracking Methods](https://docs.talkable.com/advanced_features/track_methods.md#advanced-features-track-methods)                                           | See how Talkable tracks referrals and what data is used in the tracking process                                                                                    |
| [Advocate Personal Coupon Sharing](https://docs.talkable.com/advanced_features/personal_coupon_sharing.md#advanced-features-personal-coupon-sharing)                | Find out how to add personal coupon sharing into a Talkable campaign in addition to link sharing                                                                   |
| [Convert static copy into Localization](https://docs.talkable.com/advanced_features/converting_into_localization.md#advanced-features-converting-into-localization) | Convert all static languange into a customizable copy that’s easy to AB test.                                                                                      |
| [Сustomer Service Portal](https://docs.talkable.com/advanced_features/customer_service_portal.md#advanced-features-customer-service-portal)                         | Explore full details for each individual customer and their referral journey, manage their rewards and deliver excellent customer service.                         |
| [Params encryption](https://docs.talkable.com/advanced_features/params_encryption.md#advanced-features-params-encryption)                                           | For additional security, it is possible to encrypt Advocate, Friend and Loyalty member emails on back-end, as well as their custom properties.                     |
| [File encryption](https://docs.talkable.com/advanced_features/file_encryption.md#advanced-features-file-encryption)                                                 | For additional security, it is possible to encrypt files.                                                                                                          |
| [Report password protection](https://docs.talkable.com/advanced_features/report_password_protection.md#advanced-features-report-password-protection)                | For additional security, reports have password protection by default.                                                                                              |
| [Including Product Items](https://docs.talkable.com/advanced_features/product_items.md#advanced-features-product-items)                                             | Let your customers share specific items that they’ve purchased and pass product details along with purchase data                                                   |
| [Integrating Events](https://docs.talkable.com/advanced_features/events.md#advanced-features-events)                                                                | Fits SaaS, subscription-based, and other businesses that require integrating additional events to build more advanced referral logics on top of regular purchases. |
| [Pass custom user data](https://docs.talkable.com/advanced_features/passing_custom_data.md#advanced-features-passing-custom-data)                                   | Pass additional data to Talkable to operate with it inside campaigns                                                                                               |
| [Phone number gating](https://docs.talkable.com/advanced_features/phone_number_gating.md#advanced-features-phone-number-gating)                                     | Collect customers’ phone numbers and sync with ESPs.                                                                                                               |
| [Referrals Approval](https://docs.talkable.com/advanced_features/referrals_approval.md#advanced-features-referrals-approval)                                        | Learn about Talkable Fraud settings, why they are important and how to find a right Fraud Profile that works best for your site.                                   |
| [Segments](https://docs.talkable.com/advanced_features/segments.md#advanced-features-segments)                                                                      | Brings more power and flexibility into segmenting your reporting                                                                                                   |
| [Subscribing to Talkable Iframe events](https://docs.talkable.com/advanced_features/subscribing_to_events.md#advanced-features-subscribing-to-events)               | Subscribe to Talkable Iframe events such as the campaign is loaded or closed and perform some updates to your site based on them.                                  |
| [Setting up Campaign Placement criteria](https://docs.talkable.com/advanced_features/reg_ex.md#advanced-features-reg-ex)                                            | Walking through a Campaign Placement criteria setup that can support multiple matching techniques                                                                  |
| [Using URL Parameters](https://docs.talkable.com/advanced_features/url_parameters.md#advanced-features-url-parameters)                                              | Override some of the parameters right through URL query string                                                                                                     |
| [UTM Tags](https://docs.talkable.com/advanced_features/utm_tags.md#advanced-features-utm-tags)                                                                      | Brings more power and flexibility into segmenting your reporting by UTM tags                                                                                       |
| [White Labeling](https://docs.talkable.com/advanced_features/white_labeling.md#advanced-features-white-labeling)                                                    | Change all visible URLs to your domain instead of talkable.com                                                                                                     |
| [Multi-Currency](https://docs.talkable.com/advanced_features/multi_currency.md#advanced-features-multi-currency)                                                    | Accept multiple currencies and set different rewards per currency                                                                                                  |

* [Coupons](https://docs.talkable.com/advanced_features/coupons.md)
  * [Multi-use Coupons](https://docs.talkable.com/advanced_features/coupons.md#multi-use-coupons)
  * [Single-use Coupons](https://docs.talkable.com/advanced_features/coupons.md#single-use-coupons)
  * [Shopify coupon auto-sync](https://docs.talkable.com/advanced_features/coupons.md#shopify-coupon-auto-sync)
  * [Requirements](https://docs.talkable.com/advanced_features/coupons.md#requirements)
* [Shopify coupon auto-sync](https://docs.talkable.com/advanced_features/shopify_coupons_auto_sync.md)
  * [Get started](https://docs.talkable.com/advanced_features/shopify_coupons_auto_sync.md#get-started)
    * [What is a Discount?](https://docs.talkable.com/advanced_features/shopify_coupons_auto_sync.md#what-is-a-discount)
    * [What attributes will the auto-generated Discount have?](https://docs.talkable.com/advanced_features/shopify_coupons_auto_sync.md#what-attributes-will-the-auto-generated-discount-have)
    * [Why aren’t there any coupons created for my auto-synced list?](https://docs.talkable.com/advanced_features/shopify_coupons_auto_sync.md#why-aren-t-there-any-coupons-created-for-my-auto-synced-list)
  * [Advanced features](https://docs.talkable.com/advanced_features/shopify_coupons_auto_sync.md#advanced-features)
    * [Shopify Discount ID](https://docs.talkable.com/advanced_features/shopify_coupons_auto_sync.md#shopify-discount-id)
    * [Shopify Discount Changed Email Notification](https://docs.talkable.com/advanced_features/shopify_coupons_auto_sync.md#shopify-discount-changed-email-notification)
    * [Coupon list sync](https://docs.talkable.com/advanced_features/shopify_coupons_auto_sync.md#coupon-list-sync)
* [Shopify coupon auto-apply](https://docs.talkable.com/advanced_features/shopify_coupons_auto_apply.md)
  * [Method 1: Coupon application via destination URL](https://docs.talkable.com/advanced_features/shopify_coupons_auto_apply.md#method-1-coupon-application-via-destination-url)
  * [Method 2: Coupon application via client-side library integration](https://docs.talkable.com/advanced_features/shopify_coupons_auto_apply.md#method-2-coupon-application-via-client-side-library-integration)
* [Shopify Purchase Syncing](https://docs.talkable.com/advanced_features/shopify_purchase_syncing.md)
  * [How it works?](https://docs.talkable.com/advanced_features/shopify_purchase_syncing.md#how-it-works)
  * [Shopify Webhook payload and Talkable Purchase attributes mapping](https://docs.talkable.com/advanced_features/shopify_purchase_syncing.md#shopify-webhook-payload-and-talkable-purchase-attributes-mapping)
  * [Post Purchase Campaign setup](https://docs.talkable.com/advanced_features/shopify_purchase_syncing.md#post-purchase-campaign-setup)
* [Referral Tracking Methods](https://docs.talkable.com/advanced_features/track_methods.md)
* [Advocate Personal Coupon Sharing](https://docs.talkable.com/advanced_features/personal_coupon_sharing.md)
  * [Setup](https://docs.talkable.com/advanced_features/personal_coupon_sharing.md#setup)
  * [FAQ](https://docs.talkable.com/advanced_features/personal_coupon_sharing.md#faq)
* [Name Sharing](https://docs.talkable.com/advanced_features/name_sharing.md)
  * [Name Sharing User Flow](https://docs.talkable.com/advanced_features/name_sharing.md#name-sharing-user-flow)
  * [Name Sharing Setup](https://docs.talkable.com/advanced_features/name_sharing.md#name-sharing-setup)
  * [Inline Widget](https://docs.talkable.com/advanced_features/name_sharing.md#inline-widget)
  * [Shopify Fast Checkout](https://docs.talkable.com/advanced_features/name_sharing.md#shopify-fast-checkout)
  * [Interactions with the personal name-share link](https://docs.talkable.com/advanced_features/name_sharing.md#interactions-with-the-personal-name-share-link)
* [Converting Into Localization](https://docs.talkable.com/advanced_features/converting_into_localization.md)
  * [Moving Subject Line Into Localization](https://docs.talkable.com/advanced_features/converting_into_localization.md#moving-subject-line-into-localization)
  * [Color As Localization](https://docs.talkable.com/advanced_features/converting_into_localization.md#color-as-localization)
  * [Image As Localization](https://docs.talkable.com/advanced_features/converting_into_localization.md#image-as-localization)
  * [Custom Option (Configuration) Localization](https://docs.talkable.com/advanced_features/converting_into_localization.md#custom-option-configuration-localization)
* [Customer Service Portal](https://docs.talkable.com/advanced_features/customer_service_portal.md)
  * [Overview](https://docs.talkable.com/advanced_features/customer_service_portal/overview.md)
    * [Logging In](https://docs.talkable.com/advanced_features/customer_service_portal/overview.md#logging-in)
    * [Navigating to the Customer Service Portal](https://docs.talkable.com/advanced_features/customer_service_portal/overview.md#navigating-to-the-customer-service-portal)
  * [Terminology](https://docs.talkable.com/advanced_features/customer_service_portal/terminology.md)
    * [Referral](https://docs.talkable.com/advanced_features/customer_service_portal/terminology.md#referral)
    * [Reward](https://docs.talkable.com/advanced_features/customer_service_portal/terminology.md#reward)
  * [Use case #1: Where do I find referrals?](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_1.md)
    * [Person Lookup](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_1.md#person-lookup)
    * [Referral details](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_1.md#referral-details)
  * [Use case #2: Where is Advocate reward?](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_2.md)
    * [Email delivery](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_2.md#email-delivery)
  * [Use case #3: Who should get the reward?](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_3.md)
    * [Handling customer inquiries](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_3.md#handling-customer-inquiries)
    * [Cross referrals](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_3.md#cross-referrals)
  * [Use case #4: Did my Friend get an email?](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_4.md)
    * [Friend was blocked for self-referral](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_4.md#friend-was-blocked-for-self-referral)
  * [Use case #5: Blocklisting a user](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_5.md)
    * [Adding a user to the blocklist](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_5.md#adding-a-user-to-the-blocklist)
    * [How do I UnBlocklist a user?](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_5.md#how-do-i-unblocklist-a-user)
  * [Use case #6: Creating a referral for an Advocate](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_6.md)
    * [Gathering the info](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_6.md#gathering-the-info)
    * [Creating the referral](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_6.md#creating-the-referral)
    * [Viewing the results of the manually created referral](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_6.md#viewing-the-results-of-the-manually-created-referral)
* [Params Encryption](https://docs.talkable.com/advanced_features/params_encryption.md)
  * [Site public encryption key](https://docs.talkable.com/advanced_features/params_encryption.md#site-public-encryption-key)
  * [Passing email as a GET parameter to Standalone Campaign](https://docs.talkable.com/advanced_features/params_encryption.md#passing-email-as-a-get-parameter-to-standalone-campaign)
  * [Ruby Example](https://docs.talkable.com/advanced_features/params_encryption.md#ruby-example)
  * [Java Example](https://docs.talkable.com/advanced_features/params_encryption.md#java-example)
  * [Node.js Example](https://docs.talkable.com/advanced_features/params_encryption.md#node-js-example)
  * [Front-end Part](https://docs.talkable.com/advanced_features/params_encryption.md#front-end-part)
* [Integrating Events](https://docs.talkable.com/advanced_features/events.md)
  * [Available properties](https://docs.talkable.com/advanced_features/events.md#available-properties)
* [File Encryption](https://docs.talkable.com/advanced_features/file_encryption.md)
  * [How To Import the Talkable Public Key](https://docs.talkable.com/advanced_features/file_encryption.md#how-to-import-the-talkable-public-key)
  * [Encrypting](https://docs.talkable.com/advanced_features/file_encryption.md#encrypting)
  * [Decrypting](https://docs.talkable.com/advanced_features/file_encryption.md#decrypting)
* [Facebook Login & Share](https://docs.talkable.com/advanced_features/facebook_login_share.md)
  * [Overview](https://docs.talkable.com/advanced_features/facebook_login_share.md#overview)
  * [Prerequisites](https://docs.talkable.com/advanced_features/facebook_login_share.md#prerequisites)
  * [Integration Steps](https://docs.talkable.com/advanced_features/facebook_login_share.md#integration-steps)
  * [Creating a Facebook App ID](https://docs.talkable.com/advanced_features/facebook_login_share.md#creating-a-facebook-app-id)
  * [Error Handling](https://docs.talkable.com/advanced_features/facebook_login_share.md#error-handling)
  * [Additional Resources](https://docs.talkable.com/advanced_features/facebook_login_share.md#additional-resources)
* [Report Password Protection](https://docs.talkable.com/advanced_features/report_password_protection.md)
  * [How It Works](https://docs.talkable.com/advanced_features/report_password_protection.md#how-it-works)
* [Including Product Items](https://docs.talkable.com/advanced_features/product_items.md)
* [Pass Custom User Data](https://docs.talkable.com/advanced_features/passing_custom_data.md)
* [Phone number gating](https://docs.talkable.com/advanced_features/phone_number_gating.md)
  * [Synchronization with ESPs](https://docs.talkable.com/advanced_features/phone_number_gating.md#synchronization-with-esps)
* [Referrals Approval](https://docs.talkable.com/advanced_features/referrals_approval.md)
  * [General Approval Policy Recommendations](https://docs.talkable.com/advanced_features/referrals_approval.md#general-approval-policy-recommendations)
* [Segments](https://docs.talkable.com/advanced_features/segments.md)
  * [Segment With Product SKU](https://docs.talkable.com/advanced_features/segments.md#segment-with-product-sku)
  * [Segment With Traffic Source](https://docs.talkable.com/advanced_features/segments.md#segment-with-traffic-source)
  * [Custom Segments](https://docs.talkable.com/advanced_features/segments.md#custom-segments)
* [Subscribing To Iframe Events](https://docs.talkable.com/advanced_features/subscribing_to_events.md)
  * [Iframe Events List](https://docs.talkable.com/advanced_features/subscribing_to_events.md#iframe-events-list)
* [Setting up Campaign Placement criteria](https://docs.talkable.com/advanced_features/reg_ex.md)
* [BHN Rewards (formerly Rybbon)](https://docs.talkable.com/advanced_features/bhnrewards.md)
  * [Overview](https://docs.talkable.com/advanced_features/bhnrewards.md#overview)
  * [Functionality](https://docs.talkable.com/advanced_features/bhnrewards.md#functionality)
  * [Example Usage](https://docs.talkable.com/advanced_features/bhnrewards.md#example-usage)
  * [Limitations](https://docs.talkable.com/advanced_features/bhnrewards.md#limitations)
* [Using URL Parameters](https://docs.talkable.com/advanced_features/url_parameters.md)
* [UTM Tags](https://docs.talkable.com/advanced_features/utm_tags.md)
* [White-labeling](https://docs.talkable.com/advanced_features/white_labeling.md)
  * [How to set up a custom domain](https://docs.talkable.com/advanced_features/white_labeling.md#how-to-set-up-a-custom-domain)
    * [Delegated VS Self-managed setup](https://docs.talkable.com/advanced_features/white_labeling.md#delegated-vs-self-managed-setup)
  * [Adding DNS records](https://docs.talkable.com/advanced_features/white_labeling.md#adding-dns-records)
    * [Email sending issues](https://docs.talkable.com/advanced_features/white_labeling.md#email-sending-issues)
      * [Adding DNS records in AWS Route53](https://docs.talkable.com/advanced_features/white_labeling/aws_route53.md)
      * [Adding DNS records in Shopify](https://docs.talkable.com/advanced_features/white_labeling/shopify.md)
      * [Adding DNS records in GoDaddy](https://docs.talkable.com/advanced_features/white_labeling/godaddy.md)
      * [Adding DNS records in Cloudflare](https://docs.talkable.com/advanced_features/white_labeling/cloudflare.md)
* [Single Sign-On (SSO)](https://docs.talkable.com/advanced_features/single_sign_on.md)
  * [Introduction](https://docs.talkable.com/advanced_features/single_sign_on.md#introduction)
  * [Automatic Configuration](https://docs.talkable.com/advanced_features/single_sign_on.md#automatic-configuration)
  * [Manual Configuration](https://docs.talkable.com/advanced_features/single_sign_on.md#manual-configuration)
  * [Testing Single Sign-On](https://docs.talkable.com/advanced_features/single_sign_on.md#testing-single-sign-on)
* [Multi-currency](https://docs.talkable.com/advanced_features/multi_currency.md)
  * [Passing currency with the purchase or event](https://docs.talkable.com/advanced_features/multi_currency.md#passing-currency-with-the-purchase-or-event)
  * [Incentives for different currencies](https://docs.talkable.com/advanced_features/multi_currency.md#incentives-for-different-currencies)
  * [Preferred currency](https://docs.talkable.com/advanced_features/multi_currency.md#preferred-currency)
    * [Passing visitor’s preferred currency](https://docs.talkable.com/advanced_features/multi_currency.md#passing-visitor-s-preferred-currency)
  * [Currencies on dashboard](https://docs.talkable.com/advanced_features/multi_currency.md#currencies-on-dashboard)
  * [Currencies in reports](https://docs.talkable.com/advanced_features/multi_currency.md#currencies-in-reports)
  * [Shopify discounts](https://docs.talkable.com/advanced_features/multi_currency.md#shopify-discounts)
* [SheerID Integration](https://docs.talkable.com/advanced_features/sheerid.md)
* [Tango Integration](https://docs.talkable.com/advanced_features/tango.md)
  * [How to find the reward ID (UTID)](https://docs.talkable.com/advanced_features/tango.md#how-to-find-the-reward-id-utid)
  * [How to find the Talkable Reward ID (External Reference ID)](https://docs.talkable.com/advanced_features/tango.md#how-to-find-the-talkable-reward-id-external-reference-id)
* [Tremendous Integration](https://docs.talkable.com/advanced_features/tremendous.md)
* [Google Login](https://docs.talkable.com/advanced_features/google_login.md)
  * [Overview](https://docs.talkable.com/advanced_features/google_login.md#overview)
  * [Prerequisites](https://docs.talkable.com/advanced_features/google_login.md#prerequisites)
  * [Integration Steps](https://docs.talkable.com/advanced_features/google_login.md#integration-steps)
  * [Creating a Google API Client ID](https://docs.talkable.com/advanced_features/google_login.md#creating-a-google-api-client-id)
  * [Error Handling](https://docs.talkable.com/advanced_features/google_login.md#error-handling)
  * [Testing and Deployment](https://docs.talkable.com/advanced_features/google_login.md#testing-and-deployment)
  * [Additional Resources](https://docs.talkable.com/advanced_features/google_login.md#additional-resources)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/bhnrewards.md
===============================================================================

# BHN Rewards (formerly Rybbon)

## Overview

This documentation provides a guide on integrating the BHN Rewards (formerly Rybbon) campaign with your Talkable system. By enabling this feature, you can generate gift claim links for users and customize reward amounts based on campaign settings.
> **Note:**
>
> BHN Rewards (formerly Rybbon) app must be installed and enabled for this integration to work.

## Functionality

The BHN Rewards integration allows you to make a claim request within the scope of a specific campaign key and returns a gift claim link.

## Example Usage

1. **Generating a Gift Claim Link**

    Takes a campaign key of a BHN Rewards Talkable campaign to generate a claim link.

```liquid
{{ "a9a3472f4ea858758e0cd686de8408e2" | rybbon }}
```
    This returns a link similar to: https://www.rybbon.net/redeem.php?claimcode=ee645de47765bdbede751c8c6f08a619

2. **Custom Reward Amount for BHN Rewards Campaigns**

    Allows setting a custom reward amount for BHN Rewards campaigns with variable denomination. The minimum amount conforms to specific BHN Rewards gift card restrictions, and the maximum is 50.

```liquid
{{ "a9a3472f4ea858758e0cd686de8408e2" | rybbon: amount: 13.5 }}
```

## Limitations

* Minimum and maximum reward amounts vary based on the specific BHN Rewards gift card settings.

* Custom reward amounts must not exceed the maximum value of 50.

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/converting_into_localization.md
===============================================================================

# Converting Into Localization

If you don’t know what is Localization inside Talkable [read this article](https://docs.talkable.com/campaigns/localization.md#campaigns-localization).

Few benefits you get out of using Localizations:

* It is extremely easy to set up an AB test if your copy is coded up as a Localization.

* For non-technical people it is easier to change the copy inside Localization Editor because they are afraid to code.

1. Visit Campaign Editor:

[Image]

2. Swith to HTML & CSS editor:

[Image]

3. Find a View you would like to convert a static copy at:

[Image]

4. Find a copy that you’d like to convert into a Localization. You can hit Cmd+F (Ctrl+F on Windows) to search within HTML area.

    Static copy is basically a piece of text that sits inside HTML & CSS Editor and usually looks like this:

```html
<h1>
  Get {{ advocate_incentive.description }}.
</h1>
```
    A piece that we are going to extract into Localizations is just a copy, without HTML tags. To do that, simply wrap the text into a variable notation like so:

```html
<h1>
  {{ "advocate_share_page_headline" | localize: "Get [[ advocate_incentive.description ]]." }}
</h1>
```

5. Go back to Editor to see newly created Localization:

[Image]

## Few important things to remember

* Don’t forget to change {{ into [[ inside interpolation variables, otherwise variables will lose its function and become just a plain text.

* Keep in mind that identifier (“advocate_share_page_headline” in the example above) is a campaign-level Localization in fact, always remember to provide unique names for them, otherwise you will be overriding a value of one Localization.
> **Warning:**
>
> Talkable does not allow coding up Localizations within CSS area. If you want to move some CSS property into localizations use inline <style> tag inside HTML area.

## Moving Subject Line Into Localization

It is highly unlikely that your campaign is not equipped with Subject line as a Localization, by default all newly created campaigns at Talkable already have it. In case your campaign does not please keep reading this section.

Subject line is unique because its default value is set on the Advocate Signup/Share Page along with other email sharing fields (email body, reminder checkbox value), not Friend Share email as it might sounded logical. Here is the plan:

1. Create Subject Line as a Localization on the Advocate Signup/Share Page, provide its default value, it will be used inside value attribute of the “subject” form field:

[Image]

```html
<input name="email_subject" type="text" class="textfield" value="{{ 'friend_share_email_subject' | localize: 'Your friend [[ advocate_info.first_name ]] [[ advocate_info.last_name ]] gave you [[ friend_incentive.description ]]' | replace: '   ', ' ' | replace: '  ', ' ' }}" />
```
    This code creates new Localization named “Friend share email subject” that you are able to change on the Advocate Signup/Share Page.

2. Navigate to Friend Share email → Extra fields to see Email Subject field:

[Image]

3. Put the following code in there:

```liquid
{% if custom_message_subject == blank %}
  {{ 'friend_share_email_subject' | localize }}
{% else %}
  {{ custom_message_subject }}
{% endif %}
```
    The code snippet above checks if the Advocate provided any Subject at all. If not we take default Subject copy so Friend Share email does not come with a blank subject.

## Color As Localization

Another example would be localizing font color of a headline, all copy at once, or a background color of a button. You can use color trait of a Localization for that.

1. Navigate to HTML & CSS editor of the View you want to add a color Localization on:

[Image]

2. At the very bottom of the HTML area add `<style></style>` tag with CSS that will override default styling of the element you want to localize:

```text
.button {
  background-color: {{ "advocate_share_page_button_color" | localize: "#f94d08", trait: "color" }};
  border-color: {{ "advocate_share_page_button_color" | localize: "#f94d08", trait: "color" }};
}
```
    In the code example above we created new Color Localization with default HEX color #f94d08 which is used for background-color and border-color CSS properties of .button selector. Whenever you set a new color inside Campaign Editor it will be changed across both places because we’re using the same Localization identifier in both places.

3. New Color Localization appears under “Color” tab inside Campaign Editor:

[Image]

## Image As Localization

Localizing Image asset can be handy if you want to AB test it. Here is how to do that:

1. Navigate to HTML & CSS editor of the View you want to add a color Localization on:

[Image]

2. Inside HTML area find an image you want to localize. An image can be either within CSS or within HTML area (<img />, inline styles, etc.). If the image is set within CSS you need to extract it into HTML area using inline styles:

```text
<div class="container" style="background-image: url('{{ "share_page_background" | localize: "share-page-background.jpg", trait: "asset" }}');">
  ...
</div>
```
    In the example above share_page_background is a name of an Image Localization. share-page-background.jpg is a name of an Asset (Files tab within HTML & CSS Editor).

3. Now we can see newly created Image Localization under “Images” tab:

[Image]

## Custom Option (Configuration) Localization

In addition to localizing Images, Colors, and static copy Talkable allows you to build really advanced Localizations where you can AB test or switch between different visual layouts of campaign Views.

An example can be to create an AB test for Equal Emphasis (all 3 sharing channels look visually equal) vs. Email Emphasis where email sharing form stands out:

[Image]
[Image]

In order to chieve this AB test we need to:

1. Build two separate layouts using CSS cascades to style all nested children within a container block that holds all the content:

```text
{% assign share_page_layout = "share_page_layout" | localize: "Equal Emphasis", "Email Emphasis" %}
<div class="container is-{{ share_page_layout | downcase | split: " " | join: "-" }}">
  ...
</div>
```
    The code above creates a local Liquid variable named share_page_layout and assigns share_page_layout Configuration Localization to it.
Then we optimize the variable value to be set as an HTML class attribute (downcase, replace spaces with hyphens) and set it as a part of a class attribute.

2. Now inside Campaign Editor we can see newly created Configuration Localization:

[Image]

3. Let’s switch back to HTML & CSS editor and start applying CSS styling to both layouts. Knowing their final classes inside HTML: class=”container is-equal-emphasis” and class=”container is-email-emphasis” we can easily style both layouts inside CSS area like so (SCSS is also allowed and is shown as an example for code simplicity):

```scss
.container {
  &.is-equal-emphasis {
    h1 {
      font-size: 48px;
    }
  }

    &.is-email-emphasis {
    h1 {
      font-size: 32px;
    }
  }
}
```
    All other nested children can be styled following this pattern.

4. Once you’re done with styling it is very easy to set up an AB test, just go back to Campaign Editor and click “Add A/B test variant” link. Once a Campaign goes Live it will start rotating both variants following AB test distribution rules (50:50 by default).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/coupons.md
===============================================================================

# Coupons

You can reward Advocate and their Friend with coupons. Talkable supports both
one-time-use coupons as well as multi-use coupons. If you are using one-time-use
coupons there is a need to refill a list of coupons within Talkable. You will need
to export a list of coupons or provide a multi-use coupon code creation endpoint.

## Multi-use Coupons

Multi-use Coupons can be given to Talkable customers as a reward by create an Incentive with reward type “Coupon”.
It can be done from Campaign Rules page.

Multi-use coupon will be given to any customer that perfomed action that matcher Incentive Reward Criteria.

## Single-use Coupons

In case you want to give a unique coupon to each customer, you may attach a coupon list to campaign incentive.
In this case each, customer will receive unique coupon code from the pool available in coupon list.

There are several steps that need to be taken for this scenario:

1. Create a coupon list at `All reports → Coupon Lists` page

2. Generate a list of coupons on the merchant site using mass coupon generation tool. Check the [Requirements](#requirements) section before generating coupons.

3. Upload generated coupons to coupon list

4. Use a coupon list in the Incentive with “Coupon Code” reward type

## REST API to Create Coupons

Talkable can create coupons via a webhook using your REST API endpoint.
Read [Create Coupon Webhook Documentation](https://docs.talkable.com/web_hooks/create_coupon.md#web-hooks-create-coupon) for implementation details.

## Shopify coupon auto-sync

Read [Shopify coupon auto-sync documentation](https://docs.talkable.com/advanced_features/shopify_coupons_auto_sync.md#advanced-features-shopify-coupons-auto-sync) for details.

## Requirements

Coupons should be unique and 3 to 255 characters long.
All coupons would be converted to uppercase, consider that during code generation, `fr_coupon` and `FR_COUPON` would be equal.

Only the following characters are allowed in a coupon code:

```text
A-Z 0-9 - _ / . % : * + @ & #
```

> **Note:**
>
> Spaces are forbidden.

Try to avoid ambiguous characters. This simple solution generates a string of easily readable characters for activation codes.
We do not want people confusing 8 with B, 1 with I, 0 with O, L with 1, etc.

```ruby
# Generates a random string from a set of easily readable characters
def generate_activation_code(size = 6)
  charset = ["2", "3", "4", "6", "7", "9", "A", "C", "D", "E", "F", "G", "H", "J", "K", "M", "N", "P", "Q", "R", "T", "V", "W", "X", "Y", "Z"]
  (0...size).map { charset[rand(charset.size)] }.join
end
```

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/customer_service_portal.md
===============================================================================

# Customer Service Portal

Explore full details for each individual customer and their referral journey, manage their rewards and deliver
excellent customer service.

Contents:

* [Overview](https://docs.talkable.com/advanced_features/customer_service_portal/overview.md)
  * [Logging In](https://docs.talkable.com/advanced_features/customer_service_portal/overview.md#logging-in)
  * [Navigating to the Customer Service Portal](https://docs.talkable.com/advanced_features/customer_service_portal/overview.md#navigating-to-the-customer-service-portal)
* [Terminology](https://docs.talkable.com/advanced_features/customer_service_portal/terminology.md)
  * [Referral](https://docs.talkable.com/advanced_features/customer_service_portal/terminology.md#referral)
  * [Reward](https://docs.talkable.com/advanced_features/customer_service_portal/terminology.md#reward)
* [Use case #1: Where do I find referrals?](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_1.md)
  * [Person Lookup](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_1.md#person-lookup)
  * [Referral details](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_1.md#referral-details)
* [Use case #2: Where is Advocate reward?](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_2.md)
  * [Email delivery](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_2.md#email-delivery)
* [Use case #3: Who should get the reward?](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_3.md)
  * [Handling customer inquiries](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_3.md#handling-customer-inquiries)
  * [Cross referrals](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_3.md#cross-referrals)
* [Use case #4: Did my Friend get an email?](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_4.md)
  * [Friend was blocked for self-referral](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_4.md#friend-was-blocked-for-self-referral)
* [Use case #5: Blocklisting a user](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_5.md)
  * [Adding a user to the blocklist](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_5.md#adding-a-user-to-the-blocklist)
  * [How do I UnBlocklist a user?](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_5.md#how-do-i-unblocklist-a-user)
* [Use case #6: Creating a referral for an Advocate](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_6.md)
  * [Gathering the info](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_6.md#gathering-the-info)
  * [Creating the referral](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_6.md#creating-the-referral)
  * [Viewing the results of the manually created referral](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_6.md#viewing-the-results-of-the-manually-created-referral)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/customer_service_portal/overview.md
===============================================================================

# Overview

## Logging In

Once you are logged into your Talkable account, navigate to the Customer Service Portal in the top navigation.

[Image]

## Navigating to the Customer Service Portal

The Customer Service Portal provides a simple search box that will allow you to search by several criteria:

* **Email**: the email of the user.

* **Phone number**: the phone number of the user. The search value should include a country code.
If no county code is given, Talkable will try applying the USA and Canada codes and search with the resulting number.

* **Order number**: the order number of a purchase.

* **Coupon code**: the single-use coupon code issued as a reward to a referral program user.

* **Personal coupon code**: the [personal coupon code](https://docs.talkable.com/advanced_features/personal_coupon_sharing.md#advanced-features-personal-coupon-sharing), shared by an Advocate

The search query might produce multiple results. In such case, every matched user will be listed,
showing some personal info (email and phone number) and, if present, other matched fields (i.e. order number and/or coupon code).
To see more personal details, select a user from the list.

Example of Customer Service Portal person lookup:

[Image]

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/customer_service_portal/terminology.md
===============================================================================

# Terminology

## Referral

This is a connection between an Advocate and a Friend who completed a referral purchase from the
Advocate’s invite (a share). A referral will not be created unless the following 3 pieces are known: Advocate Email,
Friend Email, and a Purchase made by a Referred Friend. Each referral is passed through several fraud checks
(configured inside Fraud Settings). As a result of the fraud checks each referral status can be:

1. **In progress**: Talkable referral engine is processing the referral. Such action usually takes less than a second
so it is highly unlikely that you will see this status. No rewards are issued at this point.

2. **Pending**: a referral is pending approval. Talkable referral engine approves pending referrals automatically
with a delay set under fraud settings. A user can also approve a referral manually until the auto-approval happens.
Thus, if the referral fraud checks were passed successfully each referral will eventually become approved.
No rewards are issued up until approval.

3. **Flagged**: due to having many different options to configure referral fraud checks,
it is not always possible to set up an automatic resolution for each referral.
For such cases, you may want to Flag referrals that are in a so-called grey area,
where the chance of fraud is around 50% and it is impossible to make the decision automatically.
All flagged referrals are added to a queue and can be accessed inside CSP → Referrals.
No rewards are issued at this point. All flagged referrals will be automatically resolved
to either voided or approved status, depending on the fraud settings configuration.
It is recommended to void flagged referrals automatically so you can only approve valid ones manually.
As a result this can save lots of time as most flagged referrals are rather suspicious than valid.

4. **Approved**: this is a valid referral status which either gets set by the Talkable referral engine
or by a user. Flagged referrals can also turn to approved. All rewards associated
with the referral are then passed to the next stage to verify if they
can be issued.

5. **Voided**: this status is set by a user manually if they decide a referral is invalid and there should be no
rewards issued as a result. Only pending and flagged referrals can be voided. Talkable referral engine cannot set
this status automatically. All rewards associated with the referral are getting blocked as a result.

6. **Blocked**: when some fraud checks are failed Talkable referral engine blocks the referral immediately. All rewards
associated with the referral are getting blocked as a result.

## Reward

This is what the person gets as a result of some action (incentive). Available reward statuses:

* **Pending**: the reward is awaiting referral approval.

* **Waiting for coupon**: there are not enough coupons left to pay the reward. The reward will remain in a ‘waiting’
status until more coupons are uploaded into the associated coupon list.

* **Given**: the reward was paid to the person but Talkable does not have information as to whether it was used or not.
Most likely it was not yet used.

* **Voided**: the reward was voided because the referral was voided by a user manually.

* **Blocked/No reward**: there was no reward created either because the associated referral was blocked according to
Fraud Settings or because of other reasons: incentive criteria has blocked it, or the person was blocklisted.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/customer_service_portal/use_case_1.md
===============================================================================

# Use case #1:   Where do I find referrals?

## Person Lookup

When a customer calls in, often their first question is: “I’ve referred my Friend but haven’t received my reward.”

The first step is to check to see if the referral exists in our system, which can be done simply by entering Advocate
or Friend’s email inside Person Lookup.

In this example Stephanie (Advocate), `stephanie***@ganleywestside.com`, has called in to check on the status of her
reward for referring her Friend Levi `*****levi@yahoo.com`.

Here are the steps we’re going to take:

1. Enter in Stephanie’s email address and press ‘Search’.

2. Scroll down and see if we see a referral for her Friend Levi.

3. See if the reward has qualified, when it qualified, and if she should have received an
email.

[Image]

(After entering in Stephanie’s email the screen populates with information associated with her email address.)

## Referral details

[Image]

(Notice that the screen is divided into 2 main sections. The bottom section has 7 tabs referencing additional
sections. We’ll get to those later. For now, we’re interested in “Referrals” and want to scroll down to find Levi,
and see what’s happening with that referral. Click on “Details”.)

Here’s a closeup on Levi’s record:

[Image]

What we discovered: the referral is valid because there was no fraud detected, meaning that Stephanie and Levi are
different people. We can also see that Levi used the coupon code at checkout.

Let’s also expand fraud filters section to check the details:

[Image]

This looks like a valid referral. Let’s move on to [Use case #2](https://docs.talkable.com/advanced_features/customer_service_portal/use_case_2.md#advanced-features-customer-service-portal-use-case-2).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/customer_service_portal/use_case_2.md
===============================================================================

# Use case #2:   Where is Advocate reward?

Advocates will receive an email with their reward for each qualified Friend they refer. In most cases this email will
contain a coupon or gift card code that the Advocate can redeem. In order to check on the status of a particular
reward, all we have to do is see if the email has been sent to the Advocate.

Here are the steps we will take:

1. Enter in Stephanie’s email (if not entered already).

2. Navigate to “Emails” tab.

3. Look for “Advocate Reward Paid Email”.

4. Click on Details.

5. Provide information to the customer from the details page.

[Image]

## Email delivery

Navigate to ‘Emails’ tab after entering in Stephanie’s email. The “Emails” tab shows all emails sent to the Advocate
about the referral program. Look for the “Advocate Reward Paid Email”. There may be multiple emails like this.

[Image]

To ensure we find the desired email we need to go back to the referral details and see a referral approval date:

[Image]

Navigating back to the “Emails” tab. Look for “Advocate reward paid email” from the same campaign that the referral dated
04/16/2015 or a few days later. There is a suitable email with status ‘Clicked’ 04/17/2015:

[Image]

Click on ‘Details’ and compare the referral creation date with the email created date to ensure that we found
the desired email:

[Image]

In this case we can see the email was delivered and that the Advocate successfully opened the email and clicked
through on the CTA inside the email.

There may be cases when the delivered status has a timestamp, however the opened status is blank. It will mean that the
recipient has not yet opened the email. In this case you would instruct the user to search their inbox and see if
they can find the email. You can also tell them the email address in the “From” field which may help them
in their search.

If they still can’t find the email you may click the “Resend now” button on the email ‘Details’ page and the same
email will be sent to the recipient email again.

Here is what email statuses mean:

* **Sent**: Talkable was able to compose an email and pass it to the Talkable ESP to prepare for delivery.

* **Delivered**: Talkable ESP was able to send an email to the recipient (Stephanie).

* **Opened**: Stephanie has opened the email.

* **Clicked**: Stephanie has clicked on the CTA inside the email.

* **Scheduled**: the email will be sent on a specified date.

* **Rejected**: the email was rejected by some reason.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/customer_service_portal/use_case_3.md
===============================================================================

# Use case #3:   Who should get the reward?

Talkable does not issue a reward in all referral cases. There may be numerous reasons why a reward is not issued to
an Advocate or Friend. The easiest way to find out the reward status is by visiting the Referrals tab:

[Image]

Navigating to each referral ‘Details’ page we can find out the status for each reward. Reason near the reward
status explains why the reward was not given.

[Image]

Every reward has the following possible statuses:

* **Pending**: the reward is awaiting referral approval. The referral can either be approved manually or automatically,
depending on your configuration. If the referral status is Pending you may wait until the referral auto-approval
happens. Otherwise please press “Void” or “Approve” button in the referral actions section, to either block or issue
the reward.

* **Waiting for coupon**: there are not enough coupons left to pay the reward. Click on the reward link → Incentive
type → Remember the coupon list chosen → Manage coupon lists → Find the desired coupon list and press “Add coupons”.

* **Given**: the reward was paid to the person but Talkable does not have information whether it was used or not.
Most likely it was not yet used.

* **Voided**: the reward was voided because the referral was voided by a user manually.

* **Blocked/No reward**: the reward was blocked either because the associated referral was blocked according to
Fraud Settings or because of other reasons: incentive criteria has blocked it, or the person was blocklisted.

[Image]

(All incentive criteria are defined in Campaign Rules → Incentives. See reward criteria section.)

Here are some common incentive criteria block reasons:

* **Friend didn’t meet minimum purchase requirement**. On a screenshot above Friend’s referral purchase subtotal
should be over $20. The incentive criteria will block Advocate’s reward in case Friend’s order subtotal will
be less (post discount).

* **Friend’s offer was expired**. Based on Campaign Rules setup, Friend’s offer may expire after a certain period
of time. Most likely the Friend received their coupon code by visiting a share link and then decided to save their
discount for later. If Friend makes a purchase after their offer expires (using that coupon) the Advocate will not
get a reward.

* **Friend is not a new customer**. Friend was an existing customer (> 1 purchase tracked) while making their referral
purchase, however the incentive configuration only allows referring new customers.

* **Friend has already been referred**. The Advocate has already referred this Friend before but the incentive
configuration only allows referring the same Friend only once.

Other reasons why a reward can be blocked (not incentive related):

* **Advocate has reached maximum rewards**. This is because Talkable has set a threshold for the maximum number of
rewards that an Advocate can receive. The Friend may be rewarded in this case (as in the example above),
but not the Advocate.

* The associated referral was blocked/voided for self/cross referral.

## Handling customer inquiries

Here is how to detect self-referrals in case you’ve got an email/call from a customer:

1. Enter the customer’s email address in the Person Lookup.

2. Review the “Referrals” tab and look for a “self-referral” alert:

[Image]

3. Inspect the customer’s email address to see if it’s the same or similar to the Friends; you can also inspect inside the referral details the IP address and cookie to see if they match:

[Image]

4. If it’s not obvious why the customer was flagged for self-referral (meaning that none of these three items matched),
then you should click “Details” to dive deeper.

5. Inspect to see if any other “blocked reasons” appear. In the below case, we see that not only do the email addresses
match, but there was also a matching cookie on the Friend purchase (meaning they used the same browsing session to both
share as an Advocate and click on the share link as a Friend), and lastly, there’s a matching combination of IP address
and user agent - meaning the Advocate and Friend were using the same device and IP address, in combination.

[Image]

## Cross referrals

The last use case is when an Advocate has not received his or her reward due to **Cross Referral**. Cross referral
occurs when an Advocate shares with a Friend who purchases and that same Friend then shares with an Advocate
in an attempt to get both the Advocate and Friend rewards.

We identify this in the same way as described above.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/customer_service_portal/use_case_4.md
===============================================================================

# Use case #4:   Did my Friend get an email?

To investigate if the Advocate’s Friend has got an email, we’ll need to have their Friend’s email. All Advocate shares
are located inside “Shares” tab:

[Image]
[Image]

In this case we can see that the Friend received the email, opened it, and clicked through.

[Image]

If the Friend did not open the email you will see 0 in the ‘Friends’ tab.

There also can be a case when an Advocate share has several Friends and clicks:

[Image]

‘Friends’ column displays the number of Friend offers created per each share. ‘Clicks’ column displays the number
of Friend clicks per each share. The numbers may be different in case:

1. Multiple Friend offers may be created if one Friend forwarded their email to another person.

2. One individual Friend may click multiple times on the same share link.

Note: for email shares Friend offers are created upon each share while for other sharing channels only whenever
Friends click on the share link.

Clicking on details opens “Friend Offers” page where we can see all Friend offers generated in a
scope of the particular Advocate share.

The same logic works for other sharing channels such as ‘Direct link’, ‘Facebook’, ‘SMS’ etc.

## Friend was blocked for self-referral

Again, the above only references valid cases where the Friend should have in fact received a reward. The alternative
cases are listed below where Talkable identified that a Friend may be trying to game the system and therefore did NOT
allow them to use the Friend coupon code.

The most common case is that a **Friend was blocked/flagged for self-referral**. As with the case of the Advocate, we
find that the most vocal customers are typically trying to game the system.

To validate this use case simply lookup for the Friend’s email address and browse through referrals to see
flagged/blocked ones. We see that the blocked reason in this case is “Matching email”, in some cases it may be
“Similar email match”:

[Image]

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/customer_service_portal/use_case_5.md
===============================================================================

# Use case #5:   Blocklisting a user

Occasionally you may want to blocklist a user or a group of users from participating in the program. This may happen
if you discover that a user is posting links to a discounting coupon site or posting without your permission
on social media pages.

To blocklist a user, first navigate to the “Blocklist” section of the Customer Service Portal:

[[Image]](https://docs.talkable.com/_images/blocklist.png.md)

## Adding a user to the blocklist

[[Image]](https://docs.talkable.com/_images/adding_blocklist.png.md)

(We support adding users to a blocklist using two methods, by Email or by IP address. To add an email to the
blocklist, just enter the email into the “Blocked emails” field and press “Save Changes”. Note that emails are
not separated by comma, but are new line delimited.)

We also have additional features that enable you to disqualify more IP addresses or emails.

[Image]

(You can add a single IP address or an entire range of IP addresses.)

[Image]

(We can also blocklist by subnet mask - in this case please ask a Talkable rep for more details.)

Email blocklisting is easy! Just enter the email address into the list and hit “Save Changes”.

Notice we support wildcard so if you notice a pattern of abuse you can explicitly disallow users who match that
email address as well.

## How do I UnBlocklist a user?

If you realize that you made a mistake in Blocklisting a user who should actually be receiving rewards,
all you have to do to take a user off the blocklist is to delete their email or IP from the list and then hit
“Save Changes” again. It’s that easy.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/customer_service_portal/use_case_6.md
===============================================================================

# Use case #6:   Creating a referral for an Advocate

This example shows how to create a referral reward for some Advocate. A common customer service inquiry comes
from an Advocate who is wondering why they didn’t receive their referral reward. This example shows you how to manually
create a reward for this Advocate.

## Gathering the info

In order to create a referral you need to know:

1. The Advocate’s email address.

2. Some campaign the Advocate participated in.

To find (2) Advocate’s participating campaign:

1. Enter the Advocate’s email address into the Person Lookup.

2. Navigate to “Offers” tab to see the participating campaigns.

3. Remember the Advocate’s Email and Campaign for Part 2.

[Image]

## Creating the referral

Now that you know the Advocate and a campaign they have participated in, you are now able to create a referral
with this information:

1. Visit “Create referral” section.

2. Paste Advocate email into the “Advocate’s email” field.

3. Provide some valid order subtotal (there is a chance the reward may be blocked due to low subtotal amount,
you can either set it pretty high or check Campaign Rules → Incentives → Advocate referral incentive
criteria beforehand).

4. Choose the campaign. You can paste its name from the step 6.1 in the campaigns search bar and the requested
campaign will appear immediately.

5. Press “Create Referral” button.

[Image]

## Viewing the results of the manually created referral

After creating the referral manually you will be taken to the newly created referral details page:

[Image]

Advocate reward may be blocked due to incentive criteria, make sure to check the Advocate’s reward status as shown
on the screenshot above.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/events.md
===============================================================================

# Integrating Events

In addition to running a referral campaign around regular [purchases](https://docs.talkable.com/integration/standard/integration_components.md#integration-standard-integration-components-post-purchase-script),
Talkable also supports custom events that can be split into multiple categories and be used to set up advanced campaign rules.

An example of such integration can be a subscription-based business that also supports
one-time purchases. A referral campaign example can be: Advocate and Friend both get
$5 off discount on one-time purchases, and $15 off when purchasing a subscription plan.

In this case, the subscription purchases and the one-time purchases should be
integrated as separate events under different event categories: “subscription” and
“purchase”. All events should be passed to Talkable, including recurring events.
Talkable’s backend referral engine runs each event through several checks to identify
whether the event was associated with a referral or not. With both “subscription” and
“purchase” events being passed to Talkable, we are then able to set up referral campaigns
to report on and reward these events as desired. See some examples below.

Subscription payments should be registered under the “subscription” event category. All such events
can be found in the Reports → Events section of your Talkable Dashboard. Here is an example:

```html
<!-- Begin Talkable integration code -->
<script>
  window._talkableq = window._talkableq || []
  window._talkableq.push(['register_event', {
    event: {
      event_category: 'subscription',
      event_number: 'ev1938579813',
      subtotal: '89',
      coupon_code: 'SAVE20'
    },
    customer: {
      email: 'customer1@example.com'
    }
  }]);
</script>
<!-- End Talkable integration code -->
```

> **Note:**
>
> Please make sure you’ve added [Talkable Initialization Script](https://docs.talkable.com/integration/standard/integration_components.md#integration-standard-integration-components-initialization-script) to your header or any template spanning every page.

One-time purchases should go under the “purchase” event category. You can find all purchases
in the Reports → Purchases section of your Talkable Dashboard. Here is an example:

```html
<!-- Begin Talkable integration code -->
<script>
  window._talkableq = window._talkableq || []
  window._talkableq.push(['register_event', {
    event: {
      event_category: 'purchase',
      event_number: 'ev1938579814',
      subtotal: '34.5',
      coupon_code: null
    },
    customer: {
      email: 'customer2@example.com'
    }
  }]);
</script>
<!-- End Talkable integration code -->
```

> **Note:**
>
> All recurring subscription purchases should be passed to Talkable as well, to ensure
> data integrity. If recurring transactions occur on the backend, follow the
> [Origin API](https://docs.talkable.com/api_v2/origins.md#api-v2-origins) (see “Create an event” section).

## Available properties
> **Note:**
>
> All PII params support data encryption. Find more about [Params Encryption](https://docs.talkable.com/advanced_features/params_encryption.md#advanced-features-params-encryption).

Here is a list of available properties each event can include:

| Property               | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **event**              | An event data:<br>     **event\_category** (required) – a category under which the event should be tracked. Only alpha-numeric characters and underscores are allowed. Minimum length – 5 characters.     Example: `'subscription'`.<br>**event\_number** (required) – any alpha-numeric characters. Each event should have a unique event number, duplicate events will not be saved.     Example: `'18934671af'`.<br>**subtotal** (optional) – event subtotal. Any valid positive number (including floats) or 0 are allowed. Preferably it should be passed as a string to avoid JavaScript issues with rounding floats.     Example: `'198.5'`.<br>**coupon\_code** (optional) – a coupon code that was applied to this event.     Example: `'SAVE20'`. You can also pass multiple coupons as an array: `['SAVE20', 'SAVE5']` if they were stacked.<br>**currency\_iso\_code** (optional) - Currency ISO code is required for multi-currency sites.     Example: `'USD'`.<br>**shipping\_address** (optional) – Shipping address in case an event is shippable. It is used in fraud prevention.     Example: `'475 Valencia St, 2nd Floor, San Francisco, 94103, USA'`.<br>**shipping\_zip** (optional) – Same as **shipping\_address**. Include only zip here.     Example: `94103`. |
| **customer**           | A person who issued an event:<br>     **email**. (required)     Example: `'customer@example.com'`.<br>**first\_name** (optional).     Example: `'John'`.<br>**last\_name** (optional)     Example: `'Smith'`.<br>**traffic\_source** (optional) - specific [Traffic Source](https://docs.talkable.com/advanced_features/segments.md#advanced-features-segments) value that helps to distinguish different points of integration.     Example: `'facebook'`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **campaign\_tags**     | Campaign tags are used to manually choose which campaign to show once the event has been tracked successfully (optional).<br>Each Talkable campaign supports multiple tags, you can list them as an array: `['tag1', 'tag2']`.<br>You can control campaign tags inside Campaign Rules. Each Talkable campaign can have different tags.<br>Alternatively, you can use [Campaign Placements](https://docs.talkable.com/campaigns/campaign_placements.md#campaigns-campaign-placements) feature to set up routing in your Talkable Dashboard instead of controlling it through the JS integration on your end. Campaign Placements are easy to change, no code changes are needed on your end.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **custom\_properties** | Custom key-value data that can be attached to a person (optional). It can be used for segmentation for example: you can code up custom criteria to show relevant campaigns to each segment. Alternatively, custom properties can be used for an advanced referral reward logics. Any valid JS object is allowed. Object value should always be a string.<br>Example: `{ key1: 'value1', key2: 'true' }`. [Learn more](https://docs.talkable.com/advanced_features/passing_custom_data.md#advanced-features-passing-custom-data).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/facebook_login_share.md
===============================================================================

# Facebook Login & Share

## Overview

This documentation provides a comprehensive guide on connecting your Facebook App for Login & Share in Talkable.
> **Note:**
>
> In case you don’t have the Talkable Facebook app installed, users can still log in and share via Facebook, but Talkable’s default Facebook app will be used.

## Prerequisites

Before you begin, ensure you have the following:

* Access to the Facebook Developer Console.

* A Facebook App ID.

## Integration Steps

1. **Install Facebook App from Talkable Apps Store**

  * Navigate to the Talkable Apps Store.

  * Install the Facebook app.

  * Enter your custom Facebook App ID in the provided field. If left blank, Talkable’s default Facebook App ID will be used.

  * You can find your App ID in the Facebook Developer Console.

  * Ensure the Valid OAuth Redirect URIs of your App ID include Talkable’s domain (www.talkable.com) and your custom web domain if set up.

  * Example App ID format: 1234567890

  * Save the changes.

2. **Activate the Facebook Login & Share App**

  * Toggle the activation switch to enable the Facebook Login & Share app.

  * The app is now active, allowing users to log in and share content via Facebook using your Facebook App instead of the default Talkable Facebook App.

## Creating a Facebook App ID

1. **Access Facebook Developer Console**

  * Go to the [Facebook Developer Console](https://developers.facebook.com/).

  * Create a new project or select an existing project.

2. **Configure OAuth Consent Screen**

  * Navigate to the App settings.

  * Fill in the necessary details and save the configuration.

3. **Create App ID**

  * Go to the App Dashboard.

  * Click on “Create App” and select the appropriate permissions for your app.

  * Add Valid OAuth Redirect URIs, including:

    * https://www.talkable.com

    * Your custom domain, if applicable.

  * Save and copy the generated App ID.

## Error Handling

Common errors and how to handle them:

* **Invalid App ID**: Ensure the App ID is correctly entered and is active in the Facebook Developer Console.

* **Authorization Errors**: Verify that the Valid OAuth Redirect URIs include the necessary domains.

* **Network Issues**: Retry the request or check your network connection.

## Additional Resources

* Facebook Developer Console: [https://developers.facebook.com/](https://developers.facebook.com/)

* Facebook Login Documentation: [https://developers.facebook.com/docs/facebook-login](https://developers.facebook.com/docs/facebook-login)
> **Note:**
>
> For detailed examples and advanced usage, refer to the official Facebook documentation.

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/file_encryption.md
===============================================================================

# File Encryption

For encrypting sensitive data when sending it through the Internet, you can use
PGP encryption. It is a public key encryption program that has become the most
popular standard for email encryption. PGP uses a private key that must be kept
secret and a public key that the sender and receiver must share.

In the example below, we will use GPG (GNU Privacy Guard), which is a complete
and free implementation of the OpenPGP standard. If you do not have GPG setup
yet, first follow the instructions under “Set Up GPG Keys” in this tutorial: [How To Use GPG to Encrypt and Sign Messages](https://www.digitalocean.com/community/tutorials/how-to-use-gpg-to-encrypt-and-sign-messages#set-up-gpg-keys).
Also, you can find a brief list of software that has PGP capability [here](https://www.openpgp.org/software/).

## How To Import the Talkable Public Key

Before encrypting or decrypting you should import the Talkable public key.
Here is a command to do it:

```shell
curl https://d2jjzw81hqbuqv.cloudfront.net/integration/talkable_public_key.asc | gpg --import
```
To check that the Talkable public key importing was done right, make sure that
the next command is successful:

```shell
gpg --list-keys dev@talkable.com
```

## Encrypting

To encrypt data, you can use the following syntax:

```shell
gpg --encrypt --sign --armor -r dev@talkable.com name_of_file
```
This encrypts data using the Talkable public key and signs it with your own
private key to guarantee that it is coming from you. Encrypted files will have the
same name as the input files, but with an `.asc` extension. After this, you can
safely send the encrypted file to Talkable. Make sure to send us the public key
as well.
> **Note:**
>
> You should include a second `"-r"` recipient with your own email address if
> you want to be able to read the encrypted message.

## Decrypting

To decrypt a file simply call GPG on it:

```shell
gpg file_name.asc
```

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/google_login.md
===============================================================================

# Google Login

## Overview

This documentation provides a comprehensive guide on integrating the Google Sign-In app into your Talkable system. By enabling this app, users can sign in using their Google accounts, enhancing security and reducing login friction.
> **Note:**
>
> In case you don’t have the Talkable Google Sign-In app installed, users can still log in via Google in your Campaign, but Talkable credentials will be used for the OAuth flow.

## Prerequisites

Before you begin, ensure you have the following:

* Access to Google API Console.

* A Google API Client ID (if you want to use a custom Client ID).

## Integration Steps

1. **Install Google Sign-In App from Talkable Apps Store** - Navigate to the Talkable Apps Store.
- Install the Google Sign-In app.
- You will see an option to enter your custom Google Client ID. If left blank, Talkable’s default Google identifier will be used.

2. **Configure Google Sign-In Settings** - Go to the Google Sign-In app settings page.
- Enter your custom Google Client ID in the provided field.
- You can find your Client ID in the Google API Console.
- Ensure the Authorized JavaScript origins of your Client ID include Talkable’s domain (www.talkable.com) and your custom web domain if set up.
- Example Client ID format: 123.apps.googleusercontent.com - Save the changes.

3. **Activate the Google Sign-In App** - Toggle the activation switch to enable the Google Sign-In app.
- The app is now active, and users can use their Google accounts to sign in.

## Creating a Google API Client ID

1. **Access Google API Console** - Go to the [Google API Console]([https://console.developers.google.com/](https://console.developers.google.com/)).
- Create a new project or select an existing project.

2. **Configure OAuth Consent Screen** - Navigate to the OAuth consent screen configuration.
- Fill in the necessary details and save the configuration.

3. **Create OAuth 2.0 Client ID** - Go to the Credentials page.
- Click on “Create Credentials” and select “OAuth 2.0 Client ID”.
- Configure the application type as “Web application”.
- Add Authorized JavaScript origins, including:
- https://www.talkable.com - Your custom domain, if applicable.
- Save and copy the generated Client ID.

## Error Handling

Common errors and how to handle them:

* **Invalid Client ID**: Ensure the Client ID is correctly entered and is active in the Google API Console.

* **Authorization Errors**: Verify that the Authorized JavaScript origins include the necessary domains.

* **Network Issues**: Retry the request or check your network connection.

## Testing and Deployment

* **Testing**: Use a test account to verify that the Google Sign-In works correctly with your custom Client ID.

* **Deployment**: Once testing is complete, ensure that all configurations are saved and the app is activated.

## Additional Resources

* Google API Console: [https://console.developers.google.com/](https://console.developers.google.com/)

* OAuth 2.0 Documentation: [https://developers.google.com/identity/protocols/oauth2](https://developers.google.com/identity/protocols/oauth2)
> **Note:**
>
> For detailed examples and advanced usage, refer to the official Google OAuth 2.0 documentation.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/multi_currency.md
===============================================================================

# Multi-currency

By default, Talkable works in a single-currency mode. The main currency is chosen during the account setup.

However, the multi-currency mode can be enabled for a site. In multi-currency mode, the referral campaigns allow
Advocates and Friends to choose their preferred currency, and the incentives can be configured to offer different
rewards based on the preferred currency. Every purchase and/or event should have a currency specified.
The dashboard and reports can be filtered by currencies, and the values can be converted to a currency of your choice.
> **Note:**
>
> Please contact your Customer Success Manager to enable multi-currency. Note that in this mode,
> the integration should pass currency data with every purchase.

## Passing currency with the purchase or event

Currency is required to be specified if multi-currency mode is enabled for a site.

Please pass the currency using the currency_iso_code argument to the register_purchase function.
The code must be in [ISO 4217 format](https://www.iso.org/iso-4217-currency-codes.html), e.g. “USD”.

[More on the integration of purchases](https://docs.talkable.com/integration/standard/integration_components.md#integration-standard-integration-components-post-purchase-script)

## Incentives for different currencies

In multi-currency mode, the following incentive details can be configured per currency:

* incentive amount

* coupon list or multi-use coupon

* subtotal minimum and maximum

A reward for an Advocate or a Friend will be issued based on their preferred currency. If none specified,
the main site currency will be used.

[Image]

## Preferred currency

Talkable allows storing an Advocate’s or Friend’s preferred currency. The selected currency can be accessed in [Liquid](https://github.com/Shopify/liquid) in the [[ preferred_currency ]] variable.

[Image]

### Passing visitor’s preferred currency

If the preferred currency of the visitor is known, it can be passed as customer data to render the referral campaign
with the currency pre-selected:

```javascript
_talkableq.push(['authenticate_customer', {
  email: '',
  currency: 'AUD' // Currency should be an international 3-letter code as defined by the ISO 4217 standard
}]);
```
Currency can also be provided directly in any of the following function calls,
overriding the authenticate_customer data:

* register_affiliate

* register_purchase

* register_event

For example:

```javascript
var _purchase_data = {
  purchase: {
    order_number: '',
    subtotal: '',
    currency_iso_code: 'AUD' // currency of the purchase
  },
  currency: 'AUD', // preferred currency of the person, used to show suitable incentive information in the campaign
};
_talkableq.push(['register_purchase', _purchase_data]);
```

> **Note:**
>
> Passing currency is available in integration version 5.2.1 or higher.

## Currencies on dashboard

Dashboard tiles have two helpful configuration options for multi-currency setup:

* filter events by currencies (“Segment Currency”)

* convert all amounts to one currency (“Reporting Currency”)

[Image]

> **Note:**
>
> Conversion rate for a specific currency is actualized daily (data taken from [open exchange rates](https://openexchangerates.org)) and cached for the accuracy of historical data.
> So a purchase amount is converted according to its creation date’s conversion rate.

## Currencies in reports

Several tools can be used for multi-currency sites to make reporting more flexible.

Available options in **Metrics Aggregation Report**:

* segmentation by currencies

* filter by the currency of the purchase/event

* select specific segment currency

[[Image]](https://docs.talkable.com/_images/multi_currency_mar.png.md)

> **Note:**
>
> Leave ‘Reporting Currency’ blank to convert every metric to site’s default currency unless segmentation by currency is selected.

Available options in **Purchases** and **Events** reports:

* filter by the currency of the purchase/event

* select a currency to convert the amounts to
> **Note:**
>
> The options list in the currency filter consists of all the currencies passed to Talkable
> along with the purchases/events. If you can’t find a currency in the list, it means Talkable never received
> a purchase/event with such currency.

## Shopify discounts

At checkout, Shopify converts these fixed-amount discounts into the customer’s local currency using the store’s
defined currency settings. The conversion adheres to the exchange rates Shopify provides, ensuring customers see
discounts in their familiar currency, enhancing transparency and trust during international transactions.

For example:
> A fixed discount of **$10 USD** will display as **€9 EUR** if the conversion rate at the time of checkout is 1 USD = 0.9 EUR.

Shopify performs this conversion dynamically based on the customer’s selected currency, simplifying the shopping
experience for international buyers. For more details, refer to Shopify’s guide on [international pricing and discounts](https://help.shopify.com/en/manual/international/pricing/discounts).

**We proactively manage price rule values, such as:**

* Discount Amounts

* Prerequisite Subtotal Ranges

If an exchange rate changes significantly, our system automatically recalculates these values to ensure pricing rules
remain fair and aligned with the intended value of the discount as defined in Talkable campaign incentive.
This adjustment process minimizes manual updates for merchants and prevents discrepancies in pricing across currencies.
> **Note:**
>
> Our product uses **own exchange rates**, which are updated automatically every 24 hours

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/name_sharing.md
===============================================================================

# Name Sharing

There is a way to enable sharing referral offers by the Advocate name.

## Name Sharing User Flow

For users, the name sharing would proceed as follows:

1. The Advocate opens the referral offer share page.

2. The Advocate opts to share the offer by their personal name.

3. The Advocate confirms or edits their personal name [[1]](#f1).

4. The Advocate tells their personal name to their Friends in any way they find suitable.

5. The Friend visits site and opens the Claim by Name widget.

6. The Friend enters their email and the Advocate’s name.

7. The Friend receives a Click Reward (if it was configured in the Advocate campaign).

---


[[1](#id1)]

To be a valid personal name or code-word, it must be unique, between 3 and 50 characters
in length, and can contain Latin letters, numbers, underscores as separators, or even spaces.
It should not start with a number.

## Name Sharing Setup

To make name sharing work, at least two referral campaigns are required:

* one for Advocate (it can be any campaign that has a share page)

* one for Friend - a [Claim by Name campaign](https://docs.talkable.com/campaigns/campaign_types.md#campaigns-claim-by-name).

Personal name sharing channel is available as a configuration localization on Advocate share page
in all new campaign templates. It should be enabled so that the Advocate can enter/edit their name on a share page.

If you don’t have the localization in your campaign code, you can add it manually in the HTML & CSS editor mode.

```liquid
{% assign advocate_share_page_channel_personal_name = "advocate_share_page_channel_personal_name" | localize: trait: "boolean", default: "Disabled" %}
```
There can be multiple Advocate campaigns, as well as multiple Friend campaigns.
Upon a reward claim by a Friend, the newest offer from the respective Advocate will be matched.
> **Important:**
>
> Make sure to set up both advocate and friend incentives in the Advocate campaign. The Claim by Name campaign
> does not hold any incentive configuration and only serves to show a claim widget.
> **Note:**
>
> All advocate and friend metrics are counted toward the Advocate campaign.

## Inline Widget

The Claim by Name campaign does not hold any incentive configuration and only serves to show a claim widget. There can be multiple campaigns with
the different offers and only one Claim by Name campaign, which will serve all these campaigns.

In the rules of the Claim by Name campaign there is an option to make the floating widget inline. This can be done in the Rules of the campaign:

[Image]

After that the campaign will be embedded in the page:

[Image]

Once you enabled “Inline Widget”, ask client to add the following code for the inline campaign (container):

```html
<div id="talkable-claim-by-name"></div>
```
Without adding this code, the campaign won’t be visible.

## Shopify Fast Checkout

If Shopify theme uses shopping cart as a dynamic widget, you can integrate Claim by name campaign to show it in the cart by following these steps:

* Change placement rule to show campaign everywhere

* Enable option ‘Inline Widget’ in Campaign settings

* Add the following code to the Cart snippet in the Shopify theme (`Snippets/card.liquid`):

```html
<div id="talkable-claim-by-name"></div>
```

## Interactions with the personal name-share link

When Advocate creates a username, his personal name link gets updated as well, and vice versa.
However, the old personal name links that he shared before this change will still be valid.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/params_encryption.md
===============================================================================

# Params Encryption

For additional security, it is possible to encrypt Advocate, Friend, and Loyalty member email,
as well as [Custom User Data](https://docs.talkable.com/advanced_features/passing_custom_data.md#advanced-features-passing-custom-data) on back-end.
This can be done by using 2048-bit key generated by Talkable for your site.
So, instead of sending params in plain text, you can send them encrypted.

## Site public encryption key

To get your unique site public encryption key, go to **All Site Settings → Integrations → JS integration → Public encryption key**.

## Passing email as a GET parameter to Standalone Campaign

Also it’s possible to pass encrypted email as a GET parameter (e.g. for CTA links that
point to standalone invite page). But to do that encrypted email should be **URL-encoded**.
> **Note:**
>
> It’s recommended to use [Optimal Asymmetric Encryption Padding (OAEP)](https://en.wikipedia.org/wiki/Optimal_asymmetric_encryption_padding) padding scheme together with RSA encryption.

## Ruby Example

```ruby
require 'openssl'
require 'base64'

def key
  @key ||= begin
    key_content = File.read('talkable_your_site_slug_public_key.pem')
    OpenSSL::PKey::RSA.new(key_content)
  end
end

def encode_param_for_talkable(param)
  encrypted_param = key.public_encrypt(param, OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING)
  Base64.strict_encode64(encrypted_param)
end

puts encode_param_for_talkable("email_to_encrypt@example.com")
```

## Java Example

This example uses [Bouncy Castle library](https://www.bouncycastle.org) and has been tested on:

* bcprov-jdk18on-1.78.1.jar (Provider)

* bcpkix-jdk18on-1.78.1.jar (PKIX/CMS/EAC/PKCS/OCSP/TSP/OPENSSL)

that can be downloaded from [Bouncy Castle Latest Releases](https://www.bouncycastle.org/download/bouncy-castle-java/#latest).
> **Note:**
>
> Please note that loading a Security Provider and a key into memory takes more time than encrypting.
> So it is recommended to store the key in memory instead of loading it each time to avoid performance overhead.

```java
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import java.io.FileReader;
import java.io.IOException;
import java.security.*;
import java.util.Base64;

import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.openssl.PEMParser;
import org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter;

public class EncryptionDemo {
    static class ParamEncryptor {
        private Cipher cipher;
        private Key publicKey;

        private void initPublicKey() throws IOException {
            PEMParser pemParser = new PEMParser(new FileReader("talkable_your_site_slug_public_key.pem"));
            JcaPEMKeyConverter converter = new JcaPEMKeyConverter().setProvider("BC");
            SubjectPublicKeyInfo publicKeyInfo = (SubjectPublicKeyInfo) pemParser.readObject();
            publicKey = converter.getPublicKey(publicKeyInfo);
        }

        private void initCipher() throws GeneralSecurityException {
            cipher = Cipher.getInstance("RSA/ECB/OAEPPadding", "BC");
            cipher.init(Cipher.ENCRYPT_MODE, publicKey);
        }

        public ParamEncryptor() throws IOException, GeneralSecurityException {
            initPublicKey();
            initCipher();
        }

        public String encryptParam(String param) throws BadPaddingException, IllegalBlockSizeException {
            byte[] input = param.getBytes();
            byte[] cipherText = cipher.doFinal(input);
            byte[] encodedBytes = Base64.getEncoder().encode(cipherText);
            return new String(encodedBytes);
        }
    }

    static ParamEncryptor paramEncryptor;

    static {
        Security.addProvider(new BouncyCastleProvider());
        try {
            paramEncryptor = new ParamEncryptor();
        } catch (IOException | GeneralSecurityException e) {
            e.printStackTrace();
        }
    }

    public static String encryptParam(String param) throws BadPaddingException, IllegalBlockSizeException {
        return paramEncryptor.encryptParam(param);
    }

    public static void main(String[] args) throws Exception {
        String email = "email_to_encrypt@example.com";
        System.out.println(encryptParam(email));
    }
}
```

## Node.js Example

```js
const fs = require('fs');
const crypto = require('crypto');

// Read the public key from file
const publicKey = fs.readFileSync('talkable_your_site_slug_public_key.pem', 'utf8');

const encryptData = (data) => {
  const encryptedData = crypto.publicEncrypt(
    {
      key: publicKey,
      padding: crypto.constants.RSA_PKCS1_OAEP_PADDING,
      oaepHash: 'sha1',
    },
    Buffer.from(data)
  );
  return encryptedData.toString('base64');
};

// Example usage
const encryptedEmail = encryptData('email_to_encrypt@example.com');
console.log('Encrypted email:', encryptedEmail);
```

## Front-end Part
> **Important:**
>
> Do not use params encryption for [Talkable backend API](https://docs.talkable.com/api_v2/origins.md#api-v2-origins).
>
> Params encryption is only for JS integration.

Please modify the front-end using this pseudo code example:

```html
<script>
  _talkableq.push(['authenticate_customer', {
    email: '<%= to_json(TalkableEncryptionService.encrypt(current_user.email)) %>',
    phone_number: '<%= to_json(TalkableEncryptionService.encrypt(current_user.phone_number)) %>',
    first_name: '<%= to_json(current_user.first_name) %>',
    last_name: '<%= to_json(current_user.last_name) %>',
    person_custom_properties: {
      secret: '<%= to_json(TalkableEncryptionService.encrypt(current_user.secret)) %>'
    }
  }]);
</script>
```

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/passing_custom_data.md
===============================================================================

# Pass Custom User Data

The `custom_properties` variable allows you to pass any custom data
to Talkable as a collection of Key-Value pairs.
Those can be used for various segmentation purposes, since join criteria, incentive criteria, and placement criteria
are capable of using the ones in conditions.

All data associated with `custom_properties` is available for use
across all Campaign Views.

## How to set

**Initialization script**

Add the `custom_properties` collection in the `authenticate_customer` call of the Initialization script.

```javascript
_talkableq.push(['authenticate_customer', {
  email: '',
  custom_properties: {
    person_occupation: 'marketing',
    eye_color: 'brown'
  }
}]);
```
**Post-purchase script**

Add the `custom_properties` collection to the data passed in the `register_purchase` call. It should be nested the same as `purchase` collection.

```javascript
var _talkable_data = {
  purchase: {
    order_number: '',
    subtotal: '',
  },
  custom_properties: {
    person_occupation: 'marketing',
    eye_color: 'brown'
  }
};
_talkableq.push(['register_purchase', _talkable_data]);
```
**Loyalty script**

The properties you add to the initialization script will be automatically passed to all loyalty calls.
> **Note:**
>
> The values you pass in the `custom_properties` have to be JSON Key-Value pairs themselves,
> meaning that complex nested data structures cannot be passed through.
> Property names (e.g. `eye_color`) can contain lowercase letters, numbers and `_` only and cannot begin with a number.

## How to use

To access `custom_properties` in Talkable, use:

```liquid
{{ advocate_custom_properties }}
{{ friend_custom_properties }}
{{ member_info.custom_properties }}
```
Key-Value pairs can be referenced calling the desired data key, such as:

```liquid
{{ advocate_custom_properties.eye_color }}
```

> **Note:**
>
> Any `custom_properties` data passed through is tied to the Advocate, Friend, or Loyalty member.
> If Talkable receives a custom property that was previously defined for the user, the property gets overwritten with a new value.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/personal_coupon_sharing.md
===============================================================================

# Advocate Personal Coupon Sharing
> **Note:**
>
> This is an experimental feature, please ask your Customer Success Manager
> to apply it into your campaigns.

At Talkable Advocates can invite Friends in two ways:

1. Via sharing a link. When clicking on the share link each Friend sees
their discount on the Friend claim page. Friends can then copy the coupon and
apply it at checkout. Friends cannot remember such coupons as they are dynamically generated.
If they would want to share the discount with someone else they will only need to
share a link because the coupon they received is single-use.

2. Via sharing their unique personal coupon. Friends don’t need to click on any link,
they should simply apply the coupon at checkout to get a discount.
After Friend makes a purchase with the personal coupon code applied Talkable will
create a referral for this purchase.
This is the most authentic and native way to spread the word about the brand.
It allows Advocates to create their own personal coupon that looks just as their
name: “John Smith” even with spaces. Advocates don’t have to visit
a website to share, they already remember their personal coupon.

[Image]

## Setup

To set up personal coupon sharing into your referral campaign follow the next steps:

Talkable team:

1. Follow into Talkable Theme Store site and copy “Personal coupon sharing”
campaign into a customer’s site.

2. Follow into Reports → Personal coupon lists → Click on the “Create new” button

3. Create a name of the list, i.e. “2019 Personal coupons”, and set the amount, i.e. $5.

4. Navigate into any referral campaign where you would like to apply personal
coupon sharing method → Rules → Incentives →
Create a new Advocate Personal Coupon incentive → Choose the recently created list for $5.

Talkable customer:

1. To set up a publicly available backend endpoint that will be receiving [Talkable Create Coupon](https://docs.talkable.com/web_hooks/create_coupon.md#web-hooks-create-coupon) webhooks.
On each such payload the endpoint
should create a multi-use coupon with a value taken from a “coupon_code”
data payload attribute, and for the amount specified in “discount_amount”
and “percentage_discount” (false means fixed amount).

2. The backend endpoint should always reply 200 OK to every request, otherwise Talkable
will send a retry.

3. If the coupon code already exists in the store database, still reply with
200 OK but don’t override the existing coupon.

4. Once the coupon has been created any customer should be able
to apply the coupon at checkout multiple times.

Multiple campaigns can be attached to a single Personal coupon list.
It is recommended that all campaigns are attached to the same Personal coupon list,
this way each Advocate will see the same personal coupon on the Advocate Signup/Share page.
If multiple campaigns are attached to different personal coupon lists Advocates
will be seeing different personal coupons.

Each personal coupon belongs to a Talkable site and is unique on a site level.
Thus, you cannot have the same personal coupon
“TEST888” in two different personal coupon lists.

## FAQ

**Q: What ecommerce platforms are supported?**

A: Talkable currently requires additional integration to use
this feature (specified in the setup section above),
but we have no restrictions to certain platforms.

**Q: Can Friends use the personal coupon multiple times?**

A: Yes, since an Advocate is assigned with their own
unique personal coupon multiple Friends can use it at checkout.
Note: multi-use coupons can be shared on coupon aggregator websites.
As a result hundreds of people may use it.
We recommend limiting each coupon usage count if such use-case may seem critical.
Alternatively you may be interested to use link sharing with
single-use coupons to eliminate this use-case completely.

**Q: Where can I see all purchases generated by personal coupon sharing feature?**

A: Visit purchases report → Expand advanced filters →
Choose the desired Personal coupon list in the “Personal coupon list” select box.

**Q: Can personal coupons expire?**

A: Yes, as any other coupon. However, it is not recommended to change
the expiration date as Advocates may have already shared with their
Friends and included an original expiration date into the share message.
Personal coupons could also be shared verbally,
this will force Advocates to communicate new coupon expiration date
with all their Friends again.

**Q: Can Advocates change their personal coupons?**

A: A recommended option would be to create a new personal coupon
and use it instead of the old one. The old coupon could still
co-exist as Friends who already received it may want to use it at checkout.
It is also easy to support in the campaign: the edit button will
create a new personal coupon leaving the old one unchanged.
As a result each Advocate may have multiple personal coupons associated with them by email.

**Q: What characters are allowed in the personal coupon?**

A: Here is a list of validation rules that are defined globally for any coupons:

1. Coupon should be unique on a site level

2. Coupon value cannot be “SAMPLE-COUPON-CODE” (in any case)

3. All coupons are case insensitive, they are always normalized to uppercase and UTF8 encoding

4. Coupon length is between 3 and 255 characters

Any UTF8 characters are allowed (including spaces).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/phone_number_gating.md
===============================================================================

# Phone number gating

Phone number feature allows you to collect customers’ phone numbers inside your campaigns and use them for promotions.

You can set the phone number as a required field for customers to join the campaign or get a reward.
Setting can be found inside `Campaign → Rules → Extra section` for both Advocate and Friend.

[Image]

> **Note:**
>
> Currently, phone number gating can be enabled only with enabled email gating.

Inside the campaign, you can change the default setting for the consent checkbox.

[Image]

## Synchronization with ESPs

You can configure App store apps to send opt-ins with a customer’s phone number.
Currently, a phone number can be used for the next apps:

* [Attentive](https://docs.talkable.com/email_marketing_and_automation/attentive.md#email-marketing-and-automation-attentive)

* [Bronto](https://docs.talkable.com/email_marketing_and_automation/oracle_bronto.md#email-marketing-and-automation-oracle-bronto)

* [Klaviyo](https://docs.talkable.com/email_marketing_and_automation/klaviyo.md#email-marketing-and-automation-klaviyo)

* [HubSpot](https://docs.talkable.com/email_marketing_and_automation/hubspot.md#email-marketing-and-automation-hubspot)

Sample configuration

[Image]

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/product_items.md
===============================================================================

# Including Product Items

You can also add product specific tracking to Talkable
which will let your customers share specific items that they’ve purchased.
Customer shares with products have higher click through and conversion rates.

Below is an example with product items passed along with purchase data (notice FOR loop):

```html
<!-- Begin Talkable integration code -->
<script>
  window._talkableq = window._talkableq || [];
  var _talkable_purchase_items = [];

  // Start for loop
  _talkable_purchase_items.push({
    product_id: '', // Required — Item Product ID. Example: 'sku0001'
    price: '', // Required — Item Unit Price. Example: '199.00'
    quantity: '', // Required — Item Quantity. Example: '1'
    title: '', // Optional — Name of product. Example: 'Product Name'
    url: '', // Optional — URL for product. Example: 'http://www.store.com/product1'
    image_url: '' // Optional — URL for product image. Example: 'http://www.store.com/product1/image.jpg'
  });
  // End for loop

  var _talkable_data = {
    purchase: {
      order_number: '', // Required - Unique order number. Example: '100011'
      subtotal: '', // Required - Order subtotal (pre-tax, post-discount). Example: '23.97'
      coupon_code: '', // Coupon code that was used at checkout (pass multiple as an array). Example: 'SAVE20'
      currency_iso_code: '', // Required for multi-currency sites. Example: 'USD'
      shipping_zip: '', // Used for fraud protection by address. Example: '02222'
      shipping_address: '', // Full address of the order, make sure to strictly follow a format: 'Apt #, Street address, City, State, ZIP, Country'
      items: _talkable_purchase_items // Cart items declared in the example above
      segment1: '', // Segment 1: Represents custom segment (e.g., location, age group, source channel, platform, gender, interests).
      segment2: '', // Segment 2: Represents custom segment (e.g., location, age group, source channel, platform, gender, interests).
      segment3: '', // Segment 3: Represents custom segment (e.g., location, age group, source channel, platform, gender, interests).
    },
    customer: {
      email: '', // Required - Email of the customer who issued a purchase. Example: 'customer@example.com'
      traffic_source: '', // The source of the traffic driven to the campaign. Example: 'facebook'
      phone_optin: false, // Indicates whether the customer has provided consent for phone opt-in. The value should be boolean. If set to true, a valid phone number must be provided.
      email_optin: false // Indicates whether the customer has provided consent for email opt-in. The value should be boolean.
    }
  };

  window._talkableq.push(['register_purchase', _talkable_data]); // Pass data to Talkable and show Post Purchase campaign as a result
</script>
<!-- End Talkable integration code -->
```

> **Note:**
>
> All product items are included into Purchase details inside Purchases report.
> This information is helpful for debugging.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/referrals_approval.md
===============================================================================

# Referrals Approval

Talkable referral engine determines if the friend is a valid person based on fraud settings configuration.
The incentive engine then decides if the reward should be given based on incentive criteria. Here is a common example:

1. The advocate shares a link with a friend

2. The friend clicks on the referral link and claims their coupon

3. The friend makes a referral purchase using the coupon they just claimed

4. Talkable first checks whether the friend is valid and only then the incentive decides whether the reward should be paid out.
At this stage Talkable validates whether the friend was a valid person and not a self-referral (per fraud settings configuration).

5. If the referral is valid, Talkable approves it with a preset delay (ie. of 1-2 days)
which is determined by the ”pending referrals auto-approval delay” field (under fraud settings).
See recommendations below as to why it is best practice to set a delay.

6. As soon as the referral gets approved, Talkable passes it to the incentive engine which in turn checks whether the reward should be issued per campaign rules setup.
Rules like a minimum order subtotal amount or new/existing customer check may block the reward from being issued even if the referral is approved.

7. If the incentive criteria are passed, the advocate gets a referral reward issued to them by email as a coupon or store credit, depending on your setup.

  
  

In a perfect world every advocate would receive their reward immediately after a legitimate referral purchase to shorten the feedback loop for advocating and to encourage a repurchase.

However, if you have strong marketing offers on products that are inherently resellable and generous return policies you open yourself up to gaming by not monitoring your approvals policy.
> **Example:** You sell a product online and offer a strong discount ($100) in your referral program for new users.
> The product you sell is a home good that is easily re-sellable online.
> You also offer a generous 30-day return policy. In this case, marketing fraudsters may generate fake new user accounts,
> make purchases using 1-time credit cards, collect the reward as an advocate, and then return the items,
> thereby getting “free” money by gaming your referral program.

How can your referral management process help to automatically combat this system?

In the above case, if you ensured that your return policy window was shorter
then your referral approval window (i.e. if the referral is approved in 31 days,
after the 30-day return policy) then you would ensure
that no one would be able to game your system.

You may implement address fraud checks bypassing address information
at checkout, which requires an integration update. You may also be able
to configure a returns API to automatically check for returns of your product
before crediting a reward.

## General Approval Policy Recommendations

The safest programs fall into either of these categories:

1. Referrals are managed through the [Referrals API](/api_v2/referrals.html) in a fully-automated fashion.
This way, whenever the return happens, the referral can be voided through the API.
As a result, no advocate rewards will be issued from that referral.

2. If the number of referrals is small enough to manage them manually,
it is recommended to set the ”pending referrals auto-approval delay”
to an optimal value which gives your team adequate time to resolve referrals manually.
All referrals that weren’t resolved manually will be automatically approved by Talkable.
There is also a separate delay for flagged referrals: they should ideally be automatically voided
because flagged policies usually catch fraudulent referrals.

  
  

If a fully-automated API solution isn’t possible, it is recommended to use automatic referral resolution
so that Talkable automatically approves pending referrals and voids flagged referrals for you.
To mitigate possible marketing fraud while still maintaining an automatic approval process
we suggest the following guidelines:

1. Investigate your ”median return time”. You may have a 60 days return policy but find that 70% of returns are made in the first 10 days.
In this case, you can set the pending referrals auto-approval delay to be 10 days - instantly covering 70% of cases - and then manually monitor
the aggregate data on returns after 10 days to see if there’s an uptick in returns.
This generally results in better program performance with near-identical fraud attempts. Also, it’s easier to spot increases in fraud.
For example, if you begin to see a lot of returns after the 10-day mark you’ll know to investigate further.
You have created a situation where it’s now easier to identify fraudsters without affecting the vast majority of your customers.

2. Use single-use coupon codes for rewards. Legally speaking coupon codes are easier to revoke, have an expiration date,
and can have restrictions for minimum order values that will prevent users from attempting to defraud your program.

3. Manually check in on your referral program on a monthly or quarterly basis, or if you see any suspicious increases in certain activities.
Using the ”Flagged” property of our fraud detection system can allow you to view referrals that are suspicious and
get a feel for what types of behavior may be occurring. Additionally, by tracking your data you can identify patterns in fraudulent behavior and take action.

4. Update your program as necessary. Be wary of marketing offers that may be combined to get larger discounts on your site.
Do not be afraid to make changes in your approvals policy. If necessary, move to manual approvals of your program for a short period of time to diagnose any issues
and then re-configure your approval process and fraud settings to address those issues.

  
  

Configuring your referral auto-resolution system is a balance between ensuring a positive experience for advocates and ensuring that you protect your business from marketing offer fraud.
We expose a spectrum of options to meet your business needs.
Where your business falls on the spectrum depends on your product market, the relative value of gaming your program for resale, and the resources you wish to allocate to ensure a fair system.

If you have further questions feel free to [reach out to our team](https://www.talkable.com/contact).
We have years of experience in referral program design and can help you weigh the costs and benefits.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/reg_ex.md
===============================================================================

# Setting up Campaign Placement criteria

Talkable allows setting up of Campaign Placement “Shown on” / “Hidden on” criteria in two
formats:

1. **Relative match**. If the regex checkbox is turned **off**, the relative match mode is
used. “Relative” means it only matches the pathname of a URL and query parameters,
without the domain part. In this mode, the site URL is always set and you only need to
set a relative path. The criteria will only trigger when the relative path is matched
(and query parameters when provided). Here are some examples:

  * Match only the homepage with optional query parameters:

```text
/
```
        Matched URLs (example):

    * http://site.com/

    * https://new.domain.com/?utm=test

  
  

  * Match “/test/deep” exact path with optional query parameters:

```text
/test/deep
```
        Matched URLs (example):

    * http://site.com/test/deep

    * https://new.domain.com/test/deep?utm=test

  
  

  * Match “/test/deep” exact path containing “utm=true” query parameter:

```text
/test/deep?utm=true
```
        Matched URLs (example):

    * http://site.com/test/deep?utm=true

    * https://new.domain.com/test/deep?other=false&utm=true

  
  

2. **Regular expression** (regex for short). If the regex checkbox is turned **on** the
regex mode is used. In this mode you are controlling the full page URL, including the
domain part (unlike the relative match mode). If no query parameters were set Talkable
will ignore query parameters of the original URL in a browser.

    Use [https://regex101.com](https://regex101.com) to test placement criteria before applying it. Note: slashes
are already escaped, no need to backslash them. When testing the regex criteria, change
delimiters to backqoutes
([screenshot](https://talkable-screenshots.s3.amazonaws.com/Re_talkabletalkable-docs_PR-9264_Write_truthful_doc_for_campaign_placements_criteria_set_up_114_-_iurevychgmail.com_-_2018-06-04_15-40-09.png)).
See examples below:

  * Match URLs containing “/share” path with optional query parameters:

```text
/share
```
        Matched URLs (example):

    * http://site.com/share

    * https://new.domain.com/test/share/deep?utm=test

  
  

  * Match URLs ending with “/share” and containing “utm=true” query parameter:

```text
/share/?\?(.+&)?utm=true
```
        Matched URLs (example):

    * http://site.com/share?other=false&utm=true

    * https://new.domain.com/test/share/?utm=true&other=false

  
  

  * Match “site.com/test” exact URL without any query parameters:

```text
site\.com/test/?$
```
        Matched URLs (example):

    * http://site.com/test

    * https://site.com/test/

  
  

  * Match URLs starting with “/cart” path with optional query parameters:

```text
https?://([\w\-\d]+\.)+[\w\-\d]+/cart
```
        Matched URLs (example):

    * http://site.com/cart

    * http://new.domain.com/cart/deep?utm=test

  
  

  * Match URLs containing either “/products/one” or “/products/two” path with optional
query parameters:

```text
/products/one|/products/two
```
        Matched URLs (example):

    * http://site.com/test/products/one

    * http://stage.com/products/two

    * http://test.com/test/products/one/deep?utm=test

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/report_password_protection.md
===============================================================================

# Report Password Protection

To protect sensitive information, all exported reports are password protected by default,
but you can disable this in your site settings.

## How It Works

After the report generation, the user will receive an email with a link to download encrypted
ZIP file and a password to unzip it.

[Image]

To disable password protection in reports, you can turn off this option in the site settings:

[Image]

> **Note:**
>
> Do not turn off password protection unnecessarily because this setting
> exists for protection reports data from hacker attacks.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/segments.md
===============================================================================

# Segments

When driving traffic to one of your campaigns, you can include a segment
parameters to help segment your reporting.

## Segment With Product SKU

Sometimes there is a need to show a Campaign on Post Purchase Placement only to those customers who
purchased a particular product or a set of products. In this case you can put such a limitation inside Campaign Join Criteria.
To do that visit Campaign Details page → Go into Rules → Advanced → Campaign Join Criteria field and put the following
criteria in there:

```html
{% assign available_items = "sku1,sku2" | split: "," %}
{% assign user_items = advocate_origin.products | map: "product_id" %}
{% assign result = false %}

{% for available_item in available_items %}
  {% for user_item in user_items %}
    {% if user_item == available_item %}
      {% assign result = true %}
      {% break %}
    {% endif %}
  {% endfor %}
{% endfor %}

{{ result }}
```
Now only those customers who purchased a product with SKU of “SKU_GOES_HERE” will see a Campaign.
The Campaign won’t show for any other product purchased.
> **Note:**
>
> In order to use this Campaign Join Criteria you need to make sure that the SKU numbers are passed
> throught the integration first of all. To do that you need to go into Reports
> (top header navigation) → Purchases → Click on “Details” link of any purchase and make sure there is “Product Id”
> column with a valid “Product ID” value in place.
> If there is no such column or it is blank you cannot use this feature unless you pass the following instructions [Including Product Items](https://docs.talkable.com/advanced_features/product_items.md#advanced-features-product-items).

Please [contact us](https://www.talkable.com/contact) if you have any questions.

## Segment With Traffic Source

When driving traffic to one of your campaigns, you can include a traffic source
parameter as a URL query string to help segment your reporting. This is helpful
when you are driving traffic from many different sources to the same campaign.
This makes sense to do for both on-site and off-site call to actions where you
want to specifically track your traffic source. For example, if you are driving
traffic on-site to your Standalone campaign both from your home page navigation
bar and from your footer template, and you wanted to see which one is more high
value and driving more traffic to your campaign, you could look at the different
traffic sources in reporting to clearly see this.

How to use the traffic_source parameter in a call to action:

Say you have a Standalone integration displaying a campaign on www.yoursite.com/share.
You could append the traffic_source parameter on to your footer call to action as seen below:

`www.yoursite.com/share?traffic_source=footer`

## Custom Segments

For individual purchase segmentation, you have the option to utilize three custom segments: segment1, segment2, segment3.
Each of these segments can represent various criteria such as location, age group, traffic source, etc.
These segments offer flexibility in categorizing purchases based on different customer characteristics or transaction attributes.

Example of usage with register_purchase:

```html
<!-- Begin Talkable integration code -->
<script>
  window._talkableq = window._talkableq || [];
  var _talkable_data = {
    purchase: {
      order_number: '', // Required - Unique order number. Example: '100011'
      subtotal: '', // Required - Order subtotal (pre-tax, post-discount). Example: '23.97'
      coupon_code: '', // Coupon code that was used at checkout (pass multiple as an array). Example: 'SAVE20'
      currency_iso_code: '', // Required for multi-currency sites. Example: 'USD'
      shipping_zip: '', // Used for fraud protection by address. Example: '02222'
      shipping_address: '', // Full address of the order, make sure to strictly follow a format: 'Apt #, Street address, City, State, ZIP, Country'
      segment1: '', // Segment 1: Represents custom segment (e.g., location, age group, source channel, platform, gender, interests).
      segment2: '', // Segment 2: Represents custom segment (e.g., location, age group, source channel, platform, gender, interests).
      segment3: '', // Segment 3: Represents custom segment (e.g., location, age group, source channel, platform, gender, interests).
    },
    customer: {
      email: '', // Required - Email of the customer who issued a purchase. Example: 'customer@example.com'
      traffic_source: '', // The source of the traffic driven to the campaign. Example: 'facebook'
      phone_optin: false, // Indicates whether the customer has provided consent for phone opt-in. The value should be boolean. If set to true, a valid phone number must be provided.
      email_optin: false // Indicates whether the customer has provided consent for email opt-in. The value should be boolean.
    }
  };
  window._talkableq.push(['register_purchase', _talkable_data]);
</script>
<!-- End Talkable integration code -->
```
Example of usage with authenticate_customer:

```javascript
window._talkableq.push(['authenticate_customer', {
  email: '', // Email of the customer. Example: 'customer@example.com'
  first_name: '', // First name of the customer. Example: 'John'
  last_name: '', // Last name of the customer. Example: 'Doe'
  traffic_source: '', // The source of the traffic driven to the campaign. Example: 'facebook'
  segment1: '', // Custom segment (e.g., location, age group, source channel, platform, gender, interests).
  segment2: '', // Custom segment (e.g., location, age group, source channel, platform, gender, interests).
  segment3: '' // Custom segment (e.g., location, age group, source channel, platform, gender, interests).
}]);
```
In this example, segment1, segment2, and segment3 attributes are passed through authenticate_customer to enable segmentation without requiring an Origin creation.
> **Note:**
>
> Segments can also be passed in register_affiliate, register_purchase, and register_event, providing flexibility for different integration scenarios.

This approach simplifies custom data handling for customers, allowing for unified data across various methods and optimizing segmentation management without additional calls.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/sheerid.md
===============================================================================

# SheerID Integration

With SheerID and Talkable integration, you can verify your customers’ eligibility for your referral program and offer exclusive discounts and deals tailored for teachers, students, military personnel, nurses, and more.

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/shopify_coupons_auto_apply.md
===============================================================================

# Shopify coupon auto-apply

Talkable supports coupon auto-apply for Shopify. This guide provides clear and easy-to-follow documentation on two methods of automatically applying Shopify coupons.

## Method 1: Coupon application via destination URL

This method involves including the discount code in the URL. This way, when a customer clicks the link, the coupon is automatically applied to their cart.

1. **Friend destination URL:**

```liquid
{{ site_setup.url }}
{% if coupon.code %}
  /discount/{{ coupon.code }}?redirect=!!! YOUR CURRENT URL !!!
{% endif %}
```
    Result example:

```liquid
{{ site_setup.url }}
{% if coupon.code %}
  /discount/{{ coupon.code }}?redirect={{ site_setup.url }}&
{% else %}
  ?
{% endif %}
utm_source=talkable
&utm_medium={{ sharing_channel }}
&utm_content={{ campaign_setup.name | encode_query_argument }}
&utm_campaign={{ campaign_setup.id }}
&tkbl_cvuuid={{ visitor_uuid }}
&talkable_visitor_offer_id={{ friend_offer.id }}
```
[Image]
    **Breakdown:**

  * {{ site_setup.url }}/discount/{{ coupon.code }}: This applies the coupon code to the cart.

  * ?redirect={{ site_setup.url }}: This redirects the customer back to your store.

  * &utm_source=talkable&utm_medium={{ sharing_channel }}&utm_content={{ campaign_setup.name | encode_query_argument }}&utm_campaign={{ campaign_setup.id }}: These are default UTM parameters used for tracking.

  * &tkbl_cvuuid={{ visitor_uuid }}&talkable_visitor_offer_id={{ friend_offer.id }}: These parameters are specific to Talkable, to identify customer.

  * {% if coupon.code %}{% endif %} - condition to check if we have coupon.

2. **Advocate destination URL:**

```liquid
{{ site_setup.url }}
{% if coupon.code %}
  /discount/{{ coupon.code }}?redirect={{ site_setup.url }}&
{% else %}
  ?
{% endif %}
tkbl_cvuuid={{ visitor_uuid }}
```
[Image]

> **Note:**
>
> Advocate Reward Paid email should use {{ proceed_to_advocate_destination_url }} variable

## Method 2: Coupon application via client-side library integration

The second method involves updating the per-client JS library with a code snippet that listens for a form submission event and appends the discount code to the form data.

Here’s the code snippet to include:

```javascript
//Auto apply coupon code
_talkableq.push(['gleam_reward', {
  callback: function(coupon) {
    if (window.jQuery) {
      $("body").on("submit", "form[action='/cart']", function(data) {
          $('<input />').attr('type', 'hidden')
            .attr('name', "discount")
            .attr('value', coupon)
            .appendTo($("form[action='/cart']"));
          return true;
      });
    } else {
      var forms = document.getElementsByTagName('form'),
          discount = document.createElement('input');
      discount.type = 'hidden';
      discount.name = 'discount';
      discount.value = coupon;
      for (var i = 0; i < forms.length; i++) {
        if (forms[i].action.indexOf('/cart') !== -1) {
          forms[i].appendChild(discount);
        }
      }
    }
  }
}]);
```
**Breakdown:**

This JavaScript code uses the Talkable gleam_reward event. When this event fires, it provides a callback function with the coupon argument, representing the coupon code.

If jQuery is available, it sets up an event listener for the form submission. When the form is submitted, it appends a hidden input field with the name “discount” and the value of the coupon code to the form.

If jQuery is not available, it does essentially the same thing using vanilla JavaScript. It loops through all forms in the document, and if it finds one with an action containing ‘/cart’, it appends the hidden discount input field.

These methods will allow the coupon to be automatically applied when a customer adds a product to their cart and proceeds to checkout.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/shopify_coupons_auto_sync.md
===============================================================================

# Shopify coupon auto-sync

Talkable supports coupon auto-sync for Shopify. This feature allows the automation of code creation and management of Shopify Discounts, rather than manual code creation and upload to the Talkable Platform.
> **Note:**
>
> Shopify coupon auto-sync and [Coupon Webhook](https://docs.talkable.com/web_hooks/create_coupon.md#web-hooks-create-coupon) can be enabled simultaneously.
> In that case, coupons will be passed via the webhook only after successful Shopify sync.

## Get started

Before using coupon auto-sync, you’ll need to install the Talkable Shopify app (Settings → Shopify Integration → Authorize).

To enable coupon auto-sync in a coupon list, go to the coupon list edit/create page (All reports → Coupon lists) and check “Enable Coupon List Shopify Auto-Sync”.
If this checkbox is disabled (you are unable to check/uncheck it), it means that your user doesn’t have rights for this site or Shopify Integration is not authorized.
> **Note:**
>
> Talkable uses a Shopify Discount ID (if present) to determine where to upload newly generated coupons. It is recommended to leave it blank when creating coupon lists. If blank, Talkable will create a Discount based on coupon list configuration and store its ID in the coupon list.
> When you try to create a coupon list with a 100% discount you have to provide a Discount ID manually. That was made for preventing mistakes in the Discount setup.
>
> Please see **Advanced features** for more information about Shopify Discount ID.

### What is a Discount?

A Discount is the closest thing to Talkable coupon lists in Shopify. It defines the properties and applicability of associated coupon codes. You can read more on the Shopify site [here](https://shopify.dev/docs/api/admin-graphql/latest/objects/DiscountCodeBasic).

### What attributes will the auto-generated Discount have?

Talkable applies the below coupon list settings onto the Discount:

| Coupon list attribute     | Discount attribute (as in API)                                     | Discount attribute (as in interface) |
| ------------------------- | ------------------------------------------------------------------ | ------------------------------------ |
| **Amount**                | customerGets.value                                                 | Value                                |
| **Discount type**         | customerGets.value.percentage or customerGets.value.discountAmount | Type                                 |
| **Expiration date**       | endsAt                                                             | End date                             |
| **Minimum subtotal**      | minimumRequirement.subtotal .greaterThanOrEqualToSubtotal          | Minimum purchase amount              |
| **Recurring cycle limit** | recurringCycleLimit                                                | Recurring cycle limit                |

Some other Discount attributes that we set when generating the Discount:

| Discount attribute     | Value                                          | Attribute effect                                                                                       |
| ---------------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| title                  | e.g. “Talkable single-use coupons $10”         | Describes the Discount.                                                                                |
| customerGets.items     | { all: true }                                  | The discount applies to all items in the cart. Can be restricted to specific products or collections.  |
| customerGets.value     | { percentage: 0.1 } or { discountAmount: {…} } | Discount value - either percentage (0.0-1.0) or fixed amount.                                          |
| appliesOncePerCustomer | false                                          | Allows the customer to use discount multiple times.                                                    |
| usageLimit             | 1                                              | Each discount code can be used exactly once.                                                           |
| customerSelection      | { all: true }                                  | The discount is valid for all customers. Can be restricted to specific customers or customer segments. |
| startsAt               | Time of coupon list creation                   | The date and time when the discount starts.                                                            |

### Why aren’t there any coupons created for my auto-synced list?

Auto-sync generates and uploads coupons when there is demand for them. That means that nothing will happen until the first reward is requested from a specific coupon list. When this happens, Talkable will generate a code and sync it with Shopify, while scheduling a refill task that will generate a set of codes in advance. This logic is triggered every time a coupon is issued, so there will always be some coupons available for future rewards.

## Advanced features

### Shopify Discount ID

Talkable allows you to assign a custom Discount ID to a coupon list. This might be helpful if you want to deviate from our default Discount settings, e.g. restrict codes to a group of customers or group of products.

It is recommended to create a new Discount in Shopify if there is a need to use a custom one, instead of editing the Discount generated by Talkable.
> **Warning:**
>
> Talkable validates the Discount attached to a coupon list. There are certain Discount attributes that must match the coupon list configuration.
> These include:
>
> Applies once per customer - must be false (amount split across items)
>
> Value - must correspond to coupon list amount
>
> Type - must correspond to coupon list type
>
> Ends At - must be greater than or equal to coupon list expiration (and absent if coupon list has no expiration)
>
> Minimum Subtotal - must match coupon list minimum subtotal

If the Discount passes validation, it can be attached to a coupon list and will be used as a new destination for all the coupons created from that moment on.
> **Note:**
>
> All previously generated coupons will retain the attributes of the Discount that was used at the point at which they were created (auto-synced).

### Shopify Discount Changed Email Notification

If you modify a Discount on Shopify, it could make them incompatible with the coupon lists they are attached to. In order to find out about such changes as early as possible, we have a daily monitoring job that checks that Discounts have no critical differences from respective coupon lists.

Attributes that are checked in this job are the following:

* customerGets.value.appliesOnEachItem - must always be false

* usageLimit - must always be 1

* customerGets.value - must correspond to coupon list amount

* customerGets.value.percentage or customerGets.value.discountAmount - must correspond to coupon list type

* endsAt - must be greater than or equal to coupon list expiration (and absent if coupon list has no expiration)

If any of these attributes differ from what they are expected to be and Talkable cannot fix that by updating a coupon list (see **Coupon list sync**), Talkable sends an email notification.

Once the Discount becomes critically different from the coupon list it is assigned to, the coupon list is no longer editable. Please fix the issues listed in the email notification to remedy this situation.

### Coupon list sync

Talkable tries to keep up with the Discounts assigned to coupon lists when/if Discounts change.

As long as the Discount is otherwise valid for a coupon list, we update the coupon list’s:

* **expiration date** - only if Discount end date is further in the future (or absent)

* **minimum subtotal**

* **entitled products**

* **entitled collections**
> **Note:**
>
> If there are any other changes in the Discount that make it not suitable for a certain coupon list, we won’t sync the coupon list. In this case, a Shopify Discount Changed Email Notification will be delivered and action will be required to fix the issue.
>
> This sync is performed daily. Do not expect an immediate change to be reflected after a Discount update.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/shopify_purchase_syncing.md
===============================================================================

# Shopify Purchase Syncing

Purchase Syncing is a feature available for Shopify customers integrated with Talkable extension.
It allows automatic purchases synchronization from Shopify instead of (or additionally to) passing purchases with Talkable JavaScript integration from a browser.

To access this setting, go to the Shopify Integration page (Settings → Shopify Integration).
> **Warning:**
>
> Purchase Syncing currently is not supported for customers who pass to Talkable purchases with Purchase Order Number,
> different from Shopify Purchase ID (Talkable default Shopify integration behavior) as it will lead to double purchases registering.

## How it works?

It works as a server-to-server integration between Shopify and Talkable using Shopify orders/create and refunds/create [webhooks](https://shopify.dev/api/admin-rest/2022-04/resources/webhook).

When enabling Purchase Syncing, Talkable creates and subscribes to orders/create and refunds/create webhooks from the customer’s Shopify store. When disabling the setting, the webhook’s subscriptions are deleted.

Each time a purchase is placed on a customer’s store, Shopify triggers the webhook and Talkable registers the purchase with attributes sent in the webhook’s payload.
Whenever a purchase is refunded on a customer’s store, Shopify triggers the refund webhook and Talkable updates the purchase status as refunded. If a purchase has a pending referral and a full refund is issued, the referral will be voided.

## Shopify Webhook payload and Talkable Purchase attributes mapping

Talkable uses next mapping when syncing purchases from Shopify Webhook payload:

| Talkable Purchase attribute | Shopify Webhook payload (Shopify Purchase attribute)          |
| --------------------------- | ------------------------------------------------------------- |
| **Order Number**            | payload.id (Shopify Purchase ID)                              |
| **Email**                   | payload.email                                                 |
| **Currency**                | payload.presentment\_currency                                 |
| **Subtotal**                | payload.subtotal\_price\_set.presentment\_money.amount        |
| **Taxes**                   | payload.total\_tax\_set.presentment\_money.amount             |
| **Discount Amount**         | payload.total\_discounts\_set.presentment\_money.amount       |
| **Shipping Cost**           | payload.total\_shipping\_price\_set.presentment\_money.amount |
| **Items Purchased**         | payload.line\_items                                           |
| **Coupon codes**            | payload.discount\_codes                                       |
| **IP Address**              | payload.browser\_ip                                           |
| **Shipping Address**        | payload.shipping\_address (joined by comma)                   |
| **Shipping Zip**            | payload.shipping\_address.zip                                 |
| **Traffic Source**          | “purchase-syncing” (constant value)                           |
| **Visitor**                 | None (empty)                                                  |

## Post Purchase Campaign setup

To render Talkable Post Purchase Campaign, there is still a need of registering purchases
with Talkable JavaScript integration (is managed automatically by Talkable).

JavaScript purchase registration has priority over Purchase Syncing and registers the purchase from JavaScript integration first.

In this setup Purchase Syncing is just ensuring that attributes passed with JavaScript integration are aligned with purchases data from Shopify
and notifies Talkable Integrations team in case it is not.

Here is detailed explanation of this logic:

* Purchase Syncing tries to find Purchase in Talkable by Order Number (Shopify Purchase ID).

* If there is no such Purchase, the one will be registered with attributes described in Shopify Webhook payload and Talkable Purchase attributes mapping

* If such Purchase exists, Purchase Syncing compares **Email** and **Subtotal** with Shopify Webhook payload.

In case these attributes differ, Talkable Integrations team will is notified. Otherwise, nothing happens and the existing Purchase data is kept unmodified.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/single_sign_on.md
===============================================================================

# Single Sign-On (SSO)

## Introduction

Security Assertion Markup Language (SAML) is the standard for secure single
sign-on (SSO), and is the basis of SSO products from Okta, OneLogin, Active
Directory, and more. Talkable fully supports the [SAML v2.0 standard](https://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf), making
it easy to add a layer of security and convenience to your Talkable program.

There are two ways to set up SAML Single Sign-On: Automatic configuration, and
manual configuration. We strongly recommend automatic configuration, if it is
supported by your identity provider.

Here is some basic terminology to help you in this guide:

| Parameter               | Description                                                                                                                                                                                                 |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Identity Provider (IdP) | The software/service that verifies the identity of your users. For example, Okta, OneLogin, Active Directory, etc.                                                                                          |
| Service Provider (SP)   | Talkable.                                                                                                                                                                                                   |
| Metadata URL            | URL for the provider’s metadata. Both the IdP and the SP should have a Metadata URL.                                                                                                                        |
| Issuer (Entity ID)      | A unique string that identifies the provider issuing a SAML request. According to the SAML specification, the string should be a URL, though not all providers respect this. Not required by all providers. |
| Consumer URL            | The Talkable (SP) URL that will receive SAML requests from your IdP.                                                                                                                                        |
| IdP SSO Target URL      | The IdP URL that will receive SAML requests from Talkable (the SP).                                                                                                                                         |

## Automatic Configuration

Automatic configuration via metadata exchange is by far the easiest way to set up
SAML SSO. Simply check the box for “Automatically Configure from Metadata” and
provide the Metadata URL for your IdP.

[Image]

Leave all other fields blank, and save the settings.

Your IdP may require Talkable’s metadata URL. You can copy Talkable’s (SP)
metadata URL by clicking on the metadata link:

[Image]

If automatic configuration is not supported by your IdP, then try manual configuration.

## Manual Configuration

1. Uncheck the box for “Automatically Configure from Metadata”.

2. Fill in the following fields:

  * IdP Issuer (Entity ID)

  * IdP SSO Target URL

  * X.509 Certificate OR Certificate Fingerprint  
(Talkable will automatically generate the fingerprint if the full X.509 certificate is provided)

3. Save the settings.

## Testing Single Sign-On

Once you’ve configured SSO, you can test it as followed:

#### IdP-initiated SSO

1. Log out of Talkable

2. Log in to your IdP (e.g. Okta, OneLogin, etc.)

3. Click on the Talkable app in your app panel

#### SP-initiated SSO

1. Log out of Talkable

2. Visit the SP-Initiated SSO URL (provided on the SSO configuration page in Talkable)

[Image]

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/subscribing_to_events.md
===============================================================================

# Subscribing To Iframe Events

Talkable integration embeds a referral campaign as an iframe with src attribute starting with www.talkable.com domain (or custom domain if the [white-labeling](https://docs.talkable.com/advanced_features/white_labeling.md#advanced-features-white-labeling) is setup).

In order to subscribe to an iframe Event you need to know name HTML attribute of the Talkable iframe and the Event name.
Iframe ‘name’ attribute may change depending on the [campaign view](https://docs.talkable.com/campaigns/views.md#campaigns-views) opened. Thus, to use the right iframe name, open the campaign view you want to capture events from and copy the iframe name from the HTML of the page.

Below is an example of subscription to offer_loaded Talkable iframe Event.

Given we have integrated Campaign for [Standalone](https://docs.talkable.com/campaigns/campaign_placements/standalone.md#campaigns-campaign-placements-standalone) Placement, its HTML iframe reference looks like that:

```html
<div id="talkable-offer">
  <iframe name="talkable-offer-iframe" src="https://www.talkable.com/..."></iframe>
</div>
```
Knowing the container name attribute of the iframe is talkable-offer-iframe the subscription JS will be:

```javascript
talkable.subscribe("offer_loaded", "talkable-offer-iframe", function(data, iframe) {
  alert("Talkable campaign iframe is loaded!");
});
```
Notice two arguments passed in the callback:

* data object — the data passed by the iframe upon firing the event

* iframe object — iframe’s [HTML DOM reference](https://www.w3schools.com/jsref/dom_obj_frame.asp)

## Iframe Events List

Talkable campaigns are equipped with the following set of events:

1. offer_loaded — Talkable iframe DOM ready event which is in fact the very first event that you can use to determine if the iframe is loaded.

2. responsive_iframe_height — fires every time iframe size gets changed. You can use it to detect changes in iframe size.  
You can read more [here](https://docs.talkable.com/campaigns/designer.md#responsive-views). Previously named as `curebit_offer_iframe_broadcast`.

3. offer_close — fires when the close button is clicked. You can use this event to determine when user closes Talkable campaign, it then disappears from the screen.

4. offer_triggered — Talkable Trigger Widget iframe fires this event when user clicks on it. You can use this event to detect when the main offer iframe is about to show up.

5. coupon_issued — fires upon issuing coupon code as a reward for sharing. You can use it to determine when the user shares and receives their reward. data.channel tells which sharing channel was used and data.coupon_code stores the coupon code value.

6. share_succeeded — fires each time Advocate shares. data.channel tells which sharing channel was used for the share.

7. email_gating_passed — fires when Friend passes email gating on [Friend Claim Page](https://docs.talkable.com/campaigns/views/offers_claim.md#campaigns-views-offers-claim).

8. email_gating_failed — fires when Friend fails to pass email gating on [Friend Claim Page](https://docs.talkable.com/campaigns/views/offers_claim.md#campaigns-views-offers-claim).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/tango.md
===============================================================================

# Tango Integration

This documentation provides a guide on integrating the Tango rewards with your Talkable system.
By enabling this feature, you can generate gift claim links for users and customize reward amounts based on campaign settings.

Tango integration consists of several parts:

1. A Reward Link reward option in Tango portal.

3. A Tango application installed from Talkable App Store. This application is responsible
for storing all the necessary data required for Talkable to request gift cards from Tango and insert the generated
claim links in the referral campaign theme.

2. A referral campaign in Talkable having the following attributes:

  * An Advocate Referral Incentive with “Tango” reward type

  * A [“tango” Liquid filter](https://docs.talkable.com/campaigns/editor/filters.md#liquid-filter-tango) used in Reward Paid Email Page.

        The filter generates a claim link for the specified reward in Tango.

```html
<!-- An example of the claim link leading to Tango -->
<a href="{{ 'U957978' | tango: amount: 10 }}" target="_blank" title="{{ cta_text }}">
  {{ cta_text }}
</a>
```

## How to find the reward ID (UTID)

To use the tango Liquid filter, you will need to obtain the reward ID (called UTID) in the Tango portal:

1. In the “Send rewards” portal section, select and click the Reward Link you intend to use to reward advocates in Talkable.

2. On the reward details page, click “View all reward details”.

[[Image]](https://docs.talkable.com/_images/tango_open_reward_details.png.md)

3. Copy the “UTID” value and use it with the tango filter in the Talkable campaign theme.

[[Image]](https://docs.talkable.com/_images/tango_copy_utid.png.md)

> **Note:**
>
> Make sure to only copy the value of UTID, i.e “U957978”.

## How to find the Talkable Reward ID (External Reference ID)

When Talkable sends a reward request to Tango, it includes a Talkable Reward ID as the **External Reference ID**.
This identifier is useful for:

* Searching for specific rewards in the Tango portal

* Canceling QA or test rewards

To find the Talkable Reward ID:

**Option 1: From the Rewards report (Additional Columns)**

1. Navigate to the **Rewards** report in Talkable (Reports → Rewards).

2. Click the “Additional Columns” button and enable the **ID** column.

3. The Reward ID will be displayed in the ID column for each reward in the report.

**Option 2: From the Reward Details page**

1. Navigate to the **Rewards** report in Talkable (Reports → Rewards).

2. Locate the reward you want to reference and click “Details” to open the reward details page.

3. The Reward ID is displayed in the **ID** field on the reward details page.

**Using the Reward ID in Tango**

Use the Reward ID to search for the corresponding order in the Tango portal’s “Orders” section
by entering it in the “External reference ID” search field.
> **Note:**
>
> The External Reference ID in Tango matches the Talkable Reward ID exactly.
> This allows you to easily trace rewards between both systems for reconciliation or cancellation purposes.

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/track_methods.md
===============================================================================

# Referral Tracking Methods

Tracking referrals is an essential feature of the Talkable platform. When the
new event occurs Talkable Referral Engine tries to connect it to an Advocate
through a Friend Offer. It can be done using multiple methods. Each method is
applied according to their priority until the Friend Offer would be found.
Therefore Talkable interface shows each referral with the associated tracking
method.

Talkable platform tries to track as many referrals as possible, while gives an
opportunity to setup whether those referrals should qualify for a reward or be a
part of the attribution model (aka appear on the site dashboard). That is why
Talkable interface doesn’t have a lot of options to control Tracking Methods
while provides the customization for the rewarding criteria inside campaigns and
attribution model inside dashboards and reports.

The list of tracking methods by their priority:

## Manually Generated

* Only applies when the referral is made from Talkable admin pages.

* Has the top priority because it forces the referral to be made without
checking any criteria.

## Force Manually Generated

* Only applies when the referral is made from Talkable admin pages.

* This is a Manually Generated Referral with skipped all fraud policy rules and incentive criterias.

## Sticky Advocate

* Only available for sites that have this feature enabled in the site settings.

* Designed for case where a single person can only be referred once, so that
another Advocate will not be able to refer it again (or “steal” him from the
previous Advocate).

* Checks whether a buyer was referenced before through his previous purchases or
events (by same email or browser cookie) and attributes current event to the
same Advocate as the previous one.

* Makes each Friend bounded to particular Advocate forever without the ability
to make it referred again by a different Advocate.

## Coupon

* Friend used the coupon code he received through a Friend offer.

* Only applies to campaigns that are giving a single use coupon as a reward to a
Friend before they make a purchase.

## Cookie

* Friend used the same browser session as when clicking the referral link.

## Web Cookie

* Only applies to the iOS/Android Mobile SDKs.

* Friend used the same browser session as when clicking the referral link.

* The technology for the referral detection is very different for Mobile SDK
from the browser. That is why Talkable distinguishes between Cookie and Web
Cookie tracking methods.

## Gated Email

* Friend used the same email address as they entered on the claim page.

* Only applies to campaigns that have Friend Signup feature enabled.

## Phone Number

* Friend used the same phone number as they entered on the claim page.

* Only applies to campaigns that have Friend Signup feature enabled.

## Share Email

* Friend used the same email address in the Friend Share Email.

* Only applies to offers shared by Email channel.

## IP Address

* Friend used the same IP address as when clicking the referral link.

* Time limit: only applies when a Friend made a purchase or event within 1 hour
after clicking the referral link.

* The method doesn’t apply to the blocked IP addresses, blocked emails,
QA IP addresses and QA emails.

## Event Chain

* Friend was already referred before and this is his subsequent event. In this
case, this event is automatically attributed to the same Advocate as the
previous one.

* The method doesn’t apply to blocked emails and IP addresses.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/tremendous.md
===============================================================================

# Tremendous Integration

Reward advocates with gift cards from various retailers provided by Tremendous.

Tremendous integration consists of several parts:

1. A campaign in Tremendous with the selected rewards for customers.

3. A “Tremendous” application installed from Talkable App Store. This application is responsible
for storing API tokens, enabling Talkable to request gift cards from Tremendous and insert the generated
claim links in the referral campaign theme.

2. A referral campaign in Talkable having the following attributes:

  * An Advocate Referral Incentive with “Tremendous” reward type

[[Image]](https://docs.talkable.com/_images/tremendous_incentive.png.md)

  * A [“tremendous” Liquid filter](https://docs.talkable.com/campaigns/editor/filters.md#liquid-filter-tremendous) used in Reward Paid Email Page.

        The filter generates a claim link within the specified Tremendous campaign.

```html
<!-- An example of the claim link leading to Tremendous -->
<a href="{{ 'KBBYF5Q64BL4' | tremendous }}" target="_blank" title="{{ cta_text }}">
{{ cta_text }}
</a>
```

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/url_parameters.md
===============================================================================

# Using URL Parameters

Talkable allows overriding some of the parameters right through URL query string:

* email - Advocate email address

* first_name - Advocate first name

* last_name - Advocate last name

* traffic_source - [Traffic Source](https://docs.talkable.com/advanced_features/segments.md#advanced-features-segments) value

* campaign_tags - overrides campaign tag to be loaded

Below is an example of Advocate authorization through URL. Given the URL of
the page where Talkable campaign is integrated: [http://example.com/share](http://example.com/share):

```html
http://example.com/share?email=advocate%40example.com
```
Location parameters have higher priority than explicit parameters passed in the
integration.
> **Note:**
>
> Don’t forget to escape URL parameters with URI parameter encoder.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/utm_tags.md
===============================================================================

# UTM Tags

UTM tags are essential for tracking the performance of marketing campaigns across various
channels. By correctly implementing UTM tags, marketers can gain valuable insights into
the effectiveness of their campaigns and optimize their strategies accordingly.

Components of UTM Tags:

* Source (utm_source): Identifies the specific source of the traffic, such as a search engine or newsletter.

* Medium (utm_medium): Specifies the marketing medium, such as email, social, or CPC (Cost Per Click).

* Campaign (utm_campaign): Specifies the name of the marketing campaign.

* Term (utm_term): Used for paid search keywords.

* Content (utm_content): Used to differentiate similar content, such as different versions of an ad.

Example of usage:

```text
https://example1.com/friends?refer=friends&utm_source=example_source&utm_medium=example_medium
```

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/white_labeling.md
===============================================================================

# White-labeling

By default, Talkable runs campaigns on www.talkable.com domain and sends emails
from @p2p.talkable.com (advocate share emails) or @offers.talkable.com (other emails, e.g. reward notifications).
That can be changed by configuring a custom web and/or email domain so that links and emails
appear to be pointing to the store itself (e.g @share.your-shop.com).

## How to set up a custom domain

Custom Email and Web domains can be configured in **Site Settings** → **Custom domains**.

1. Decide if you want custom **web domain**, **email domain**, or **both**.
The domain names can match or be different. By default, if you select “Set up web domain”,
both web and email domains will be configured and will share the same domain name.
This can be changed in the following step.

[Image]

2. Choose a **domain name** you want to use for white-labeling.
Please note that it should be a sub-domain of a domain you control.
For example, if your shop’s domain is example.com, you can set up subdomain.example.com custom domain.

3. Choose if you want to **delegate** the custom domain to Talkable (recommended) or want to keep control over its DNS settings.
Read more about this in [Delegated VS Self-managed setup](#delegated-vs-self-managed).

4. If you clicked “Set up web domain” and you only want the web domain
or you want different names for the web and email domains,
change **“Domain consistency”** to “Web only”.
Otherwise, you will proceed to set up both web and email domains with the same name (which is recommended).
If you clicked “Set up email domain”, you can only configure email domain.

5. Once the domain configuration is confirmed, it is time to add **DNS records** to your parent domain.
Read [Adding DNS records](#adding-dns-records) for detailed instructions on how to add records for the most common DNS providers below.
Please note that any DNS changes might take a while (sometimes more than a day) to become active.

6. After adding all the required DNS records, wait for a while for the records to become active.
Click “Check DNS status” on Talkable custom domain settings to see the updated status of your domain
(it could take up to 24 hours for the records to propagate).

[Image]

### Delegated VS Self-managed setup

Talkable offers two options for custom domain management:

* **Delegated** (recommended)

    This option allows adding fewer DNS records on your main domain.
Once you set up the correct NS records, the rest of the configuration will be done by Talkable.

    Required DNS records:

  * NS records (to delegate custom domain management to Talkable).

    Example:

[Image]

* **Self-managed**

    This option provides more granular control over DNS settings of the custom domain.
It requires adding multiple DNS records to support white-labeling and thus is more prone to errors
if the records are omitted or misconfigured.

    Required DNS records for a web domain:

  * CNAME record (to point custom domain to Talkable)

  * CNAME record (to verify SSL certificate)

    Required DNS records for an email domain (see the picture below for reference):

  * CNAME record (to verify SSL certificate, number 3 on the picture)

  * CNAME record (to enable click tracking, 2)

  * MX records (direct mail to a mail server, 4 and 5)

  * TXT record (allows sending mail from Talkable on behalf of your domain, 1)

    Example of DNS records required for a self-managed custom email domain:

[Image]

## Adding DNS records

See detailed instructions on adding or modifying DNS records in the most common DNS management services below.

* [Add DNS records in AWS Route53](https://docs.talkable.com/advanced_features/white_labeling/aws_route53.md#advanced-features-white-labeling-aws-route53)

* [Add DNS records in Shopify](https://docs.talkable.com/advanced_features/white_labeling/shopify.md#advanced-features-white-labeling-shopify)

* [Add DNS records in GoDaddy](https://docs.talkable.com/advanced_features/white_labeling/godaddy.md#advanced-features-white-labeling-godaddy)

* [Add DNS records in Cloudflare](https://docs.talkable.com/advanced_features/white_labeling/cloudflare.md#advanced-features-white-labeling-cloudflare)

### Email sending issues

If the emails sent by Talkable go to spam, it is likely that there are issues with the DNS records setup,
namely [DMARC policies](https://www.mailgun.com/blog/deliverability/domain-reputation-and-dmarc/).

Custom email domains in Talkable use a special DNS record called SPF record (Sender Policy Framework)
to mark Talkable as a valid sender of emails on behalf of your site.
So if your site uses a strict DMARC policy, emails sent from unverified domains will likely go to spam.

To avoid that, you either need to:

* ensure that the emails sent by Talkable are from a properly set up custom domain.

    Check that **“Customer service email”** in **All site settings** → **General** → **Notifications** has the same
custom domain. For instance, if your custom domain is subdomain.example.com, and your customer service email is cm@another_subdomain.example.com or cm@sub.subdomain.example.com, there might be problems with sending.

* add Mailgun (a service that Talkable uses for sending emails) to a whitelist in your SPF record.

    An SPF record is a simple TXT DNS record that starts with v=spf1. If it is present, make sure that the record
includes include:mailgun.org text.

    This requires [Adding DNS records](#adding-dns-records). To look up your current SPF record, enter the domain of a “From” value
of an email that went to spam in a [lookup service](https://dnslookup.online/spf.html).

    Example of a TXT record value that allows Mailgun (among other specified services) to send emails:

```default
v=spf1 include:mailgun.org include:_spf.google.com include:mail.zendesk.com include:_spf.salesforce.com ~all
```

* [Adding DNS records in AWS Route53](https://docs.talkable.com/advanced_features/white_labeling/aws_route53.md)
* [Adding DNS records in Shopify](https://docs.talkable.com/advanced_features/white_labeling/shopify.md)
* [Adding DNS records in GoDaddy](https://docs.talkable.com/advanced_features/white_labeling/godaddy.md)
* [Adding DNS records in Cloudflare](https://docs.talkable.com/advanced_features/white_labeling/cloudflare.md)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/white_labeling/aws_route53.md
===============================================================================

# Adding DNS records in AWS Route53
> **Note:**
>
> The instructions below use subdomain.example.com as an example of a custom domain where example.com is your domain.

1. Go to Hosted zones and select your main domain hosted zone (for instance, example.com).

2. Once the domain is selected, click “Create record” button.

3. In the opened window, enter the **subdomain** part in the “Record name” field.
Note that the main domain part (.example.com) needs to be omitted since it is already accounted for.
In some cases, sub-subdomain separated by dot may need to be entered,
e.g. email.subdomain for a click-tracking CNAME record.

4. Select appropriate record type (might be NS, CNAME, MX, etc.).

5. Copy the DNS record value (or values) from the Talkable custom domain settings into the “Value” field.
Note: For NS and MX record types, insert multiple values separated by newline
if they share the same “Record name”.

6. Click “Create records” once you are ready.

[Image]

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/white_labeling/cloudflare.md
===============================================================================

# Adding DNS records in Cloudflare
> **Note:**
>
> The instructions below use subdomain.example.com as an example of a custom domain where example.com is your domain.

[Cloudflare docs](https://developers.cloudflare.com/dns/manage-dns-records/how-to/create-dns-records/#create-dns-records)

1. In your Cloudflare dashboard, select the site you want to manage in **Websites** (e.g. example.com).

2. Go to **DNS** → **Records** and click “Add record”.

3. Select appropriate record type (might be NS, CNAME, MX, etc.).

4. In the “Name” field, enter only the **subdomain** part
(e.g. subdomain if you want to add a record for subdomain.example.com).

5. Copy the DNS record value from the Talkable custom domain settings into the “Value” field.
Note: Unlike some other platforms, Cloudfront does not allow multiple values in NS record.
Instead, you’ll need to add multiple NS records with the same name and different values.

[Image]

6. Save the changes.

    Example of properly added NS records:

[Image]

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/white_labeling/godaddy.md
===============================================================================

# Adding DNS records in GoDaddy
> **Note:**
>
> The instructions below use subdomain.example.com as an example of a custom domain where example.com is your domain.

[GoDaddy docs](https://www.godaddy.com/help/manage-dns-records-680)
> **Note:**
>
> This instruction applies to domains that have GoDaddy name servers.
> If you purchased a GoDaddy domain, but use other service’s name servers,
> you should add DNS records in the name server account.

1. Click **My Account** → **Domains**.

2. Pick a domain that you want to manage, click three dots and click “Manage DNS”.

3. Click “Add” to add a new DNS record, or “Edit” to update an already existing one.
Pay attention to the “Name” column. You want to make sure that you edit the correct
record. The “Name” should only include a subdomain part, so if you want to edit subdomain.example.com, look for subdomain in the “Name”.

4. In the editing window, select appropriate record type (might be NS, CNAME, MX, etc.).

5. In the “Name” field, enter only the **subdomain** part
(e.g. subdomain if you want to add a record for subdomain.example.com).

6. Copy the DNS record value (or values) from the Talkable custom domain settings into the “Value” field.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/advanced_features/white_labeling/shopify.md
===============================================================================

# Adding DNS records in Shopify
> **Note:**
>
> The instructions below use subdomain.example.com as an example of a custom domain where example.com is your domain.
> **Note:**
>
> This instruction applies to domains that are transferred to Shopify
> or registered there in the first place.
> Third-party domains connected to Shopify should be managed in respective domain registries.

For delegated setup,

1. In your Shopify admin, go to your primary domain settings
(Settings → [Domains](https://shopify.com/admin/settings/domains))

2. Add NS records listed in Talkable custom domain settings.

For self-managed setup of a custom web domain,

1. [Add a subdomain](https://help.shopify.com/en/manual/domains/add-a-domain/add-subdomains) in Shopify.

2. [Edit](https://help.shopify.com/en/manual/domains/managing-domains/edit-dns-settings#edit-dns-record) the automatically created CNAME record for the subdomain to point to Talkable.
See the value of the CNAME record in Talkable custom domain settings.
Example: your-talkable-site-id.elb.talkable.com

3. Add another CNAME record to verify the SSL certificate created by Talkable.

For self-managed setup of a custom email domain,

1. [Add a subdomain](https://help.shopify.com/en/manual/domains/add-a-domain/add-subdomains) in Shopify.

2. Add the CNAME, MX, and other records listed on Talkable custom domain settings to enable the email sending.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/android_sdk.md
===============================================================================

# Talkable Android SDK

Talkable has an Android framework enabling you to use Talkable in Andoid Apps. Once integrated you
can use the following Talkable capabilities:

* Display Advocate Signup/Share Page (the page itself is built inside Talkable)

* Share Offer via:

  * Email

  * Facebook

  * Twitter

  * SMS

  * by copying a direct Offer link

* Track sales via the App and reward Advocate if a sale was driven through someone’s claim link

## Contents:

* [Getting Started](https://docs.talkable.com/android_sdk/getting_started.md)
  * [Installation](https://docs.talkable.com/android_sdk/getting_started.md#installation)
  * [Requirements](https://docs.talkable.com/android_sdk/getting_started.md#requirements)
* [Integration](https://docs.talkable.com/android_sdk/integration.md)
  * [Standalone Campaign](https://docs.talkable.com/android_sdk/integration/standalone.md)
  * [Post Purchase Campaign](https://docs.talkable.com/android_sdk/integration/post_purchase.md)
  * [Custom Events](https://docs.talkable.com/android_sdk/integration/event.md)
* [Advanced Usage](https://docs.talkable.com/android_sdk/advanced.md)
  * [Error Handling](https://docs.talkable.com/android_sdk/advanced.md#error-handling)
  * [Using multiple site slugs](https://docs.talkable.com/android_sdk/advanced.md#using-multiple-site-slugs)
  * [Sharing via Facebook](https://docs.talkable.com/android_sdk/advanced.md#sharing-via-facebook)
  * [Overriding default behaviour](https://docs.talkable.com/android_sdk/advanced.md#overriding-default-behaviour)
  * [Using TalkableOfferFragment directly](https://docs.talkable.com/android_sdk/advanced.md#using-talkableofferfragment-directly)
  * [Native integration via API](https://docs.talkable.com/android_sdk/advanced.md#native-integration-via-api)

* [API](https://docs.talkable.com/android_sdk/api.md)
  * [Create visitor](https://docs.talkable.com/android_sdk/api.md#create-visitor)
  * [Create origin](https://docs.talkable.com/android_sdk/api.md#create-origin)
  * [Retrieve rewards](https://docs.talkable.com/android_sdk/api.md#retrieve-rewards)
  * [Retrieve offer](https://docs.talkable.com/android_sdk/api.md#retrieve-offer)
  * [Create offer share](https://docs.talkable.com/android_sdk/api.md#create-offer-share)
* [React Native](https://docs.talkable.com/android_sdk/react_native.md)
  * [How it works](https://docs.talkable.com/android_sdk/react_native.md#how-it-works)
  * [What to expect](https://docs.talkable.com/android_sdk/react_native.md#what-to-expect)
  * [Reusing the SDK’s API wrapper (optional)](https://docs.talkable.com/android_sdk/react_native.md#reusing-the-sdk-s-api-wrapper-optional)
* [Integration with Third Party Deep Linking Services](https://docs.talkable.com/android_sdk/custom_deep_linking.md)
  * [1. Configure your Talkable campaign](https://docs.talkable.com/android_sdk/custom_deep_linking.md#configure-your-talkable-campaign)
  * [2. Pass deep linking params to the Talkable SDK](https://docs.talkable.com/android_sdk/custom_deep_linking.md#pass-deep-linking-params-to-the-talkable-sdk)
* [Testing](https://docs.talkable.com/android_sdk/testing.md)

* [Upgrade](https://docs.talkable.com/android_sdk/upgrade.md)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/android_sdk/advanced.md
===============================================================================

# Advanced Usage

## Error Handling

Errors from `Talkable.showOffer` and `Talkable.loadOffer` are handled
inside `onError` callback, which provides an instance of `TalkableOfferLoadException` class.
You can get error type and error message with `error.getErrorCode()` and `error.getMessage()` respectively.

Here is a list of possible error codes from `TalkableOfferLoadException` with descriptions:

* `NETWORK_ERROR`: General network error

* `API_ERROR`: Talkable API unavailable

* `REQUEST_ERROR`: Bad request

* `CAMPAIGN_ERROR`: Campaign not found

## Using multiple site slugs

To use multiple site slugs (also known as IDs) in your application, follow these steps:

1. Add credentials for each site you are going to use inside your manifest file.
Format is the same as from corresponding [Getting Started](https://docs.talkable.com/android_sdk/getting_started.md#setup-credentials) section.

2. Add deep linking schemas handlers into the main activity entry for each site
you are going to use. The format is the same as the corresponding [Getting Started](https://docs.talkable.com/android_sdk/getting_started.md#deep-linking-scheme) section.

3. Set default site slug.

    This can be done by adding this information into the manifest file using `<application>` entry:

```xml
<application>
    ...
    <meta-data
        android:name="tkbl-default-site-slug"
        android:value="{{YOUR_DEFAULT_SITE_SLUG}}" />
    ...
</application>
```
    or by passing it through `Talkable.initialize` in the `Application`:

```java
import com.talkable.sdk.Talkable;
import android.app.Application;

    public class App extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        Talkable.initialize(this, "your-default-site-slug");
    }
}
```

> **Note:**
>
> You can set the site slug at any time after initialization in the following way:
>
> ```java
> Talkable.setSiteSlug("some-site-slug");
> ```
    Make sure to add the credentials for this site inside the manifest file.
Otherwise, an exception will be raised.

## Sharing via Facebook

By default sharing via Facebook is disabled. You can enable it by setting up
your project with the Facebook SDK: [Android - Getting Started](https://developers.facebook.com/docs/android/getting-started)

## Overriding default behaviour

1. Create a new fragment in your app which extends TalkableOfferFragment and override methods there. Example:

```java
import com.talkable.sdk.TalkableOfferFragment;

    public class OverriddenTalkableOfferFragment extends TalkableOfferFragment {
    @Override
    public void copyToClipboard(String string) {
        super.copyToClipboard(string);

    Toast.makeText(getActivity(), "Text copied!", Toast.LENGTH_LONG).show();
    }
}
```

2. Pass Class of an activity you want to run a fragment in and the overriden fragment to Talkable.showOffer call:

```java
Talkable.showOffer(activity, affiliateMember, OverridenTalkableOfferFragment.class, new TalkableErrorCallback<TalkableOfferLoadException>() {
    @Override
    public void onError(TalkableOfferLoadException error) {
        // Error handling. Note that it runs on non UI thread
    }
});
```

If you want to implement custom offer closing handling you should implement `TalkableOfferFragmentListener` interface from `TalkableOfferFragment` inside your Activity.

```java
import com.talkable.sdk.TalkableOfferFragment.TalkableOfferFragmentListener;

public class MyActivity implements TalkableOfferFragmentListener {
    ...
    @Override
    public void onOfferClosed() {
        finish();
    }
    ...
}
```

## Using TalkableOfferFragment directly

By default Talkable Android SDK displays Talkable offer as a fullscreen modal view. If you need to embed the Talkable offer into your layout
or otherwise control the way it’s displayed, you can obtain an instance of `TalkableOfferFragment`, which is a [Fragment](https://developer.android.com/guide/fragments) that comes
preloaded with Talkable offer content and can be added to your layout dynamically.

To use `TalkableOfferFragment` directly, follow these steps:

1. Get an offer code using the `Talkable.loadOffer(origin, callback)` method

2. Create a fragment instance by passing the offer code to the `TalkableOfferFragment.newInstance(shortCode)` method

3. Use [Fragment Transactions](https://developer.android.com/guide/fragments/transactions) or another method of your choice to display the fragment.

```java
AffiliateMember affiliateMember = new AffiliateMember();
...

Talkable.loadOffer(affiliateMember, new TalkableCallback<String, TalkableOfferLoadException>() {
    // Note that it runs on non UI thread
    @Override
    public void onSuccess(String offerCode) {
        TalkableOfferFragment fragment = TalkableOfferFragment.newInstance(offerCode);
        myMethodToDisplayTalkableOfferFragment(fragment);
    }

    @Override
    public void onError(TalkableOfferLoadException error) {
        // Error handling
    }
 );
```

> **Note:**
>
> Make sure to [handle configuration changes](https://developer.android.com/guide/topics/resources/runtime-changes.html), as `TalkableOfferFragment` is built on top of `WebView` and restoring its state is up to you. If you
> need to reinitialize a fragment, you don’t need to call `loadOffer` again.
> Simply store the `offerCode` and use it to create a new `TalkableOfferFragment` instance.

## Native integration via API

Talkable provides an [API](https://docs.talkable.com/android_sdk/api.md#android-sdk-api) that can be utilized to
implement a fully native referral program interface if the default solution
(based on `WebView`) doesn’t work for you.
Below are the methods necessary to integrate the Talkable referral loop into
your Android application.

1. The first step is to get an `Offer` by creating an `Origin`: [Create origin](https://docs.talkable.com/android_sdk/api.md#android-api-origins)

2. Then, share the obtained `Offer`: [Create offer share](https://docs.talkable.com/android_sdk/api.md#android-api-sharing)

3. Check for rewards: [Retrieve rewards](https://docs.talkable.com/android_sdk/api.md#android-api-rewards)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/android_sdk/api.md
===============================================================================

# API

Talkable features are also available via API. So there are helper methods in Talkable SDK.
All methods are available in any place of your app (after [initialization](https://docs.talkable.com/android_sdk/getting_started.md#main-activity-setup)).

## Create visitor

It’s the simplest method. You don’t need anything to create Visitor.
But you can do anything you need with just create one.

```java
import com.talkable.sdk.TalkableApi;

TalkableApi.createVisitor(new Callback1<Visitor>() {
    @Override
    public void onSuccess(Visitor apiVisitor) {
        // Process success
    }

    @Override
    public void onError(ApiError error) {
        // Process error
    }
});
```

## Create origin

You need to build Origin to create. There are three subclasses of this class. You need to build one of them.

### Hierarchy

* Origin (Abstract)

  * AffiliateMember

  * Event

    * Purchase

### Building Origin

You need to build Origin using one of examples below:

```java
// Building customer, required for all types
String email = "advocate@example.com"; // Required
String idInYourApp = "a8db7683-0f7f-407e-8d12-af2d501035c8"; // Use unique identifier from your system, optional
String firstName = "John"; // Optional
String lastName = "Smith"; // Optional
Customer customer = new Customer(idInYourApp, firstName, lastName, email);

// Building AffiliateMember
AffiliateMember origin = new AffiliateMember();
origin.setCustomer(customer); // Required
origin.setCampaignTag("your-campaign-tag");

// Building Event
String eventNumber = "1"; // Required
String eventCategory = "event-category"; // Required
Double subtotal = 10.99; // Optional
String[] coupons = {"EXAMPLE-CODE"}; // Optional

Event origin = new Event(eventNumber, eventCategory, subtotal, coupons);
origin.setCustomer(customer); // Required
origin.setCampaignTag("your-campaign-tag");

// Build purchase
Double price = 10.99;
Integer quantity = 1;
String productId = "1";
Item item = new Item(subtotal, quantity, productId);
item.setTitle("Item Title"); // Optional
item.setUrl("https://site.com/product.html"); // Optional
item.setImageUrl("https://site.com/image.jpg"); // Optional

Double subtotal = price * quantity; // Required
String orderNumber = "123456"; // Required
String[] coupons = {"EXAMPLE-CODE-1", "EXAMPLE-CODE-2"}; // Optional

Purchase origin = new Purchase(subtotal, orderNumber, coupons);
origin.setCustomer(customer); // Required
origin.setCampaignTag("your-campaign-tag");
origin.addItem(item); // Optional
```

### API request

You need built origin created in previous step to save in in Talkable.
If you have, you need call method like in the example below:

```java
TalkableApi.createOrigin(origin, new Callback2<Origin, Offer>() {
    @Override
    public void onSuccess(Origin origin, Offer offer) {
        // Process success
    }

    @Override
    public void onError(ApiError error) {
        // Process error
    }
});
```

## Retrieve rewards

This methods is used for retrieving rewards for user. Example:

```java
TalkableApi.retrieveRewards(new Callback1<Reward[]>() {
    @Override
    public void onSuccess(Reward[] rewards) {
        // Process success
    }

    @Override
    public void onError(ApiError error) {
        // Process error
    }
});
```
If you need get only rewards with some status or for other than user UUID,
you need to pass this data to this method. Example:

```java
Params params = new Params();
params.put("status", "Paid"); // Optional
params.put("visitor_uuid", "eb71e496-6567-41ec-a68c-49e96d101e0e"); // Some other uuid, optional
TalkableApi.retrieveRewards(params, new Callback1<Reward[]>() {
    @Override
    public void onSuccess(Reward[] rewards) {
        // Process success
    }

    @Override
    public void onError(ApiError error) {
        // Process error
    }
});
```

## Retrieve offer

This method is used to get offer details by it’s short code. Example:

```java
String shortUrlCode = "ABCXYZ";
TalkableApi.retrieveOffer(shortUrlCode, new Callback1<Offer>() {
    @Override
    public void onSuccess(Offer newOffer) {
        // Process success
    }

    @Override
    public void onError(ApiError e) {
        // Process error
    }
});
```

## Create offer share

If you have your own sharing mechanism, you can create shares using an API.
First, you need to create an Offer using the [registerOrigin](#create-origin) method.

### Email Share

Use the `createEmailShare` method to share an offer via email.

```java
String subject = "Email Subject"; // optional
String body = "Email custom message"; // optional
Boolean reminder = false; // whether Talkable should send a reminder email later; true by default; optional
ShareEmail email = new ShareEmail(subject, body, reminder); // optional

String recipients = "friend1@example.com,friend2@example.com"; // emails separated by commas; required
EmailOfferShare share = new EmailOfferShare(offer, recipients, email);
TalkableApi.createEmailShare(share, new Callback2<JsonElement, Reward>() {
    @Override
    public void onSuccess(JsonElement result, Reward reward) {
        // Process success
    }
    @Override
    public void onError(ApiError e) {
        // Process error
    }
});
```

> **Note:**
>
> `JsonElement result` from `onSuccess(JsonElement result, Reward reward)` contains data, described in [Shares API](https://www.talkable.com/api-docs/#/Shares/shareViaEmail) under the `result` key

### Social Share

Use the `createSocialShare` method to track a social share.

```java
SharingChannel channel = SharingChannel.FACEBOOK; // required
SocialOfferShare share = new SocialOfferShare(offer, channel);
TalkableApi.createSocialShare(share, new Callback2<SocialOfferShare, Reward>() {
    @Override
    public void onSuccess(SocialOfferShare createdShare, Reward reward) {
        // Process success
    }
    @Override
    public void onError(ApiError e) {
        // Process error
    }
});
```

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/android_sdk/custom_deep_linking.md
===============================================================================

# Integration with Third Party Deep Linking Services

Talkable can work with third party deep linking providers such as GetSocial,
Branch.io, and Firebase. Talkable is able to use deep linking functionality to
track app installations and reward your Advocates and Friends for installing your
mobile app on their phones.

Deep linking services provide a special referral link that can be given to
Advocates to be shared with their Friends. Once opened on a Friend’s mobile
device, this link will not only redirect them to the App Store to install the app,
but also track that the app was installed using a referral link. Deep linking can
also be used to send a Friend to a specific place in the app once it’s installed
and opened for the first time, show them personalized messages, and more.

## 1. Configure your Talkable campaign

To use deep linking with Talkable campaigns, simply use your deep link URL as your Talkable Site URL.

[Image]

> **Note:**
>
> If you have configured a custom Friend Destination URL for your campaign,
> make sure the following GET parameters are present in the final URL: `?tkbl_cvuuid={{ visitor_uuid }}&talkable_visitor_offer_id={{ friend_offer.id }}`.
>
> All major deep linking providers support passing additional GET parameters
> with the deep link. This functionality is used to pass the Friend’s identifying
> information to the Talkable SDK in your iOS app. To use this functionality with
> Firebase, refer to this document: [Manually constructing a Dynamic Link URL](https://firebase.google.com/docs/dynamic-links/create-manually).

## 2. Pass deep linking params to the Talkable SDK

Retrieve deep linking params as described in your deep linking provider’s
documentation and pass these params to the Talkable SDK using the `TalkableDeepLinking.track()` method. This method accepts a single argument of
following types:

* `JSONObject` (Branch.io)

* `Map<String, String>` (GetSocial)

* `android.net.Uri` (Firebase)

* `android.app.Activity` (native deep linking)

```java
// For Branch.io

Branch.getInstance().initSession(new Branch.BranchReferralInitListener() {
    @Override
    public void onInitFinished(JSONObject referringParams, BranchError error) {
        TalkableDeepLinking.track(referringParams);
    }
}, this.getIntent().getData(), this);
```

> **Note:**
>
> Most deep linking services provide additional parameters in the deep link
> handler to indicate whether the app was installed on this device for the first
> time, reinstalled or simply launched. You can use these params to register
> installs only when desired conditions are met.

```java
// For GetSocial

GetSocial.getReferralData(new FetchReferralDataCallback() {
    @Override
    public void onSuccess(@Nullable ReferralData referralData) {
        if (referralData != null && referralData.isFirstMatch()) {
            TalkableDeepLinking.track(referralData.getLinkParams().getStringValues());
        }
    }

    @Override
    public void onFailure(GetSocialException error) {}
}
```

```java
// For Firebase

FirebaseDynamicLinks.getInstance()
    .getDynamicLink(getIntent())
    .addOnSuccessListener(this, new OnSuccessListener<PendingDynamicLinkData>() {
        @Override
        public void onSuccess(PendingDynamicLinkData pendingDynamicLinkData) {
            // Get deep link from result (may be null if no link is found)
            Uri deepLink = null;
            if (pendingDynamicLinkData != null) {
                deepLink = pendingDynamicLinkData.getLink();
            }

            if (deepLink != null) {
                TalkableDeepLinking.track(deepLink);
            }
        }
    })
```
Calling the `TalkableDeepLinking.track()` method will register the app
installation event in Talkable and complete the referral cycle.
You can then use the [TalkableApi.retrieveRewards()](https://docs.talkable.com/android_sdk/api.md#android-sdk-api) method to check for rewards.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/android_sdk/getting_started.md
===============================================================================

# Getting Started

The Getting Started guide shows you how to setup and launch Referral Campaign
as quickly as possible with Talkable Android SDK.

## Installation

1. Add the JitPack repository to your project’s top level *build.gradle* file.

```groovy
allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}
```

2. Add TalkableSDK as a dependency to your module’s *build.gradle* file.

```groovy
dependencies {
  ...
  implementation 'com.github.talkable:android-sdk:0.5.12'
}
```

3. Setup Talkable credentials in `AndroidManifest.xml` file inside `<application>` element in the following format:

```xml
<application>
    ...
    <meta-data
        android:name="tkbl-api-key-{{YOUR_SITE_ID}}"
        android:value="{{YOUR_TALKABLE_PUBLIC_API_KEY}}" />
    ...
</application>
```

> **Note:**
>
> You can locate your credentials inside Talkable site:
>
> * Select site and go to **Dashboard** → **Settings** → **Site Settings** → **Integrations**.
> Find **API integration** section and there you will see your API Keys and Site ID (also known as Site slug).
> Use only the *Public API Key* in your production application.

4. Add deep linking scheme handler into your main activity entry or an activity you
want to handle deep links from Talkable.

```xml
<activity>
    ...
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />

    <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

    <data android:scheme="tkbl-{{YOUR_SITE_ID}}" />
    </intent-filter>
</activity>
```

5. Initialize Talkable in the `Application`:

```java
import com.talkable.sdk.Talkable;
import android.app.Application;

    public class App extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        Talkable.initialize(this);
    }
}
```

> **Note:**
>
> Make sure to add your application class name as `android:name` parameter of
> the `<application>` element in your manifest

6. Call `Talkable.trackAppOpen` inside you main activity class, like this:

```java
import com.talkable.sdk.Talkable;
import android.app.Activity;

    public class MainActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        ...

    Talkable.trackAppOpen(this);
    }
}
```

Here is an example of `AndroidManifest.xml` file (with `"demo-site"` site
ID) you should setup after steps above:

```xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.talkable.demo">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        android:name=".App">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data android:scheme="tkbl-demo-site" />
            </intent-filter>
        </activity>

        <!-- Talkable -->

        <meta-data
            android:name="tkbl-api-key-demo-site"
            android:value="nacsc9XseW4Kxne6AaJ" />

        <!-- End Talkable -->
    </application>
</manifest>
```
Your environment is all set up! Now you need to [integrate](https://docs.talkable.com/android_sdk/integration.md#android-sdk-integration) the Talkable campaign piece.

## Requirements

The SDK supports Android 4.1 and later.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/android_sdk/integration.md
===============================================================================

# Integration
> **Important:**
>
> Before integrating SDK campaigns into your app, make sure you have campaigns properly configured
> in Talkable. See [SDK Campaign Setup](https://docs.talkable.com/campaigns/tutorials/sdk_campaign_setup.md#campaigns-tutorials-sdk-campaign-setup) for complete
> campaign setup guide including tags, native sharing, and mobile optimization.

The SDK is installed and setup. Now you can integrate Standalone or/and Post Purchase campaigns into your mobile app.

* [Standalone Campaign](https://docs.talkable.com/android_sdk/integration/standalone.md#android-sdk-integration-standalone)

* [Post Purchase Campaign](https://docs.talkable.com/android_sdk/integration/post_purchase.md#android-sdk-integration-post-purchase)

* [Custom Events](https://docs.talkable.com/android_sdk/integration/event.md#android-sdk-integration-event)

* [Standalone Campaign](https://docs.talkable.com/android_sdk/integration/standalone.md)
* [Post Purchase Campaign](https://docs.talkable.com/android_sdk/integration/post_purchase.md)
* [Custom Events](https://docs.talkable.com/android_sdk/integration/event.md)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/android_sdk/integration/event.md
===============================================================================

# Custom Events

In addition to Signup and Purchase incentives, Talkable campaigns can utilize [custom events](https://docs.talkable.com/advanced_features/events.md#advanced-features-events) to issue rewards based on other actions performed by Advocates and Friends, such as purchasing a subscription, completing a game level, or simply visiting a certain place in your app. Register an event every time the user performs the desired action in your app.

An Event has two required properties: event category and event number. Please refer to [available properties](https://docs.talkable.com/advanced_features/events.md#advanced-features-events-available-properties) for a complete list of optional properties.

```java
String eventNumber = "ev123789"; //must be unique for given category
String eventCategory = "subscription_purchased";

Event event = new Event(eventNumber, eventCategory);

TalkableApi.createOrigin(event, new Callback2<Origin, Offer>() {...});
```
If you have a Talkable offer configured for this event, the Talkable campaign screen will be displayed as a result of calling the `createOrigin` method.
> **Warning:**
>
> Unlike the default [Standalone](https://docs.talkable.com/android_sdk/integration/standalone.md#android-sdk-integration-standalone) and [Post Purchase](https://docs.talkable.com/android_sdk/integration/post_purchase.md#android-sdk-integration-post-purchase) integrations, the event-based integration will not automatically use the default campaign tag (`android-invite` or `android-post-purchase` respectively). To match your events to the desired Talkable campaign, you **must** specify the correct campaign tag when creating an event.

Customer data can be added to the registered event. Custom properties passed with the event will be added to the customer profile.

```java
String email = "advocate@example.com";
String firstName = "John";
String lastName = "Smith";
HashMap<String, String> customProperties = new HashMap<String, String>();
customProperties.put("property_key", "property_value");
Customer customer = new Customer(null, firstName, lastName, email, customProperties);

String eventNumber = "ev123789";
String eventCategory = "subscription_purchased";

Event event = new Event(eventNumber, eventCategory);
event.setCustomer(customer);

TalkableApi.createOrigin(event, new Callback2<Origin, Offer>() {...});
```
Please refer to the [Integrating Events](https://docs.talkable.com/advanced_features/events.md#advanced-features-events) page to learn more about event-based campaigns.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/android_sdk/integration/post_purchase.md
===============================================================================

# Post Purchase Campaign

Now that we know what a Standalone campaign is, let’s take a look at one more type of Talkable
campaign — Post Purchase. It is used to convert your existing customers into Advocates after
they make a purchase. It has the same flow as a basic Standalone campaign except this is gated
by a purchase and shown to a customer immediately after it.

Post Purchase campaign usually looks like a pop up right after a user made a purchase. This
campaign is initialized on the order confirmation page and captures order details parameters. You
need to pass order data to Talkable that includes your customer’s email address, order number, subtotal, coupon
codes used at checkout to allow Talkable detect and close a referral loop.

Here is an example of a Purchase capturing, this action should be triggered on the order confirmation page:

```java
import com.talkable.sdk.Talkable;
...
Double price = 10.99;
Integer quantity = 1;
String productId = "1";
Item item = new Item(subtotal, quantity, productId);
item.setTitle("Item Title"); // Optional
item.setUrl("https://site.com/product.html"); // Optional
item.setImageUrl("https://site.com/image.jpg"); // Optional

Double subtotal = price * quantity; // Required
String orderNumber = "123456"; // Required
String[] coupons = {"EXAMPLE-CODE-1", "EXAMPLE-CODE-2"}; // Optional

HashMap<String, String> customProperties = new HashMap<String, String>();
customProperties.put("property_key", "property_value");

Customer customer = new Customer(email);
customer.setCustomProperties(customProperties);

Purchase purchase = new Purchase(subtotal, orderNumber, coupons);
purchase.setCustomer(customer); // Required
purchase.addItem(item); // Optional

String campaignTag = "android-post-purchase";
purchase.setCampaignTag(campaignTag); // Optional

Activity activity = this;
Talkable.showOffer(activity, purchase, new TalkableErrorCallback<TalkableOfferLoadException>() {
    @Override
    public void onError(TalkableOfferLoadException error) {
        // Error handling. Note that it runs on non UI thread
    }
});
```

> **Note:**
>
> If Post Purchase campaign does not show up when testing make sure you have it Live
> on the Campaigns listing with android-post-purchase tag or the tag you specified
> in setCampaignTag.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/android_sdk/integration/standalone.md
===============================================================================

# Standalone Campaign
> **Note:**
>
> For information about setting up campaigns to work with Android SDK, including campaign tags,
> native sharing, and mobile optimization, see [SDK Campaign Setup](https://docs.talkable.com/campaigns/tutorials/sdk_campaign_setup.md#campaigns-tutorials-sdk-campaign-setup).

Let’s take a look at how the Standalone campaign integration looks. The main purpose
of this type of campaign is to drive your users to invite their friends (to become Advocates)
without being gated by a purchase beforehand.

Usually Standalone campaign look like a separate widget that people can access by clicking on
the “Invite friends” button inside app navigation.

Once you’ve got a Standalone campaign set up inside Talkable you can integrate the campaign
with the following line of code:

```java
import com.talkable.sdk.Talkable;
...

Activity activity = this;
AffiliateMember affiliateMember = new AffiliateMember();
Talkable.showOffer(activity, affiliateMember, new TalkableErrorCallback<TalkableOfferLoadException>() {
    @Override
    public void onError(TalkableOfferLoadException error) {
        // Error handling. Note that it runs on non UI thread
    }
});

...
```

> **Note:**
>
> Make sure you have at least one Live “SA” campaign inside Talkable Site with android-invite tag or the tag you specified

Note that customer is empty, in this case user will see the [Advocate Signup Form](https://docs.talkable.com/campaigns/views/offers_show.md#campaigns-views-offers-show), which is used to collect
the user’s email address. Your application may already know/have access to the user’s email,
if so, you should pass this parameter which will automatically skip the Signup Form in the
flow and show the [Advocate Share Form](https://docs.talkable.com/campaigns/views/offers_show.md#campaigns-views-offers-show).

```java
import com.talkable.sdk.Talkable;
...

String email = "advocate@example.com"; // Required
String idInYourApp = "a8db7683-0f7f-407e-8d12-af2d501035c8"; // Use unique identifier from your system, optional
String firstName = "John"; // Optional
String lastName = "Smith"; // Optional
HashMap<String, String> customProperties = new HashMap<String, String>();
customProperties.put("property_key", "property_value");
Customer customer = new Customer(idInYourApp, firstName, lastName, email, customProperties);

AffiliateMember affiliateMember = new AffiliateMember(customer);
String campaignTag = "android-invite";
affiliateMember.setCampaignTag(campaignTag);

Activity activity = this;
Talkable.showOffer(activity, affiliateMember, new TalkableErrorCallback<TalkableOfferLoadException>() {
    @Override
    public void onError(TalkableOfferLoadException error) {
        // Error handling. Note that it runs on non UI thread
    }
});
...
```

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/android_sdk/react_native.md
===============================================================================

# React Native

Talkable supports React Native apps through the Talkable API. You build the referral program
interface in your React Native app and connect it to Talkable using the API. The Friend Claim
Page is hosted by Talkable.

The Android SDK documented in this section is a framework for native Android apps. If your
app is built with React Native, use the Talkable API instead of embedding the SDK. The steps
below describe how.

## How it works

The referral flow is the same as any Talkable API integration.
See [Referral Program via API](https://docs.talkable.com/api_v2/flow.md#api-v2-flow) for the full walkthrough.
In your React Native app you:

* Generate a Talkable Offer for the Advocate.

* Let the Advocate share the Offer via social network or email.

* Let the Friend claim the Offer on the Claim (Landing) page after following the share URL.

* Let Talkable know about a Purchase or Event so it can close the referral chain and trigger the reward.

Reference docs:

* [Referral Program via API](https://docs.talkable.com/api_v2/flow.md#api-v2-flow) — the end-to-end integration flow.

* [API Introduction](https://docs.talkable.com/api_v2/intro.md#api-v2-intro) — base URL, authentication, response and error formats.

* [Origins](https://docs.talkable.com/api_v2/origins.md#api-v2-origins) — the Purchase or Event reporting that triggers rewards.

## What to expect

* You build the referral UI in React Native, using your own components and branding.

* Talkable provides the referral functionality via the API: offers, shares, attribution, and rewards.

* There is no React Native package to install.
You integrate using the API, and the same integration works for both iOS and Android.

## Reusing the SDK’s API wrapper (optional)

The Android SDK also provides helper methods that call the Talkable API for you — creating a
Visitor or Origin, creating shares, and retrieving offers and rewards. These are documented
on the [Android SDK API](https://docs.talkable.com/android_sdk/api.md#android-sdk-api) page, with Java examples for each step.

You do not need the SDK to integrate React Native; calling the API directly requires no
native dependency. You can bridge these helper methods into React Native if you prefer. The [Android SDK API](https://docs.talkable.com/android_sdk/api.md#android-sdk-api) page is also a useful reference for the same Visitor,
Origin, Share, and Reward steps if you call the API directly.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/android_sdk/testing.md
===============================================================================

# Testing

By default, Talkable SDK assigns a permanent ID to each device and uses it to prevent multiple registrations
from a single phone. This helps prevent fraud but can make it challenging to test the referral cycle on
real devices, requiring the developer to either flush all their Talkable campaign data, or use a new campaign
for each test run. Talkable SDK provides tools designed to help with this situation that are available
in debug mode.

The full form of Talkable.initialize method allows you to enable the debug mode. In debug mode Talkable SDK
will assign a new ID to the device every time it’s initialized, allowing you to be registered as a new visitor each time
the app is launched.

```java
String initialSiteId = null; // pass null to use the Site ID specified in your manifest
boolean debug = true;

Talkable.initialize(this, initialSiteId, debug, null);
```
You can use the last param to pass a custom device ID, allowing you to switch between user identities manually. This way
you can use a single device to pose as an Advocate or Friend and easily replicate various scenarios. The custom device ID
will be applied only if debug is set to true.

```java
String initialSiteId = null;
boolean debug = true;
String customDeviceId = "qa-advocate-007";

Talkable.initialize(this, initialSiteId, debug, customDeviceId);
```

> **Warning:**
>
> Debug mode must be turned off for release builds. Leaving it enabled will break the referral cycle and expose you to fraud.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/android_sdk/upgrade.md
===============================================================================

# Upgrade

Sometimes we need you to upgrade existing integration to use our latest features.

## 0.5.12

Migrated to AndroidX, updated Facebook SDK.

## 0.5.11

Added WhatsApp sharing support. Fixed WebView reload bug.

## 0.5.10

Added flag about availability of native email sharing to the native features header.
Improved native features stability.

## 0.5.9

Added support for native email sharing.

## 0.5.8

Added compatibility with Gradle 5.x

Added ability to [set custom properties](https://docs.talkable.com/android_sdk/integration/standalone.md#android-sdk-integration-standalone) on Customer

Updated Visitor registration logic to meet updated Talkable requirements

## 0.5.7

Added [debug mode](https://docs.talkable.com/android_sdk/testing.md#android-sdk-testing) to facilitate testing.

Fixed bug with missing getter methods in the Reward model.

## 0.5.6

SDK is now available as a [Maven package on JitPack](https://jitpack.io/#talkable/android-sdk).

## 0.5.5

Added support for [third party deep linking providers](https://docs.talkable.com/android_sdk/custom_deep_linking.md#android-sdk-custom-deep-linking).

Improved authentication and error handling for API requests.

## 0.5.4

Fixed crashes when the server sends bad responses.

## 0.5.3

Added `createEmailShare` and `createSocialShare` methods to `TalkableApi`.

Deprecated `createShare` methods from `TalkableApi`.

## 0.5.2

Added support for `title`, `url` and `imageUrl` attributes for `Item`.

## 0.5.1

Added multiple coupons support for `Event` and `Purchase`.

## 0.5.0

Added an ability to [handle errors](https://docs.talkable.com/android_sdk/advanced.md#error-handling) when showing Offer.

To update from the previous version, please do following steps.

1. Update dependencies inside `build.gradle`:

```groovy
// From
compile 'com.google.code.gson:gson:2.7'
compile 'com.android.support:support-v4:25.3.1'

    // To
compile 'com.google.code.gson:gson:2.8'
compile 'com.android.support:support-v4:26.1.0'
```

2. Use `showOffer` functions with a callback parameter.

```java
// From
showOffer(activity, origin);

    // To
showOffer(activity, origin, new TalkableErrorCallback<TalkableOfferLoadException>() {
    @Override
    public void onError(final TalkableOfferLoadException error) {
        // Error handling. Note that it runs on non UI thread
    }
});
```

3. Use `Talkable.setSiteSlug` functions without Context as a parameter.

```java
// From
setSiteSlug(context, "site-slug");

    // To
setSiteSlug("site-slug");
```

4. `TalkableOfferFragmentListener` interface implementation is optional now.

5. In case you used `TalkableOfferFragment` directly check out [a new workflow](https://docs.talkable.com/android_sdk/advanced.md#using-fragment-directly).

## 0.4.2

Read Contacts permission is optional from this version.

In case you used `import_contacts` callback, you have to define `READ_CONTACTS` permission inside the manifest:

```xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.app.myapp" >
<uses-permission android:name="android.permission.READ_CONTACTS" />
...
</manifest>
```

## 0.4.1

Fixed an issue inside `TalkableOfferFragment`.

## 0.4.0

### Added multiple site slugs support. Bugs fixing.

From this moment you can operate with multiple Talkable sites inside Talkable SDK.
Look in [Advanced Usage](https://docs.talkable.com/android_sdk/advanced.md#android-sdk-advanced) for more detailed information if needed.

To update from the previous version, please do following steps.

1. Update dependencies inside `build.gradle`.

```groovy
// From
compile 'com.google.code.gson:gson:2.4'
compile 'com.android.support:support-v4:24.2.1'

    // To
compile 'com.google.code.gson:gson:2.7'
compile 'com.android.support:support-v4:25.3.1'
```

2. Change credentials setup inside the manifest.

```xml
<!-- From -->
<application>
    ...
    <meta-data
        android:name="TalkableApiKey"
        android:value="{{YOUR_TALKABLE_PUBLIC_API_KEY}}" />
    <meta-data
        android:name="TalkableSiteSlug"
        android:value="{{YOUR_SITE_SLUG}}" />
    ...
</application>

    <!-- To -->
<application>
    ...
    <meta-data
        android:name="tkbl-api-key-{{YOUR_SITE_SLUG}}"
        android:value="{{YOUR_TALKABLE_PUBLIC_API_KEY}}" />
    ...
</application>
```

3. Initialize Talkable in the `Application`.

```java
import com.talkable.sdk.Talkable;
import android.app.Application;

    public class App extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        Talkable.initialize(this);
    }
}
```

> **Note:**
>
> Make sure to add your application class name as `android:name` parameter of
> the `<application>` element in your manifest

4. Call `Talkable.trackAppOpen` inside you main activity class, like before.

```java
import com.talkable.sdk.Talkable;
import android.app.Activity;

    public class MainActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        ...

    Talkable.trackAppOpen(this);
    }
}
```

From this version defining of `TalkableActivity` and `InstallReferrerReceiver` inside Android Manifest is not necessary.

## 0.3.1

### Introducing `TalkableOfferFragmentListener` interface. Bugs fixing.

Fixed a bug when no campaign found and added `TalkableOfferFragmentListener` interface.

To use instance of `TalkableOfferFragment` directly you have to implement `TalkableOfferFragmentListener` interface from `TalkableOfferFragment` class inside an activity that uses the fragment.
Look in [Advanced Usage](https://docs.talkable.com/android_sdk/advanced.md#android-sdk-advanced) for more detailed information if needed.

## 0.3.0

### Move to Fragments

Talkable SDK is built on top of [Fragments](https://developer.android.com/reference/android/support/v4/app/Fragment.html) (from Support Library) instead of Activities now to provide more flexibility for end users.

## 0.2.0

### Deep linking scheme

Add this to `AndroidManifest.xml` inside definition of Talkable activity

```xml
<intent-filter>
    <action android:name="android.intent.action.VIEW" />

    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />

    <data android:scheme="tkbl-{{YOUR_SITE_SLUG}}" />
</intent-filter>
```

### Tracking app opening

Replace `Talkable.initialize(this);` with `Talkable.trackAppOpen(this);` in your main activity.
Look in [installation section](https://docs.talkable.com/android_sdk/getting_started.md#main-activity-setup) for more detailed information if needed.

## 0.1.0

It’s initial release, nothing to do.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/api_v2.md
===============================================================================

# API Reference

* [Introduction](https://docs.talkable.com/api_v2/intro.md)
  * [Access the Talkable API](https://docs.talkable.com/api_v2/intro.md#access-the-talkable-api)
  * [Authentication](https://docs.talkable.com/api_v2/intro.md#authentication)
  * [Response Format](https://docs.talkable.com/api_v2/intro.md#response-format)
  * [Date Format](https://docs.talkable.com/api_v2/intro.md#date-format)
  * [Errors](https://docs.talkable.com/api_v2/intro.md#errors)
  * [Request Throttling](https://docs.talkable.com/api_v2/intro.md#request-throttling)

* [Referral Program via API](https://docs.talkable.com/api_v2/flow.md)
  * [Initial Origin](https://docs.talkable.com/api_v2/flow.md#initial-origin)
  * [Displaying and Sharing the Offer](https://docs.talkable.com/api_v2/flow.md#displaying-and-sharing-the-offer)
  * [Claiming an Offer](https://docs.talkable.com/api_v2/flow.md#claiming-an-offer)
  * [Submit Origin data to Talkable to generate the Referral](https://docs.talkable.com/api_v2/flow.md#submit-origin-data-to-talkable-to-generate-the-referral)
* [Origins](https://docs.talkable.com/api_v2/origins.md)
* [Referrals](https://docs.talkable.com/api_v2/referrals.md)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/api_v2/flow.md
===============================================================================

# Referral Program via API

This flow helps to integrate with Talkable via API for a default Store or Service.
It shows how you can do the following actions via API:

* Generate Talkable Offer

* Share An offer via Social Network or Email

* Build an Offer Claim Page on your side

* Let Talkable know about Purchase or Event to let it trigger the referral

Each of these steps can be done individually or all together to achieve API integration
> **Note:**
>
> For accounts created after April 2025, API requests automatically generate an Activity,
> whereas accounts created before April 2025 don’t track Activity when making API calls,
> meaning offers aren’t marked as shown and won’t contribute to advocate impression counts.
>
> If needed, please contact your Talkable account manager to migrate your account to the new logic.

## Initial Origin

Invite Advocate to referral program at some point by creating an [Origin](https://www.talkable.com/api-docs/#/Origins/createOrigin) and obtaining [Offer](https://www.talkable.com/api-docs/#/Advocate%20Offers/findAdvocateOffer) to share.

## Displaying and Sharing the Offer

Display options for Advocate to share with their Friends.

**For Social Share**

* Retrieve unique links for each channel for [Offer](https://www.talkable.com/api-docs/#/Advocate%20Offers/findAdvocateOffer) (claim_urls interpolation)

* After Advocate have shared, make corresponding request to [Shares API](https://www.talkable.com/api-docs/#/Shares/shareViaSocialChannel)

**For Email Share**

* Ask Advocate for recipients (and additional information) and make request to [Shares API](https://www.talkable.com/api-docs/#/Shares/shareViaEmail)

## Claiming an Offer

In order for Friend to get referred, they go to the Claim (or Landing) page by following the share URL.

This is the last step before Friend proceeds to your site or app.

* Edit your [Friend Claim Page](https://docs.talkable.com/campaigns/views/offers_claim.md#campaigns-views-offers-claim) template or disable it for immediate redirect

* Edit the Destination URL in *Extra* window
> **Important:**
>
> You need to pass the visitor uuid variable to your site via the destination URL GET parameter and store it somewhere in order to later pass it with [Origin](https://www.talkable.com/api-docs/#/Origins/createOrigin)

Example destination URL: http://merchant.com?tkbl_cvuuid={{visitor_uuid}}&utm_source=talkable&…

## Submit Origin data to Talkable to generate the Referral

Once any user makes an action that implies a possible close of a referral chain, send an [Origin](https://www.talkable.com/api-docs/#/Origins/createOrigin). Please include uuid in this request if possible.

For example, if Friend makes a purchase on your site or installs your app — Advocate needs to be rewarded, and this is achieved with creating [Purchase or Event](https://docs.talkable.com/api_v2/origins.md#api-v2-origins) which gets linked to previously created Advocate offer.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/api_v2/intro.md
===============================================================================

# Introduction

The Talkable API is built on HTTP. Our API is RESTful, returns JSON and responds
with standard HTTP response codes to indicate errors.

## Access the Talkable API

You can access documentation for the Talkable API and issue API calls from the Talkable API user interface.

The Talkable API user interface is available here:

[https://www.talkable.com/api-docs/](https://www.talkable.com/api-docs/)

Click **Authorize** to log in with the [API key](#authentication):

[Image]

Enter the [API key](#authentication) and click **Authorize** again:

[Image]

Click **Close**. The Authorize lock icon changes to locked:

[[Image]](https://docs.talkable.com/_images/authorize3.png.md)

#### Actions

For details about the API call, expand the API method for each call. To issue an
API call from the Talkable API user interface, click **Try it out** for any
method. Edit the Example Values in the request body and click **Execute**.

[Image]

## Authentication

You authenticate to the Talkable API by providing your API Key in the request.
You can manage your API key in the Account Settings.
> **Warning:**
>
> Keep your API key secret!
>
> You should not embed the API key within a web page and make Talkable API calls
> within JavaScript running within a browser. Once someone has your API key, they
> could create their own API calls.

Authentication to the API is performed via Bearer authentication header.

#### Example Request

```bash
curl 'https://www.talkable.com/api/v2/campaigns?site_slug=my-store' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer i9uil7nQgDjucCiTJu'
```

## Response Format

The API returns JSON-encoded objects (content-type: application/json).

Responses vary according to the method used, but every successful response
envelope includes these common parts:

```javascript
{"ok": true, "result": ...}
```

## Date Format

Talkable returns JSON for all API calls. JSON does not have a built-in date type,
dates are passed as strings encoded according to [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601).
This format is supported by most programming languages out of the box:

```text
2022-02-16T02:43:58.797-07:00
```

## Errors

The following represents a common JSON error response resulting from a failed
Talkable API call:

```javascript
{"ok": false, "error_message": "Message describing the error"}
```
Most error messages that Talkable API will return are not meant to be shown to
the user. We expect your service to gracefully handle errors and only show
meaningful information to the user.

Talkable returns standard HTTP response codes.

| Code               | Description                                                                                                                                            |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 200, 201           | Everything worked as expected                                                                                                                          |
| 400                | Bad Request - Often missing a required parameter                                                                                                       |
| 401                | Unauthorized - No valid API key provided                                                                                                               |
| 404                | Not Found - The requested item doesn’t exist                                                                                                           |
| 422                | Unprocessable Entity - The requested create, update, or delete cannot be performed due to validation errors.   See the response body for more details. |
| 429                | Too Many Requests                                                                                                                                      |
| 500, 502, 503, 504 | Server Errors - Something is wrong on Talkable’s end                                                                                                   |

## Request Throttling

Talkable limits the rate of requests to ensure that services are reliable and
responsive for customers. Our throttling mechanism is implemented in the next
way: we calculate number of resources each client consumes for all requests made
to Talkable (not only API requests, but rather all requests from all
integrations e.g. JavaScript integration library, Mobile SDK etc.), and if the
customer (site) consumption of the resources increases unexpectedly, we start to
throttle requests for this customer by responding with HTTP status code `429`.
Rate limits are not published because the computation logic is evolving
continuously to maximize reliability and performance for customers.
> **Note:**
>
> In case the request was throttled and the server responded with HTTP status
> code `429`, we recommend to retry the request. Consecutive calls might
> return `429` until the load on the server goes down. Your application
> should implement a retry logic with incremental backoff in the realm of
> seconds and up to minutes.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/api_v2/origins.md
===============================================================================

# Origins

The Talkable [Origins API](https://www.talkable.com/api-docs/#/Origins/createOrigin) allows the registration of ‘off-site’ or ‘backend’
purchases or CRM events so they can be used in the referral flow. This
functionality is generally utilized by businesses using subscription billing,
off-site transactions, or other off-site events.
> **Note:**
>
> The [standard front-end](https://docs.talkable.com/integration/standard/overview.md#integration-standard-overview) Talkable
> integration will capture all one-time purchases happening on the client
> e-commerce site, but will not on its own capture purchases or CRM events
> happening on the backend. To do this, the [Origins API](https://www.talkable.com/api-docs/#/Origins/createOrigin) must be utilized to
> feed ‘off-site’ or ‘backend’ purchases or CRM events to Talkable.

## Example use cases for the Origins API

**Subscription:**

A company whose customers sign up for a monthly service by making an initial
‘on-site’ payment, then are charged monthly on the backend for subsequent
subscription payments. This company would like to reward Advocate users
(referrers) with a reward after their Friend has been a member for three
billing cycles.

* Talkable’s [standard front-end](https://docs.talkable.com/integration/standard/overview.md#integration-standard-overview) integration captures the initial ‘on-site’ payment.

* For Talkable to reward the Advocate after the third billing cycle of the Friend subscription, the Company must pass the subsequent subscription
data to Talkable’s [Origins API](https://www.talkable.com/api-docs/#/Origins/createOrigin) using `"type": "Event"`.

**Off-Site Events:**

A company whose customers purchase product or perform events off-site. This
company would like to reward Advocate users (referrers) with a reward after
their Friend has purchased a product in the brick and mortar store, or
attended an in-person appointment.

* Talkable’s [standard front-end](https://docs.talkable.com/integration/standard/overview.md#integration-standard-overview) integration captures an initial ‘on-site’ signup event if there is one.

* For Talkable to reward the Advocate after the in-person Friend store
purchase, or appointment attendance, the Company must pass the in-store
purchase, or appointment attendance data to Talkable’s [Origins API](https://www.talkable.com/api-docs/#/Origins/createOrigin) with
either `"type": "Purchase"` for a purchase or `"type": "Event"` for an
appointment attendance.

**User Approval:**

User approval use cases start with customers who need to submit an application
by performing an initial ‘on-site’ sign-up event. This company would like to
reward Advocate users (referrers) with a reward after their Friend application is approved.

* Talkable’s [standard front-end](https://docs.talkable.com/integration/standard/overview.md#integration-standard-overview) integration captures the initial ‘on-site’ application sign-up event.

* In order for Talkable to reward the Advocate after the Friend application approval, the Company must pass the approval data to Talkable’s [Origins API](https://www.talkable.com/api-docs/#/Origins/createOrigin) using `"type": "Event"`.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/api_v2/referrals.md
===============================================================================

# Referrals

The Talkable [Referrals API](https://www.talkable.com/api-docs/#/Referrals/updateReferralStatus) allows referrals to be approved or voided.

## Example use cases for the Referrals API

**Voiding referrals after a purchase is returned or canceled:**

A company who wants to ensure an Advocate does not receive referral Rewards
if the Friend returns their purchase. To prevent the Advocate from receiving
their referral reward, this company would call the Talkable [Referrals API](https://www.talkable.com/api-docs/#/Referrals/updateReferralStatus) with `{"status": "voided"}` after the Friend order is canceled.

**Approving Referrals only after a specific CRM Event:**

A company who wants to approve referral rewards only after the Friend order
has reached a certain state (ie, ‘shipped’, or ‘no longer refundable’) can
control this Referral Approval with the Talkable [Referrals API](https://www.talkable.com/api-docs/#/Referrals/updateReferralStatus). This company
would call the Talkable [Referrals API](https://www.talkable.com/api-docs/#/Referrals/updateReferralStatus) with `{"status": "approved"}` after
the Friend order reaches the desired state.
> **Note:**
>
> There is no need to filter the orders for which the Talkable [Referrals API](https://www.talkable.com/api-docs/#/Referrals/updateReferralStatus) is
> called. Call Talkable’s [Referrals API](https://www.talkable.com/api-docs/#/Referrals/updateReferralStatus) for all purchases, not just those
> associated with a referral purchase. Talkable will decide which order numbers
> are tied to referrals.
>
> Also: Inside ‘Fraud Settings’ exists two options for Referrals Approval
> configuration. When ‘Automatic’ Referrals Approvals selected, eligible
> Referrals will be approved a fixed number of hours or days (per configuration)
> after the Friend Purchase and/or Conversion Event. When ‘Manual’ Referrals
> Approval is selected, referral rewards will only be paid out after either the
> Talkable [Referrals API](https://www.talkable.com/api-docs/#/Referrals/updateReferralStatus) is called with `{"status": "approved"}` or after an
> Admin has approved the referral from inside the Talkable Customer Service
> Portal.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns.md
===============================================================================

# Talkable Campaigns

Talkable Campaign is based on interaction between `Advocate` and `Friend`:

* Advocate: person, who shares an offer with their Friend(s)

* Friend: person, who is invited to participate in Campaign by Advocate

[Image]

Each step of this interaction has its own `View` so developer can easily
change every single step and customize its appearance and functionality based on
campaign requirements.

We use [Liquid](https://github.com/Shopify/liquid) as a View template engine to provide a simple and quick way
to change campaign functionality and appearance.  
This choice was made mainly because of developers who are already
familiar with Liquid templating in Shopify.

To start editing Views simply visit `Editor` page from the Campaign dashboard.

## Campaign Types and Placements

* [Campaign Types](https://docs.talkable.com/campaigns/campaign_types.md)
  * [Invite](https://docs.talkable.com/campaigns/campaign_types.md#invite)
  * [Advocate Dashboard](https://docs.talkable.com/campaigns/campaign_types.md#advocate-dashboard)
  * [Reward Gleam](https://docs.talkable.com/campaigns/campaign_types.md#reward-gleam)
  * [Leaderboard](https://docs.talkable.com/campaigns/campaign_types.md#leaderboard)
  * [Tiered Rewards](https://docs.talkable.com/campaigns/campaign_types.md#tiered-rewards)
  * [Claim by Name](https://docs.talkable.com/campaigns/campaign_types.md#claim-by-name)

* [Campaign Placements](https://docs.talkable.com/campaigns/campaign_placements.md)
  * [Managing Placements](https://docs.talkable.com/campaigns/campaign_placements.md#managing-placements)
  * [Priority](https://docs.talkable.com/campaigns/campaign_placements.md#priority)
  * [Visibility](https://docs.talkable.com/campaigns/campaign_placements.md#visibility)
  * [Custom Property Criteria](https://docs.talkable.com/campaigns/campaign_placements.md#custom-property-criteria)
  * [Container Name](https://docs.talkable.com/campaigns/campaign_placements.md#container-name)

## Campaign Structure

* [Views](https://docs.talkable.com/campaigns/views.md)
  * [Advocate Signup/Share Page](https://docs.talkable.com/campaigns/views/offers_show.md)
  * [Advocate Offer Email](https://docs.talkable.com/campaigns/views/notifier_offers_email.md)
  * [Friend Share Email](https://docs.talkable.com/campaigns/views/notifier_offers_share_via_email.md)
  * [Friend Share Email Reminder](https://docs.talkable.com/campaigns/views/notifier_offers_share_via_email_reminder.md)
  * [Friend Claim Page](https://docs.talkable.com/campaigns/views/offers_claim.md)
  * [Advocate Reward Confirmation Email](https://docs.talkable.com/campaigns/views/advocate_rewards_confirmation.md)
  * [Advocate Reward Paid Email](https://docs.talkable.com/campaigns/views/advocate_rewards_paid.md)
  * [Friend Reward Paid Email](https://docs.talkable.com/campaigns/views/friend_rewards_paid.md)

## Campaign Setup & tutorials

* [Tutorials](https://docs.talkable.com/campaigns/tutorials.md)
  * [Global](https://docs.talkable.com/campaigns/tutorials/global.md)
  * [Advocate Signup/Share Page](https://docs.talkable.com/campaigns/tutorials/offers_show.md)
  * [Friend Claim Page](https://docs.talkable.com/campaigns/tutorials/offers_claim.md)
  * [Incentive Criteria](https://docs.talkable.com/campaigns/tutorials/incentive_criteria.md)
  * [SDK Campaign Setup](https://docs.talkable.com/campaigns/tutorials/sdk_campaign_setup.md)
* [Offers Expiration](https://docs.talkable.com/campaigns/offers_expiration.md)
* [Localization](https://docs.talkable.com/campaigns/localization.md)

* [Editor](https://docs.talkable.com/campaigns/editor.md)
  * [Variables](https://docs.talkable.com/campaigns/editor/variables.md)
  * [Files](https://docs.talkable.com/campaigns/editor/files.md)
  * [History](https://docs.talkable.com/campaigns/editor/history.md)
  * [Filters](https://docs.talkable.com/campaigns/editor/filters.md)
  * [Videos](https://docs.talkable.com/campaigns/editor/videos.md)
  * [Partials](https://docs.talkable.com/campaigns/editor/partials.md)

## Designer Guide

* [Designer](https://docs.talkable.com/campaigns/designer.md)
  * [Web view size](https://docs.talkable.com/campaigns/designer.md#web-view-size)
  * [Email size](https://docs.talkable.com/campaigns/designer.md#email-size)
  * [Fonts](https://docs.talkable.com/campaigns/designer.md#fonts)
  * [Responsive view’s height](https://docs.talkable.com/campaigns/designer.md#responsive-views-height)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/campaign_placements.md
===============================================================================

# Campaign Placements

Campaign Placements are the places (pages) on your site where the Campaigns are shown to your customers.

The list of all Campaign Placements can be found by going to the All Site Settings page from the header Menu (top right corner) and choosing the Placements section:

[Image]

## Managing Placements

By default you already have all types of Placements created automatically.
Campaigns that you create will attach to one of these Placements based on their types.
If you want you can create a new Standalone Placement for your site matching another URL and attach another
Standalone Campaigns there.
> **Note:**
>
> Placements are strictly tied to their Campaign types.
> You cannot attach Post Purchase Campaign to Standalone Placement because it expects Campaigns that are going to be embedded not being shown as a popup.

## Priority

The Placements in the list are ordered by priority. In order to show a Campaign, Talkable matches
the URL of a Campaign Placement inclusion (marked as “Shown on”) and a URL that comes with each request that
users initiate, for example: https://[your-site]/share. Whenever multiple Campaign Placements fit the requested URL
Talkable picks the first Placement that sits up top out of the suitable ones. Other Placements that sit below it are
ignored in this case.

## Visibility

It is possible to indicate on which specific pages the Campaigns attached to the Placement should or should not be shown.
It allows you to show the Campaign on all pages of your site except few specified in the “Hidden on” section, for example.
Also, you can use [regular expressions](https://docs.talkable.com/advanced_features/reg_ex.md#advanced-features-reg-ex) to select pages you want to not show Talkable campaigns on.

## Custom Property Criteria

A Placement can have a set of criteria defined based on [custom properties](https://docs.talkable.com/advanced_features/passing_custom_data.md#advanced-features-passing-custom-data).
If all of the criteria are met, the placement will show a campaign.

The criteria can be defined using one of the following operators:

* eq

* not_eq

* regex (performs a case-insensitive match)
> **Note:**
>
> Custom Property Criteria require integration version 5.1.4 or higher to work.

## Container Name

It is possible to update the container name by requesting assistance from the Talkable team.
The current DIV id value for each Event Category can be found on the Placements page.

By default, the DIV id is:

* talkable-offer for affiliate_member event category which includes: Standalone, Standalone Dashboard, Floating Widget, Gleam;

* talkable-post-purchase for purchase event category which includes: Post Purchase;

* talkable-claim-by-name for claim_by_name_popup event category which includes: Claim By Name;

* talkable-email-capture-offer for email_capture_popup event category which includes: Conversion Popup;

* talkable-loyalty for loyalty_dashboard and loyalty_widget event categories which include: Loyalty Dashboard and Loyalty Widget.
> **Note:**
>
> Container name changes require integration version 5.3.0 or higher to work.

---




### Referral Placements

#### Standalone

Campaign will show up on the standalone page on your site, for example:  
https://[your-site]/share.  
Campaign will be rendered as an inline block in a corresponding Talkable DIV tag.

[Learn more about Standalone Placement](https://docs.talkable.com/campaigns/campaign_placements/standalone.md#campaigns-campaign-placements-standalone)

#### Post Purchase

Campaign will show up on a successful purchase made by the customer on your site.
Usually this is an order confirmation page after checkout.
The campaign will look like a popup with an overlay and a close button.

[Learn more about Post Purchase Placement](https://docs.talkable.com/campaigns/campaign_placements/post_purchase.md#campaigns-campaign-placements-post-purchase)

#### Floating Widget

Campaign will show up on every page as a floating button in a corner of the screen so customers are able to access
Talkable campaigns from anywhere on your site.
Clicking on a Floating Widget Campaign expands the full Campaign view that looks like a popup with an overlay
and a close button.

[Learn more about Floating Widget Placement](https://docs.talkable.com/campaigns/campaign_placements/floating_widget.md#campaigns-campaign-placements-floating-widget)

#### Claim by Name Widget

Campaign will show up as a floating button in a corner of the screen on the cart or checkout page on your site,
for example:  
https://[your-site]/cart.  
Clicking on a Claim by Name widget opens a popup with an overlay and a close button.

[Learn more about Claim by Name Placement](https://docs.talkable.com/campaigns/campaign_placements/claim_by_name.md#campaigns-campaign-placements-claim-by-name)

#### Gleam

Campaign will show up on every page as a floating bar that shows your customers their coupon codes
after they have been rewarded within any other of your Talkable Campaigns.

[Learn more about Gleam Placement](https://docs.talkable.com/campaigns/campaign_placements/gleam.md#campaigns-campaign-placements-gleam)

### Loyalty placements

#### Loyalty Dashboard

Campaign will show up on the loyalty page on your site, for example:  
https://[your-site]/loyalty.  
Campaign will be rendered as an inline block in a corresponding Talkable DIV tag.

[Learn more about Loyalty Dashboard Placement](https://docs.talkable.com/campaigns/campaign_placements/loyalty_dashboard.md#campaigns-campaign-placements-loyalty-dashboard)

#### Loyalty Widget

Campaign will show up on every page as a floating widget that allows your customers to convert their points into coupons.

If a customer is not signed in, the widget prompts them to join the loyalty program.

[Learn more about Loyalty Widget Placement](https://docs.talkable.com/campaigns/campaign_placements/loyalty_widget.md#campaigns-campaign-placements-loyalty-widget)
> **Note:**
>
> When both Loyalty Dashboard and Loyalty Widget are matched on the same URL, only Dashboard will be shown.

### Campaigns Rotating

It is worth mentioning that you can also attach multiple Campaigns into one Placement.
In this case Talkable will always show only one Campaign based on a random rotation.
This mechanism is useful if you want to compare which Campaign has higher referral conversion rate by changing
Incentives or other referral pieces in the other Campaign.

* [Standalone Placement](https://docs.talkable.com/campaigns/campaign_placements/standalone.md)
  * [Flow](https://docs.talkable.com/campaigns/campaign_placements/standalone.md#flow)
  * [Integration instructions](https://docs.talkable.com/campaigns/campaign_placements/standalone.md#integration-instructions)
  * [Shopify Platform](https://docs.talkable.com/campaigns/campaign_placements/standalone.md#shopify-platform)
  * [Magento Platform](https://docs.talkable.com/campaigns/campaign_placements/standalone.md#magento-platform)
  * [Custom Platform](https://docs.talkable.com/campaigns/campaign_placements/standalone.md#custom-platform)
* [Post Purchase Placement](https://docs.talkable.com/campaigns/campaign_placements/post_purchase.md)
  * [Flow](https://docs.talkable.com/campaigns/campaign_placements/post_purchase.md#flow)
  * [Integration instructions](https://docs.talkable.com/campaigns/campaign_placements/post_purchase.md#integration-instructions)
  * [Shopify Platform](https://docs.talkable.com/campaigns/campaign_placements/post_purchase.md#shopify-platform)
  * [Magento Platform](https://docs.talkable.com/campaigns/campaign_placements/post_purchase.md#magento-platform)
  * [Custom Platform](https://docs.talkable.com/campaigns/campaign_placements/post_purchase.md#custom-platform)
* [Floating Widget Placement](https://docs.talkable.com/campaigns/campaign_placements/floating_widget.md)
  * [Integration instructions](https://docs.talkable.com/campaigns/campaign_placements/floating_widget.md#integration-instructions)
* [Gleam Placement](https://docs.talkable.com/campaigns/campaign_placements/gleam.md)
  * [Integration instructions](https://docs.talkable.com/campaigns/campaign_placements/gleam.md#integration-instructions)
* [Claim by Name Placement](https://docs.talkable.com/campaigns/campaign_placements/claim_by_name.md)
  * [Integration instructions](https://docs.talkable.com/campaigns/campaign_placements/claim_by_name.md#integration-instructions)
* [Loyalty Dashboard Placement](https://docs.talkable.com/campaigns/campaign_placements/loyalty_dashboard.md)
  * [Integration instructions](https://docs.talkable.com/campaigns/campaign_placements/loyalty_dashboard.md#integration-instructions)
* [Loyalty Widget Placement](https://docs.talkable.com/campaigns/campaign_placements/loyalty_widget.md)
  * [Integration instructions](https://docs.talkable.com/campaigns/campaign_placements/loyalty_widget.md#integration-instructions)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/campaign_placements/claim_by_name.md
===============================================================================

# Claim by Name Placement

Given a referral campaign with personal name sharing channel enabled, advocates can simply share their names
to engage friends in the referral program. The friends then should visit the page with a Claim by Name campaign
to see the widget that shows a call to action message, ex. “Have been referred by a friend?”.
Clicking on it expands the widget in a pop-up, allowing the visitor to enter their email and
their friend’s personal name to claim their reward.

[Learn more about Claim by Name campaigns](https://docs.talkable.com/campaigns/campaign_types.md#campaigns-claim-by-name)

[Learn more about Placements](https://docs.talkable.com/campaigns/campaign_placements.md#campaigns-campaign-placements)

## Integration instructions

Claim by Name Placement doesn’t require any additional integration since integration 5.1.0.
If you have already added Talkable to your main layout (completed General Integration
for Custom platform, or installed Shopify, Magento, or Salesforce Commerce Cloud extensions), then you are all done.  

Go ahead and create your Claim by Name campaign. Once it is launched your customers will see
the Campaign on the pages specified by the respective placement.  

After creating and launching the Claim by Name campaign, you can enable the personal name sharing channel
in any other referral campaign to allow advocates to share their name.

If you need to change or reconfigure which Campaigns are shown on which URLs then visit  
https://admin.talkable.com/sites/<YOUR-TALKABLE-SITE-ID>/placements page.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/campaign_placements/floating_widget.md
===============================================================================

# Floating Widget Placement

You can create Campaigns of different types (Invite, Dashboard, Leaderboard, etc) and show them as
the eye-catching Floating Widget in the corner of each page of your site. Widget shows a call to action message, ex.
“Get $10 for Sharing”, to all your visitors. Clicking on it expands the selected Campaign in a pop-up.

[Learn more about Placements](https://docs.talkable.com/campaigns/campaign_placements.md#campaigns-campaign-placements)

## Integration instructions

Floating Widget Placement doesn’t require any additional integration.
If you have already added Talkable to your main layout (completed General Integration
for Custom platform, or installed Shopify, Magento, or Salesforce Commerce Cloud extensions), then you are all done.  
**Note:** For Magento site just make sure the Floating Widget Popup is enabled in the Talkable extension settings in your Magento Admin Panel.  

Go ahead and create your Floating Widget Campaign. Once it is launched your customers will see
the Campaign on all pages of your site.  



If you need to change or reconfigure which Campaigns are shown on which URLs then visit  
https://admin.talkable.com/sites/<YOUR-TALKABLE-SITE-ID>/placements page.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/campaign_placements/gleam.md
===============================================================================

# Gleam Placement

Gleam Placement is a special Placement for Reward Gleam type of Campaign.
It’s shown as a tiny banner at the bottom of all your site pages by default.
Any of your customers who visit your site and already have a reward coupon will see their personal coupon codes in the Gleam.

[Learn more about Placements](https://docs.talkable.com/campaigns/campaign_placements.md#campaigns-campaign-placements)

## Integration instructions

Gleam Placement doesn’t require any additional integration.
If you have already added Talkable to your main layout (completed General Integration
for Custom platform, or installed Shopify, Magento, or Salesforce Commerce Cloud extensions), then you are all done.  
**Note:** For Magento site just make sure the Gleam is enabled in the Talkable extension settings in your Magento Admin Panel.  

Go ahead and create your Reward Gleam Campaign. Once it is launched your customers,
that have been rewarded in other Campaigns, will see their coupon codes in a Gleam on all pages of your site.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/campaign_placements/loyalty_dashboard.md
===============================================================================

# Loyalty Dashboard Placement

You can create Loyalty Campaigns and place them on a standalone page on your site. With the Loyalty Dashboard Placement your Campaign will show up on any particular page of your site following rules specified in the placement.
> **Note:**
>
> Customers need to be authenticated in order to view their Loyalty Dashboard. This means that email has to be present in the authenticate_customer call of the [Talkable Initialization Script](https://docs.talkable.com/integration/loyalty/integration_components.md#integration-loyalty-integration-components-initialization-script).

It is a good practice to use https://[your-site]/loyalty URL for this new page and add a link accessible from any page that makes sense considering your website configuration. Most common uses are links in the user accounts section, or from the user accounts menu.

[Learn more about Placements](https://docs.talkable.com/campaigns/campaign_placements.md#campaigns-campaign-placements)

## Integration instructions

Loyalty Dashboard Placement doesn’t require any additional integration since integration 5.0.0.
If you have already added Talkable to your main layout (completed General Integration
for Custom platform, or installed Shopify, Magento, or Salesforce Commerce Cloud extensions), then you are all done.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/campaign_placements/loyalty_widget.md
===============================================================================

# Loyalty Widget Placement

Once you have your Loyalty Campaigns set up, you can use this placement to show to your customers a widget that will allow them to convert their points into a coupon that can be used on a checkout page.
> **Note:**
>
> If a customer is not signed in (email was not provided to the authenticate_customer call), the widget prompts them to join the loyalty program and provide the email manually.

It is a good practice to show this widget when your customers are about to check out so that they are able to convert their points to a coupon and apply it to the purchase.

[Learn more about Placements](https://docs.talkable.com/campaigns/campaign_placements.md#campaigns-campaign-placements)

## Integration instructions

Loyalty Widget Placement doesn’t require any additional integration since integration 5.0.0.
If you have already added Talkable to your main layout (completed General Integration
for Custom platform, or installed Shopify, Magento, or Salesforce Commerce Cloud extensions), then you are all done.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/campaign_placements/post_purchase.md
===============================================================================

# Post Purchase Placement

You can create Campaigns of different types (Invite, Dashboard, Leaderboard, etc)
and show them to your customers on cart checkout. With the Post Purchase placement your Campaign will
show up automatically as a popup once the customer made a successful purchase on your site.

[Learn more about Placements](https://docs.talkable.com/campaigns/campaign_placements.md#campaigns-campaign-placements)

## Flow

[Image]

## Integration instructions

Instructions slightly vary based on your site platform.

## Shopify Platform

1. **Install Talkable extension.** If you haven’t done it before for other campaigns on your site,
then go to Integration Guide https://admin.talkable.com/sites/<YOUR-TALKABLE-SITE-ID>/integration and install
Shopify Talkable extension. Check the integration status with “Verify Integration” button.

2. **Configure Campaign and Placement.** Create a new Campaign with Post Purchase type of Placement,
configure it and launch. It will be automatically attached to the Post Purchase Placement and so,
show up to your customers every time they purchase successfully on your site.

  
  

## Magento Platform

1. **Install Talkable extension.** If you haven’t done it already, then go to Integration Guide https://admin.talkable.com/sites/<YOUR-TALKABLE-SITE-ID>/integration and follow instructions. Check the integration status with “Verify Integration” button.

2. **Enable in Talkable extension.** Talkable extension is integrated on your Magento site
Purchase Success page, so you don’t need to do anything in addition.
Make sure the Post Purchase type of Campaigns is enabled in the Talkable extension settings in your Magento Admin Panel.

3. **Configure Campaign and Placement.** Create a new Campaign with Post Purchase type of Placement,
configure it and launch. It will be automatically attached to the Post Purchase Placement and so,
show up to your customers every time they purchase successfully on your site.

  
  

## Custom Platform

1. **Add Talkable.** If you haven’t done it already, then go to Integration Guide https://admin.talkable.com/sites/<YOUR-TALKABLE-SITE-ID>/integration and add Talkable to your main site layout by following the instructions on **General Integration** tab.
Check the integration status with “Verify Integration” button.

2. **Add Post Purchase Script.** Go to https://admin.talkable.com/sites/<YOUR-TALKABLE-SITE-ID>/integration page, copy the
pregenerated Talkable script and add it to your order confirmation page.
At this point you need to pass all the order related properties such as order number, subtotal, coupon code, etc.

3. **Configure Campaign and Placement.** Create a new Campaign with Post Purchase type of Placement and launch it.
It will be automatically attached to its Post Purchase Placement that triggers a
Campaign on the order confirmation page.  
If you need to change or reconfigure which Campaigns are shown on which URLs then visit https://admin.talkable.com/sites/<YOUR-TALKABLE-SITE-ID>/placements page.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/campaign_placements/standalone.md
===============================================================================

# Standalone Placement

You can create Campaigns of different types (Invite, Dashboard, Leaderboard, etc) and place them on a standalone page
on your site.
With the Standalone placement your Campaign will show up on any particular page of your site.
An Advocate does not need to make a purchase to become eligible to share from such Campaigns.

Good practice is to use https://[your-site]/…/share URL for this new page and link it from the main site navigation.

[Learn more about Placements](https://docs.talkable.com/campaigns/campaign_placements.md#campaigns-campaign-placements)

## Flow

[Image]

## Integration instructions

Instructions slightly vary based on your site platform.

## Shopify Platform

1. **Install Talkable extension.** If you haven’t done it before for other campaigns on your site,
then go to Integration Guide https://admin.talkable.com/sites/<YOUR-TALKABLE-SITE-ID>/integration and install
Shopify Talkable extension. Check the integration status with “Verify Integration” button.

2. **Prepare Page.** Once installed Talkable extension creates a new page “[your-site] referral program”.
The address of this page is https://[your-site]/pages/share by default.
Make sure this page is accessible to your customers from the navigation menu of your site, you can configure that in the
Shopify site settings.  

The page template already has a required container<div id=”talkable-offer”></div> placed between Header and Footer of your page which makes your customers think this is a site feature built in-house.  

If you want to change the place where to show Standalone Talkable campaign on your site, you can do that by changing the
place of Talkable container on the page.  
Also you can create other pages based on page.talkable template and use them for other Standalone Campaigns.

3. **Configure Campaign and Placement.** Create a new Campaign with Standalone type of Placement,
configure it and launch. It will automatically attach to the placement with  
https://[your-site]/pages/share URL address and so, show up to your customers there.

  
  

## Magento Platform

1. **Install Talkable extension.** If you haven’t done it already, then go to Integration Guide https://admin.talkable.com/sites/<YOUR-TALKABLE-SITE-ID>/integration and follow instructions.
Check the integration status with “Verify Integration” button.

2. **Enable in Talkable extension.** By default Talkable extension creates two pages on your site https://[your-site]/share and on https://[your-site]/customer/dashboard that are suitable for Standalone Campaigns.
Make sure the Invite and Dashboard type of Campaigns are enabled in the Talkable extension settings on your
Magento Admin Panel.

3. **Configure Campaign and Placement.** Create a new Campaign with Standalone type of Placement,
configure it and launch. It will automatically attach to the placement with  
 https://[your-site]/share URL address
and so, show up to your customers there.  
For Advocate Dashboard type of Campaigns you could use a separate default
“Standalone Dashboard” Placement that matches https://[your-site]/customer/dashboard URL on your site.  
For this or another change you need to visit:  
https://admin.talkable.com/sites/<YOUR-TALKABLE-SITE-ID>/placements page and re-attach the Campaigns from one to another Placement.

  
  

## Custom Platform

1. **Add Talkable.** If you haven’t done it already, then go to Integration Guide https://admin.talkable.com/sites/<YOUR-TALKABLE-SITE-ID>/integration, copy the prepared
Talkable script and add to your site main layout. The script already has <YOUR-TALKABLE-SITE-ID>,
so it is ready to use. Check the integration status with “Verify Integration” button.

2. **Prepare Page.** Create a page or select the existing one on your site where the customers can access
the Campaign offers. Best practice is https://[your-site]/share URL address.
Then define where on this page the Standalone Campaign views should show up in order to look naturally,
usually it is somewhere in between the page Header and Footer, and add a script from your  
https://admin.talkable.com/sites/<YOUR-TALKABLE-SITE-ID>/integration  
page. Make sure this page is accessible to your customers from the navigation menu.

3. **Configure Campaign and Placement.** Create a new Campaign with Standalone type of Placement,
configure it and launch. It will automatically attach to the default Standalone Placement that has https://[your-site]/share URL address and so, show up to your customers there.  

If you need to change or reconfigure which Campaigns are shown on which URLs then
visit https://admin.talkable.com/sites/<YOUR-TALKABLE-SITE-ID>/placements page.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/campaign_types.md
===============================================================================

# Campaign Types

Encourage customers to share with their friends from anywhere on your site.

## Invite

Invite campaigns allow site visitors to share with their friends from anywhere
on your site. Invite campaigns are both powerful and versatile. Multiple Invite
campaigns can be run simultaneously for maximum results.

[Image]

## Advocate Dashboard

The Advocate Dashboard allows the Advocate to see a complete overview of their
shares and rewards. Seeing an overview of their activity makes Advocates more
motivated to share. Advocate Dashboards also reduce Customer Service inquiries
as customers can see statuses directly from the dashboard.

[Image]

## Reward Gleam

A Reward Gleam improves the on-site conversion rate by assisting Friends and
Advocates in using their coupons to purchase. When the Friend or Advocate
receives a reward and visits your website the coupon code is captured. The code
will be highlighted in the Reward Gleam at the bottom of the page.

[Image]

## Leaderboard

A Leaderboard turns referrals into a competition. Advocates are ranked on a
Leaderboard page based on the number of successful referrals. After an allotted
time period, top performers can be identified and rewarded with a grand prize.

[Image]

## Tiered Rewards

A Tiered Rewards campaign incentivizes Advocates to share with multiple friends
as they are rewarded for subsequent successful referrals. By setting reward
goals for Advocates, they are more likely to increase their share rate.

[Image]

## Claim by Name

A Claim by Name campaign is a part of the [name sharing setup](https://docs.talkable.com/advanced_features/name_sharing.md#advanced-features-name-sharing-setup) for referral campaigns.
The setup consists of the campaign(s) where the personal name sharing channel is enabled
(the Advocate campaign) and the Claim by Name campaign (the Friend campaign).
The Advocate can share their name and describe the referral offer via any channel they prefer,
and the Friend can then claim the reward by entering the Advocate’s personal name in the Claim by Name popup.
> **Note:**
>
> Claim by Name campaign does not offer any incentives on its own. Both the Advocate and the Friend rewards
> should be specified in the name sharing campaign (i.e. the campaign with personal name sharing channel enabled).
> Similarly, the funnel metrics are also tracked within the Advocate campaign.

[Image]

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/designer.md
===============================================================================

# Designer

## Web view size

Canvas size should be equal to a main container width of your site:

[Image]

For mobile screens most common width is 320px, but we also support fluid
width with possibility to set it to 100% to support mobile devices and
tablets. Since Talkable integration is based on `iframe` it is not
possible to change its size from within of the iframe that’s why Signup
and Share pages should always be of the same size.

For Post-purchase campaign Advocate Signup/Share Page should look like a modal window
cause it integrates right to the checkout page after user makes a
purchase (most common size is 800x500px):

[Image]

> **Note:**
>
> Overlay cannot be customized.

Friend Claim Page size does not matter cause it hosts on Talkable site
entirely. Commonly this view looks like a modal window with customer
site loaded on the back:

[Image]

Most common modal size is 800x500px.

## Email size

Ideally email width is 480px for content:

[Image]

## Fonts

Using custom fonts as text allowed only for web views, **not emails**.
This is email clients restriction. If its needed, we can convert custom
font to images but it will not be editable through campaign editor and
each copy change will require more time. Here is a list of OS default
fonts [http://www.ampsoft.net/webdesign-l/WindowsMacFonts.html](http://www.ampsoft.net/webdesign-l/WindowsMacFonts.html)

Also, for emails copy should be placed always on top of solid background
color, not image:

[Image]

There are many options for embedding custom fonts, here are most popular
and solid ones:

1. Purchase web-compatible font on [https://www.myfonts.com](https://www.myfonts.com)

[Image]

2. Purchase on [https://fonts.adobe.com](https://fonts.adobe.com)

3. Choose free Google Font [https://fonts.google.com](https://fonts.google.com)

## Responsive view’s height

Talkable campaigns can be integrated as a popup with overlay, or as an inline
block that sits somewhere in the middle between site header and footer. When
Talkable Campaign looks like a popup with overlay its size if always fixed to 100%
width and 100% height, it basically takes the entire screen and its size never gets
changed when a user resizes browser window (overlay will still take the entire screen size).

However, when Talkable Campaign is placed inline inside content area its size
depends on its internal content. The more content it holds the more higher it is.
Iframe has a known issue due to which browsers don’t change its height no matter how
much content it holds inside. By default all browsers set 150px height to all iframe
tags and add scrollbars if the internal content exceeds that size. Talkable Campaigns
are always of the correct size because of “Responsive iframe height” feature always
being enabled for such cases. No matter how much content Talkable iframe holds its
size will always be correct in order to look as expected without scrollbars. For this
reason, you might notice Talkable adds `overflow: hidden;` to the BODY tag — this CSS
property hides the scrollbars. At the same time, Talkable JS integration library always
ensures its height is correct by checking the size of the iframe content and setting it
in pixels to the Talkable iframe tag that holds it from the outside.

You are able to turn “Responsive iframe’s height” ON/OFF from within `Campaign / Editor / Edit HTML & CSS / Extra / Responsive iframe’s height` select box.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/editor.md
===============================================================================

# Editor

Talkable Campaign Editor is a powerful IDE for Campaign development. It allows
developers:

1. Write [Liquid](https://github.com/Shopify/liquid) markup for templates

2. Write [SCSS](https://sass-lang.com) for styles

3. Upload static assets through [File Uploader](https://docs.talkable.com/campaigns/editor/files.md#campaigns-editor-files)

4. Track/rollback code changes through [History](https://docs.talkable.com/campaigns/editor/history.md#campaigns-editor-history)

5. Use [Interpolation Variables](https://docs.talkable.com/campaigns/editor/variables.md#campaigns-editor-variables) to automate
things

6. Use powerful [Liquid Filters](https://docs.talkable.com/campaigns/editor/filters.md#campaigns-editor-filters) for mighty
templating

7. [Watch](https://docs.talkable.com/campaigns/editor/videos.md#campaigns-editor-videos) our video guides




[Image]

* [Variables](https://docs.talkable.com/campaigns/editor/variables.md)
  * [{{ advocate_info }}](https://docs.talkable.com/campaigns/editor/variables.md#advocate-info)
  * [{{ advocate_origin }}](https://docs.talkable.com/campaigns/editor/variables.md#advocate-origin)
  * [{{ coupon }}](https://docs.talkable.com/campaigns/editor/variables.md#coupon)
  * [{{ incentives }}](https://docs.talkable.com/campaigns/editor/variables.md#incentives)
* [Files](https://docs.talkable.com/campaigns/editor/files.md)
* [History](https://docs.talkable.com/campaigns/editor/history.md)
* [Filters](https://docs.talkable.com/campaigns/editor/filters.md)
  * [ab_test](https://docs.talkable.com/campaigns/editor/filters.md#ab-test)
  * [add_time](https://docs.talkable.com/campaigns/editor/filters.md#add-time)
  * [adjust_color](https://docs.talkable.com/campaigns/editor/filters.md#adjust-color)
  * [append_to_array](https://docs.talkable.com/campaigns/editor/filters.md#append-to-array)
  * [asset_url](https://docs.talkable.com/campaigns/editor/filters.md#asset-url)
  * [assign_key](https://docs.talkable.com/campaigns/editor/filters.md#assign-key)
  * [async_rendering](https://docs.talkable.com/campaigns/editor/filters.md#async-rendering)
    * [Example 1](https://docs.talkable.com/campaigns/editor/filters.md#example-1)
    * [Example 2](https://docs.talkable.com/campaigns/editor/filters.md#example-2)
    * [Example 3](https://docs.talkable.com/campaigns/editor/filters.md#example-3)
    * [Example 4](https://docs.talkable.com/campaigns/editor/filters.md#example-4)
  * [attachment_cid](https://docs.talkable.com/campaigns/editor/filters.md#attachment-cid)
  * [barcode](https://docs.talkable.com/campaigns/editor/filters.md#barcode)
  * [barcode_image](https://docs.talkable.com/campaigns/editor/filters.md#barcode-image)
  * [base64_decode](https://docs.talkable.com/campaigns/editor/filters.md#base64-decode)
  * [base64_encode](https://docs.talkable.com/campaigns/editor/filters.md#base64-encode)
  * [claim_url](https://docs.talkable.com/campaigns/editor/filters.md#claim-url)
  * [class_names](https://docs.talkable.com/campaigns/editor/filters.md#class-names)
  * [color_to_hex](https://docs.talkable.com/campaigns/editor/filters.md#color-to-hex)
  * [color_to_rgb](https://docs.talkable.com/campaigns/editor/filters.md#color-to-rgb)
  * [date_diff](https://docs.talkable.com/campaigns/editor/filters.md#date-diff)
  * [date_greater_than](https://docs.talkable.com/campaigns/editor/filters.md#date-greater-than)
  * [date_greater_than_or_equal](https://docs.talkable.com/campaigns/editor/filters.md#date-greater-than-or-equal)
  * [encode_query_argument](https://docs.talkable.com/campaigns/editor/filters.md#encode-query-argument)
  * [events_collection](https://docs.talkable.com/campaigns/editor/filters.md#events-collection)
  * [format_date](https://docs.talkable.com/campaigns/editor/filters.md#format-date)
  * [group_by](https://docs.talkable.com/campaigns/editor/filters.md#group-by)
  * [hmac_sha256](https://docs.talkable.com/campaigns/editor/filters.md#hmac-sha256)
  * [hours_from_time](https://docs.talkable.com/campaigns/editor/filters.md#hours-from-time)
  * [human_time_ago](https://docs.talkable.com/campaigns/editor/filters.md#human-time-ago)
  * [import_font](https://docs.talkable.com/campaigns/editor/filters.md#import-font)
  * [is_color_dark](https://docs.talkable.com/campaigns/editor/filters.md#is-color-dark)
  * [is_color_light](https://docs.talkable.com/campaigns/editor/filters.md#is-color-light)
  * [interpolate](https://docs.talkable.com/campaigns/editor/filters.md#interpolate)
  * [leaderboard](https://docs.talkable.com/campaigns/editor/filters.md#leaderboard)
  * [localize](https://docs.talkable.com/campaigns/editor/filters.md#localize)
  * [md5](https://docs.talkable.com/campaigns/editor/filters.md#md5)
  * [money](https://docs.talkable.com/campaigns/editor/filters.md#money)
  * [new_array](https://docs.talkable.com/campaigns/editor/filters.md#new-array)
  * [new_hash](https://docs.talkable.com/campaigns/editor/filters.md#new-hash)
  * [parse_json](https://docs.talkable.com/campaigns/editor/filters.md#parse-json)
  * [pluralize](https://docs.talkable.com/campaigns/editor/filters.md#pluralize)
  * [points](https://docs.talkable.com/campaigns/editor/filters.md#points)
  * [prepend_to_array](https://docs.talkable.com/campaigns/editor/filters.md#prepend-to-array)
  * [probability_by](https://docs.talkable.com/campaigns/editor/filters.md#probability-by)
  * [qr_code](https://docs.talkable.com/campaigns/editor/filters.md#qr-code)
  * [rand_by](https://docs.talkable.com/campaigns/editor/filters.md#rand-by)
  * [regexp_captures](https://docs.talkable.com/campaigns/editor/filters.md#regexp-captures)
  * [rybbon](https://docs.talkable.com/campaigns/editor/filters.md#rybbon)
  * [save_wallet](https://docs.talkable.com/campaigns/editor/filters.md#save-wallet)
  * [scale_color](https://docs.talkable.com/campaigns/editor/filters.md#scale-color)
  * [simple_format](https://docs.talkable.com/campaigns/editor/filters.md#simple-format)
  * [sort](https://docs.talkable.com/campaigns/editor/filters.md#sort)
  * [squish](https://docs.talkable.com/campaigns/editor/filters.md#squish)
  * [strip](https://docs.talkable.com/campaigns/editor/filters.md#strip)
  * [tango](https://docs.talkable.com/campaigns/editor/filters.md#tango)
  * [track_link_click](https://docs.talkable.com/campaigns/editor/filters.md#track-link-click)
  * [tremendous](https://docs.talkable.com/campaigns/editor/filters.md#tremendous)
  * [tweet_length](https://docs.talkable.com/campaigns/editor/filters.md#tweet-length)
  * [update_query](https://docs.talkable.com/campaigns/editor/filters.md#update-query)
  * [url2png](https://docs.talkable.com/campaigns/editor/filters.md#url2png)
  * [values](https://docs.talkable.com/campaigns/editor/filters.md#values)
  * [where](https://docs.talkable.com/campaigns/editor/filters.md#where)
* [Videos](https://docs.talkable.com/campaigns/editor/videos.md)
  * [Liquid Tutorial 1: Intro & Navigation](https://docs.talkable.com/campaigns/editor/videos.md#liquid-tutorial-1-intro-navigation)
  * [Liquid Tutorial 2: Using Variables and Filters](https://docs.talkable.com/campaigns/editor/videos.md#liquid-tutorial-2-using-variables-and-filters)
  * [Liquid Tutorial 3: Using Custom Assets](https://docs.talkable.com/campaigns/editor/videos.md#liquid-tutorial-3-using-custom-assets)
* [Partials](https://docs.talkable.com/campaigns/editor/partials.md)
  * [Adding a Partial](https://docs.talkable.com/campaigns/editor/partials.md#adding-a-partial)
  * [Default Partials](https://docs.talkable.com/campaigns/editor/partials.md#default-partials)
  * [Including a Partial in a Main Template](https://docs.talkable.com/campaigns/editor/partials.md#including-a-partial-in-a-main-template)
  * [Example](https://docs.talkable.com/campaigns/editor/partials.md#example)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/editor/files.md
===============================================================================

# Files

Used for uploading static assets like images, fonts, etc for campaign purposes.




1. To upload a file open `Files`:

[Image]  


2. Hit `Choose Files` button or drag a file(s) to it:

[Image]  


3. Hit `Upload` button:

[Image]  


4. Uploaded files take place below Upload Bar:

[Image]  


5. Copy Liquid Output Markup by clicking on the file:

[Image]  


6. Now paste Output Markup where needed:

[Image]  


7. To preview the file click here:

[Image]  


8. To delete the file click here:

[Image]

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/editor/filters.md
===============================================================================

# Filters

[Standard liquid filters](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers#standard-filters) are available out of box.

## ab_test

A/B testing static text:

```liquid
{{ "ab_test_identifier" | ab_test: "Label 1", "Label 2", "Label N" }}
```
A/B testing text with interpolation:

```liquid
{{ "share_via_email_subject" | ab_test: "[[site_name]]",
   "Your friend [[advocate_info.email]] shared this deal with you" | interpolate }}
```
A/B testing an asset:

```liquid
{{ "offer_background" | ab_test: "background-green.jpg", "background-red.jpg" | asset_url }}
```
A/B testing style:

```liquid
<body style="background-color: {{ 'offer_background' | ab_test: '#d3d3d3', '#ff0000' }}">
  ...
</body>
```

```liquid
<h1 style="font-size: {{ 'title_size' | ab_test: '24px', '30px' }}">
  Sample Title
</h1>
```

---




## add_time

Add a specified amount of time to a date and return the result.

Time unit defaults to seconds.

Available time units (can be used in plural form as well):

* `second`

* `minute`

* `hour`

* `day`

* `week`

* `fortnight`

* `month`

* `year`

```liquid
{{ valid_until | add_time: 42 }}
{{ valid_until | add_time: 3, 'months' }}
```

---




## adjust_color

Returns a new adjusted color based on the following attributes:

* red — changes only the Red color channel saturation. Allowed values: -255-255.

* green — changes only the Green color channel saturation. Allowed values: -255-255.

* blue — changes only the Blue color channel saturation. Allowed values: -255-255.

* hue — changes the hue of a color. Allowed values: 0-360.

* saturation — changes the saturation of a color. Allowed values: -100-100.

* lightness — changes the lightness of a color. Allowed values: -100-100.

* alpha — changes the opacity of a color. Allowed values: -1-1.

```liquid
{{ "red" | adjust_color: blue: 255 }}
{{ "#000000" | adjust_color: alpha: -0.5 }}
```

---




## append_to_array

Appends elements to an existing array.

Liquid

```liquid
{% assign my_array = "" | new_array %}
{% assign my_array = my_array | append_to_array: "element1", "element2" %}

Array: {{ my_array | json }}
```
Rendered Liquid

```text
Array: ["element1","element2"]
```

---




## asset_url

Inserts link for an uploaded asset.

```liquid
{{ "image.jpg" | asset_url }}
```
Example: [http://d2jjzw81hqbuqv.cloudfront.net/static_assets/files/745/original/offer-background.jpg](http://d2jjzw81hqbuqv.cloudfront.net/static_assets/files/745/original/offer-background.jpg)

---




## assign_key

Assigns a key-value pair to an existing hash. If the key already exists, its value is updated.

Liquid

```liquid
{% assign my_hash = "" | new_hash: key: "value", key2: 42 %}
{% assign my_hash = my_hash | assign_key: "key2", "value2" %}
{% assign my_hash = my_hash | assign_key: "key3", "value3" %}

Hash: {{ my_hash | json }}
```
Rendered Liquid

```text
Hash: {"key":"value","key2":"value2","key3":"value3"}
```

---




## async_rendering

Stores Liquid partial that can be later rendered via `Talkable.loadLiquid` function.

### Example 1

Liquid

```liquid
{{ "async_advocate_info" | async_rendering: 'template for rendering with data [[ advocate_info.email ]]' }}
```
JavaScript API call

```javascript
Talkable.loadLiquid("async_advocate_info", function(rendered_template) {
  console.log(rendered_template);
});
```
Rendered Liquid

```text
"template for rendering with data advocate@example.com"
```

### Example 2

Liquid

```liquid
{{ 'async_dashboard_data' | async_rendering: some_key: "[[ dashboard.possible_rewards | money: strip_insignificant_zeros: true ]]", other_key: "[[ friend_info.purchases_count ]]" }}
```
JavaScript API call

```javascript
Talkable.loadLiquid("async_dashboard_data", function(rendered_data) {
  console.log(rendered_data.some_key);
});
```
Rendered Liquid

```text
"$420"
```

### Example 3

Liquid

```liquid
{% capture some_liquid_block %}
{% raw %}
Whatever Liquid you would like to have
{% endraw %}
{% endcapture %}
{{ 'async_liquid_reference' | async_rendering: some_liquid_block }}
```
JavaScript API call

```javascript
Talkable.loadLiquid("async_liquid_reference", function(rendered_template) {
  console.log(rendered_template);
});
```
Rendered Liquid

```text
"Whatever Liquid you would like to have"
```

### Example 4

Use `json` Liquid filter to transform deeply nested object structure into a valid JSON.

Liquid

```liquid
{{ 'async_advocate_info' | async_rendering: '[[ advocate_info | json ]]' }}
```
JavaScript API call

```javascript
Talkable.loadLiquid("async_advocate_info", function(rendered_template) {
  console.log(JSON.parse(rendered_template));
});
```
Rendered Liquid

```javascript
{
  "first_name": null,
  "last_name": null,
  "email": "advocate@example.com",
  "username": null,
  "external_customer_id": null,
  "opted_in_at": null,
  "sub_choice": false,
  "purchases_sum": 0.0,
  "purchases_count": 0,
  "events_count": 0,
  "events_count_by_category": {
    "friend_signup": 0,
    "purchase": 0
  },
  "referrals_count": 0,
  "referred_by": null,
  "custom_properties": {},
  "unsubscribed": false
}
```

---




## attachment_cid

Returns a content ID (CID) of an attached file that can be used to embed files in emails.

```liquid
{% assign qr_code = 'X' | qr_code: format: 'png' %}
<img src="{{ qr_code | attachment_cid: name: 'qr_code.png', mime_type: 'image/png' }}" />
```

---




## barcode

Represents any `string` as an array of boolean values: `[true, false]` in order to convert it into a barcode.
This filter strictly follows GS1-128 specification: [https://en.wikipedia.org/wiki/GS1-128](https://en.wikipedia.org/wiki/GS1-128).

```liquid
{% assign barcode = "X" | barcode %}
```
**Here is an example how to convert a coupon code into a barcode:**

HTML:

```liquid
<table cellspacing="0" cellpadding="0" border="0">
  {% assign barcode = coupon_code | barcode %}
    <tr>
      {% for bar in barcode %}
        <!-- bar suppose to be true or false -->
        <td class="barcode-line is-{{ bar }}"></td>
      {% endfor %}
    </tr>
</table>
```
SCSS:

```scss
.barcode-line {
  height: 50px;
  width: 2px;
  &.is-true {
    background-color: black;
  }
}
```

---




## barcode_image

Represents any `string` as barcode image in png.
This filter strictly follows GS1-128 specification: [https://en.wikipedia.org/wiki/GS1-128](https://en.wikipedia.org/wiki/GS1-128).

It may take the following arguments: `height`, `xdim` (thickness of the thinnest line), `margin` and `bg_transparent`.

Default values are `100` for `height`, `1` for `xdim`, `0` for `margin` and `false` for `bg_transparent`.

The values are in pixels.

```liquid
{{ coupon.code | barcode_image }}
{{ coupon.code | barcode_image: height: 200 }}
{{ coupon.code | barcode_image: xdim: 3 }}
{{ coupon.code | barcode_image: height: 200, xdim: 3 }}
{{ coupon.code | barcode_image: height: 200, xdim: 3, margin: 5 }}
{{ coupon.code | barcode_image: height: 200, xdim: 3, margin: 5, bg_transparent: true }}
```
Returns a URL string.

---




## base64_decode

Decodes given base64 encoded string.

```liquid
{{ "c29tZSBzdHJpbmc=" | base64_decode }}
```
Returns `some string`

---




## base64_encode

Converts given string into a base64 encoded string.

```text
{{ "some string" | base64_encode }}
```
Returns `c29tZSBzdHJpbmc=`

---




## claim_url

Returns channel-specific claim URL.

```liquid
{{ "facebook" | claim_url }}
{{ "linkedin" | claim_url }}
{{ "twitter" | claim_url }}
```

---




## class_names

Helps conditionally add CSS classes.
Returns string of class names built from arguments.

| Example                                                  | Result      |
| -------------------------------------------------------- | ----------- |
| `{{ 42 | class_names: "song" }}`                         | `42 song`   |
| `{{ "song" | class_names: play: true }}`                 | `song play` |
| `{{ "" | class_names: song: true, play: false }}`        | `song`      |
| `{{ "" | class_names: "song", "play" }}`                 | `song play` |
| `{{ "" | class_names: "song", nil, false, play: true }}` | `song play` |
| `{{ "" | class_names: "song", play: true }}`             | `song play` |
| `{{ "" | class_names: "song", play: false }}`            | `song`      |

---




## color_to_hex

Converts color string to hexadecimal format.
If a color with an alpha channel is provided, then the alpha channel is excluded from the output.

| Example                                         | Result    |
| ----------------------------------------------- | --------- |
| `{{ "red" | color_to_hex }}`                    | `#ff0000` |
| `{{ "#fefefe" | color_to_hex }}`                | `#fefefe` |
| `{{ "rgb(255, 0, 255)" | color_to_hex }}`       | `#ff00ff` |
| `{{ "rgba(255, 0, 255, 0.1)" | color_to_hex }}` | `#ff00ff` |

---




## color_to_rgb

Converts color string to RGB format.
If a color with an alpha channel is provided, then the alpha channel is excluded from the output.

| Example                                         | Result               |
| ----------------------------------------------- | -------------------- |
| `{{ "red" | color_to_rgb }}`                    | `rgb(255, 0, 0)`     |
| `{{ "#fefefe" | color_to_rgb }}`                | `rgb(254, 254, 254)` |
| `{{ "rgb(255, 0, 255)" | color_to_rgb }}`       | `rgb(255, 0, 255)`   |
| `{{ "rgba(255, 0, 255, 0.1)" | color_to_rgb }}` | `rgb(255, 0, 255)`   |

---




## date_diff

Return absolute difference between two dates in seconds.

Date is compared to current time if no argument is passed.

All dates are interpreted in context of the site time zone
unless time zone is specified.

```text
{{ valid_until | date_diff }}
{{ valid_until | date_diff: 'Apr 4, 2019' }}
{{ '2019-09-01 08:30:00' | date_diff: current_time }}
```

---




## date_greater_than

Return boolean that indicates whether a date is more recent
than another date.

All dates are interpreted in context of the site time zone
unless time zone is specified.

```liquid
{{ current_time | date_greater_than: valid_until }}
{{ valid_until | date_greater_than: '2019-09-01 08:30:00' }}
```

---




## date_greater_than_or_equal

Return boolean that indicates whether a date is the same as
or more recent than another date.

All dates are interpreted in context of the site time zone
unless time zone is specified.

```liquid
{{ current_time | date_greater_than_or_equal: valid_until }}
{{ valid_until | date_greater_than_or_equal: '2019-09-01 08:30:00' }}
```

---




## encode_query_argument

Encodes a string to be included in a URL.

```text
http://example.com/?utm_campaign={{ "Campaign Name" | encode_query_argument }}
```
Returns `Campaign%20Name`, so the URL will be `http://example.com/?utm_campaign=Campaign%20Name`.

---




## events_collection

Collection of person’s events from the certain date (or for all time when `from_time` is not set).

```liquid
{{ "purchase" | events_collection: from_time: "10/14/2018" }}
```
Returns

```javascript
[
  {
    "coupon_codes": ["OFF5"],
    "created_at": "2019-05-22T15:53:41-07:00",
    "email": "ad@site.com",
    "order_number": 98237519,
    "refunded": false,
    "subtotal": 100.0
  },
  {
    "coupon_codes": ["OFF5"],
    "created_at": "2019-05-22T15:53:41-07:00",
    "email": "ad@site.com",
    "order_number": 98237520,
    "refunded": true,
    "subtotal": 200.0
  }
]
```

---




## format_date

Format date for current localization.

Default format: Apr 04, 2014

Reference to all available formatting can be found in [strftime documentation](https://apidock.com/ruby/DateTime/strftime)

Reference to all available locales can be found in [rails-i18n documentation](https://github.com/svenfuchs/rails-i18n#available-locales)

```liquid
{{ valid_until | format_date }}
{{ valid_until | format_date: format: "%Y-%m-%d" }}
{{ valid_until | format_date: locale: "en" }}
{{ valid_until | format_date: format: "%Y-%m-%d", locale: "en" }}
{{ current_time | format_date }}
```

---




## group_by

Group an array’s items by a given property.

```liquid
{{ incentives | group_by: "amount" }}
```

---




## hmac_sha256

Generate an HMAC authentication code as a hex-encoded string using SHA256 algorithm.

By default, the site’s API key is used as secret, unless specified otherwise.

```text
{{ "a string" | hmac_sha256 }}
{{ "a string" | hmac_sha256: "a different secret" }}
```

---




## hours_from_time

Alias hours_from_now

Calculate difference between two dates. By default calculates between specified time and current time.

```text
{{ "Sun, 02 Jan 2000 10:00:00 PST" | hours_from_time: "Sat, 01 Jan 2000 10:00:00 PST" }}
{{ "2015-03-27 17:53" | hours_from_time: "2015-03-27 15:53" }}
```
Next two examples is equivalent.

```liquid
{{ friend_offer.valid_until | hours_from_time: current_time }}
{{ friend_offer.valid_until | hours_from_now }}
```
Pretty useful example for email sending criteria to prevent sending mail when offer is about to expire.

```liquid
{% if friend_offer.valid_until %}
  {% assign difference = friend_offer.valid_until | hours_from_now %}
  {% if difference > 24 %}
    true
  {% else %}
    false
  {% endif %}
{% else %}
  true
{% endif %}
```

---




## human_time_ago

Transform given time to time ago in words.

If given time is yesterday, returns `1 day`.

Reference to all available locales can be found in [rails-i18n documentation](https://github.com/svenfuchs/rails-i18n#available-locales)

```liquid
{{ valid_until | human_time_ago }}
{{ valid_until | human_time_ago: locale: "en" }}
{{ current_time | human_time_ago }}
```

---




## import_font

Inserts the font declaration to the page.

```text
{{ "My Font" | import_font }}
```
Returns:

```css
@font-face {
   font-family: 'My Font';
   src: url('https://d2jjzw81hqbuqv.cloudfront.net/static_assets/files/174201/original/font.woff') format('woff'), url('https://d2jjzw81hqbuqv.cloudfront.net/static_assets/files/174202/original/font.woff2') format('woff2');
   font-weight: normal;
   font-style: normal;
}
```

---




## is_color_dark

Determines if a color is visually dark based on its luminance

| Example                         | Result  |
| ------------------------------- | ------- |
| `{{ "pink" | is_color_dark }}`  | `false` |
| `{{ "red" | is_color_dark }}`   | `true`  |
| `{{ "white" | is_color_dark }}` | `false` |
| `{{ "black" | is_color_dark }}` | `true`  |

---




## is_color_light

Determines if a color is visually light based on its luminance

| Example                          | Result  |
| -------------------------------- | ------- |
| `{{ "pink" | is_color_light }}`  | `true`  |
| `{{ "red" | is_color_light }}`   | `false` |
| `{{ "white" | is_color_light }}` | `true`  |
| `{{ "black" | is_color_light }}` | `false` |

---




## interpolate

Allows inline string interpolation using [[ ]] syntax.

```text
{{ "Get [[incentives.click.amount | money]] Off" | interpolate }}
```

---




## leaderboard

Returns array of top advocates for Leaderboard campaigns.
Parameter can be number from 1 to 100 or ‘advocate’.

If parameter is ‘advocate’ it will return rank info for current advocate.

It returns objects with next fields:

* `leaderboard_rank` - Advocate rank

* `leaderboard_count` - Number of approved referrals for specified period

* `leaderboard_subtotal` - Sum of advocate purchase subtotals for specified period

* also all fields from [advocate_info](https://docs.talkable.com/campaigns/editor/variables.md#editor-variables-advocate-info) variable

```liquid
{% assign leaders = "3" | leaderboard %}
{% for leader in leaders %}
   <td>{{ leader.leaderboard_rank }}</td>
   <td>{{ leader.leaderboard_count }}</td>
{% endfor %}
```

```liquid
{% assign leader = "advocate" | leaderboard %}
{{ leader.email }} - {{ leader.leaderboard_count }} - {{ leader.leaderboard_rank }}
```

---




## localize

Returns a localized version of string from campaign localization.
Has optional argument that specifies a default value if campaign has no defined localization yet.
Supports nested interpolation with [[ ]]

```liquid
{{ "welcome_message" | localize }}
{{ "offer_title" | localize: "Get [[incentives.referrer.description]]" }}
```
Supports fixed variants for localization, user will be able to set localization value only from this list.
First value will be a default value, or you can set it using `default` option.

```liquid
{{ "campaign_layout" | localize: "left", "right" }}
{{ "header_size" | localize: "h1", "h2", "h3", "h4", default: "h2" }}
```
There is also boolean localization type. It has a strict requirement: exactly two variants which
determines boolean logics. The first variant is associated with `true`, the last one — `false`.
The first variant is set as default unless you change it to otherwise with a `default` option (see above for an example). Here is an example of how to use boolean localization:

```liquid
{% assign responsive_font = 'fonts_size' | localize: 'Responsive', 'Fixed', trait: 'boolean' %}
{% if responsive_font %}
  Responsive
{% else %}
  Fixed
{% endif %}
```
For more information see [Localization](https://docs.talkable.com/campaigns/localization.md#campaigns-localization) page.

---




## md5

Calculates the MD5 hash of the string.

```liquid
{{ "foo" | md5 }}
```
Returns `acbd18db4cc2f85cedef654fccc4a4d8`.

---




## money

Formats number using current currency.

```liquid
{{ "50" | money }}
```
Returns `$50.00`.

Available options:

* `unit`

* `separator`

* `delimiter`

* `format`

* `precision (integer)`

* `strip_insignificant_zeros (boolean)`

| Example                                                   | Result       |
| --------------------------------------------------------- | ------------ |
| `{{ "100.11" | money: precision: 0 }}`                    | `$100`       |
| `{{ "100.99" | money: precision: 0 }}`                    | `$101`       |
| `{{ "100.99" | money: strip_insignificant_zeros: true }}` | `$100.99`    |
| `{{ "100.90" | money: strip_insignificant_zeros: true }}` | `$100.9`     |
| `{{ "100.00" | money: strip_insignificant_zeros: true }}` | `$100`       |
| `{{ "100" | money: unit: "€" }}`                          | `€100.00`    |
| `{{ "100" | money: unit: "" }}`                           | `100.00`     |
| `{{ "10049.99" | money: separator: "_" }}`                | `$10,049_99` |
| `{{ "10049.99" | money: delimiter: "_" }}`                | `$10_049.99` |
| `{{ "100" | money: format: "%n %u", unit: "zł" }}`        | `100.00 zł`  |

---




## new_array

Creates a new array. If arguments are provided, they become the elements of the array.

Liquid

```liquid
{% assign my_array = "" | new_array: "element1", "element2" %}
{% assign empty_array = "" | new_array %}

Array: {{ my_array | json }}
Empty array: {{ empty_array | json }}
```
Rendered Liquid

```text
Array: ["element1","element2"]
Empty array: []
```

---




## new_hash

Creates a new hash. If a hash is provided as an argument, it returns that hash.

Liquid

```liquid
{% assign my_hash = "" | new_hash: key: "value", key2: 42 %}
{% assign empty_hash = "" | new_hash %}

Hash: {{ my_hash | json }}
Empty hash: {{ empty_hash | json }}
```
Rendered Liquid

```text
Hash: {"key":"value","key2":42}
Empty hash: {}
```

---




## parse_json

Parses the JSON string source into a Liquid data structure.

```liquid
{% assign var = '{"key": "value"}' | parse_json %}
{{ var.key }}
```
Returns `value`.

---




## pluralize

Returns the singular or plural form of a word based on the value of a number.
Accepts singular (required) and plural (optional) forms.

| Example                                      | Result       |
| -------------------------------------------- | ------------ |
| `{{ 5 | pluralize: "point" }}`               | `5 points`   |
| `{{ 2 | pluralize: "sheep" }}`               | `2 sheep`    |
| `{{ 1 | pluralize: "day off" }}`             | `1 day off`  |
| `{{ 5 | pluralize: "day off" }}`             | `5 day offs` |
| `{{ 0 | pluralize: "day off", "days off" }}` | `0 days off` |

As shown in the table, simple words can be pluralized without specifying plural form.
However, more advanced cases require explicit plural form to work correctly.

---




## points

Formats number using conversion rate for loyalty from site settings.

```liquid
{{ "50" | points }}
```
Returns `500`.

Available options:

* `delimiter`

* `format`

* `percentage_discount (boolean)`

* `convert (boolean)` - It will work like money filter if value false

| Example                                                 | Result      |
| ------------------------------------------------------- | ----------- |
| `{{ "10050" | points: delimiter: "_" }}`                | `100_500`   |
| `{{ "100" | points: format: "%nP" }}`                   | `1000P`     |
| `{{ "100" | points: convert: false }}`                  | `$100.00`   |
| `{{ "1000" | points: convert: false, delimiter: "," }}` | `$1,000.00` |
| `{{ "100" | points: convert: false, unit: "€" }}`       | `€100.00`   |
| `{{ "100" | points: percentage_discount: true }}`       | `500`       |

---




## prepend_to_array

Prepends elements to an existing array.

Liquid

```liquid
{% assign my_array = "" | new_array: "element1", "element2" %}
{% assign my_array = my_array | prepend_to_array: "element3" %}

Array: {{ my_array | json }}
```
Rendered Liquid

```text
Array: ["element3","element1","element2"]
```

---




## probability_by

This filter returns `true` or `false` for a dataset based on the probability you request:

```liquid
{{ 50 | probability_by: "param1", "param2", "param3" }}
```
`50` returns `true` in 50% cases for requested dataset. This filter provides the same result for a particular
dataset.
> **Note:**
>
> probability should be always an integer value between `1` and `100`.

Here is another example that returns `true` only in 10% cases for the interpolation variable:

```liquid
{{ 10 | probability_by: advocate_info.email }}
```
You can ommit passing any parameters and the result will be based on the Advocate offer. Also you may use `probability` as an alias which is a little shorter to write:

```liquid
{{ 50 | probability }}
```
This example can be used in `Email sending condition` of Advocate Offer Email template to send email only in 33% cases:

```liquid
{% assign send_email = 33 | probability %}

{% if send_email %}
  true
{% endif %}
```

---




## qr_code

Converts a string into a QR code. By default, produces an image in SVG format. If `png` format is specified,
returns file content for a PNG image that can be attached to an email (see [attachment_cid](#liquid-filter-attachment-cid)).

```liquid
{{ "https://talkable.com" | qr_code }}
{{ coupon.code | qr_code }}
{{ "Scanme" | qr_code: xdim: 8 }}
```
It may take the following arguments:

* `xdim` - the width of the cell in a QR code. Default value is `4`.

* `format` - custom format for the result. Only `png` is supported.

This filter generates a QR code that can be used to encode URLs, text, or coupon codes. The QR code is returned as an SVG image that can be directly embedded in HTML.

**Example usage in HTML:**

```liquid
<div class="qr-code-container">
  {{ coupon.code | qr_code: xdim: 6 }}
</div>
```
To return a QR code as a PNG that can be embedded in email body as an attachment, use the custom format:

```liquid
{{ coupon.code | qr_code: format: 'png' }}
```

---




## rand_by

Produces a random value which is always the same for specific parameters passed.
First parameter is a maximum random number.

Simple example:

```liquid
{{ "100" | rand_by: "param1", "param2" }}
```
Always returns `29`.

Interpolation as a parameter:

```liquid
{{ "10" | rand_by: advocate_info.email }}
```
Always returns the same number for a specific email, between 0 and 9.

---




## regexp_captures

Parses input with a given regexp and returning [regular expression captures](https://www.regular-expressions.info/brackets.html) as an array.

```liquid
{{ '12345678' | regexp_captures: '(....)(....)' | join: '-' }}
{{ 'bogdan@example.com' | regexp_captures: '^([a-z]+)\@([a-z]+)\.([a-z]+)' | json }}
```

---




## rybbon

Takes a campaign key of a BHN Rewards (formerly Rybbon) Talkable campaign.
Makes a claim request within the scope of the given campaign and returns a gift claim link.
Requires BHN Rewards (formerly Rybbon) app to be installed and enabled in order to work.

```liquid
{{ "a9a3472f4ea858758e0cd686de8408e2" | rybbon }}
```
Returns `https://www.rybbon.net/redeem.php?claimcode=ee645de47765bdbede751c8c6f08a619`

Accepts custom amount of reward for BHN Rewards (formerly Rybbon) campaigns with variable denomination. The minimum amount conforms to each specific Rybbon gift card restrictions. The maximum amount is 50.

```liquid
{{ "a9a3472f4ea858758e0cd686de8408e2" | rybbon: amount: 13.5 }}
```
Find more details about the integration here: [BHN Rewards (formerly Rybbon)](https://docs.talkable.com/advanced_features/bhnrewards.md#advanced-features-bhnrewards)

---




## save_wallet

Validates and caches the wallet template. This filter should be used on “Talkable wallet for iphone”
and “Talkable wallet for android” pages, passing a hash object with the wallet template. Optionally,
you can pass a card type to the filter. Currently, only `Wallets::ReferralCard` (default, used for Apple)
and `Wallets::GoogleReferralCard` (for Android) are supported.

Example for Apple Wallet:

```liquid
{% assign wallet = "" | new_hash %}

{% assign wallet = wallet | assign_key: "barcodes", apple_wallet_barcodes %}
{% assign wallet = wallet | assign_key: "header_fields", apple_wallet_header_fields %}

{{ wallet | save_wallet }}
```
Example for Android Wallet:

```liquid
{% assign wallet = "" | new_hash %}

{% assign wallet = wallet | assign_key: "barcode", google_wallet_barcode %}
{% assign wallet = wallet | assign_key: "primary_fields", google_wallet_primary_fields %}

{{ wallet | save_wallet: card_type: 'Wallets::GoogleReferralCard' }}
```
Required and allowed fields for each card type should be checked in the respective documentation:

* [Apple Wallet](https://developer.apple.com/documentation/walletpasses/pass)

* [Google Wallet](https://developers.google.com/wallet/generic/overview/how-classes-objects-work#objects)

## scale_color

Returns a new adjusted color with scaled attributes.
Available attributes: red, green, blue, saturation, lightness, alpha

```text
{{ "black" | scale_color: lightness: 50 }}
{{ "rgb(256, 128, 0)" | scale_color: saturation: -10 }}
```

---




## simple_format

Formats plain text to have HTML formatting. E.g. replace `\n` with `<br/>`.

```text
{{ "Hello [[advocate_info.email]]\nHere is your reward." | simple_format | interpolate }}
```
Returns `Hello John<br/>Here is your reward`.

---




## sort

Sort an array. Optional arguments for hashes: 1. property name 2. nils order (first or last).

```liquid
{{ campaign_tags | sort }}
{{ incentives | sort: "amount" }}
{{ incentives | sort: "amount", "first" }}
```

---




## squish

Returns the string, first removing all whitespace on both ends of the string, and then changing remaining consecutive whitespace groups into one space each.

```text
{{ "   foo   bar        baz " | squish }}
```
Returns `foo bar baz`.

---




## strip

Removes leading and trailing blank symbols from the string.

```text
{{ "    strip me " | strip }}
```
Returns `strip me`.

---




## tango

Takes the ID (UTID) of a Tango reward.
Places an order for the specified reward and returns a gift claim link.
Requires the Tango app to be installed and enabled in order to work.

```liquid
{{ "U957978" | tango: amount: 10.0 }}
```
Returns `https://rewardlink.io/r/1/reward123`

Find more details about the integration here: [Tango](https://docs.talkable.com/advanced_features/tango.md#advanced-features-tango)

---




## track_link_click

This filter generates a public link that can be used to track wallet link clicks.

```liquid
{{ "https://example.com" | track_link_click: "query_42" }}
```
Returns `https://talkable.com/public/[[site_slug]]/[[campaign_id]]/wallet_link_clicks/track?identifier=query_42`. After a click, the user will be redirected to the original link (`https://example.com`).

---




## tremendous

Takes a campaign key of a Tremendous campaign.
Makes a claim request within the scope of the given campaign and returns a gift claim link.
Requires Tremendous app to be installed and enabled in order to work.
Implies that there is only one funding source in the Tremendous account.

```liquid
{{ "DEM8ULSSATK0" | tremendous }}
```
Returns `https://www.tremendous.com/rewards/payout/reward123`

Find more details about the integration here: [Tremendous](https://docs.talkable.com/advanced_features/tremendous.md#advanced-features-tremendous)

---




## tweet_length

Calculates a tweet length for the string.

```text
{{ "wow this is a tweet http://example.com" | tweet_length }}
```
Returns `43`.

---




## update_query

Updates query parameters in a URL.

```liquid
{{ "http://example.com/?a=b&utm_source=foo" | update_query: utm_campaign: "Campaign Name", utm_source: "talkable" }}
```
Returns `http://example.com/?a=b&utm_campaign=Campaign%20Name&utm_source=talkable`.

---




## url2png

Captures a snapshot of a website URL you pass to it. In case you need to
embed a snapshot of your website into Talkable campaign it is way better
to use this liquid filter instead of embedding an iframe since an image
is always lighter in size and takes less CPU performance to render on
a screen. Also, some websites restrict themselves from embedding through
an iframe so you can take `url2png` as a bulletproof solution for a
website snapshot.

Available options:

* `ttl` - “time to live” period for a screenshot before it gets refreshed, in seconds. Value example: `86400`.

* `viewport` - Viewport dimensions. Value example: `"640x480"`.

* `custom_css_url` - Custom CSS file that will be injected into a website in case you need to change a screenshot. Value example: `"http://url2png.com/tests/css/test.css"`.

* `fullpage` - Attempts to capture entire document canvas. Value example: `true`.

Here is how you can embed a screenshot of your website into a campaign view (`site_url` returns your website URL that you set inside Site Settings):

```liquid
<img src="{{ site_url | url2png }}" class="campaign-site-on-the-back" />
```
Refresh the screenshot every week:

```liquid
<img src="{{ 'www.example.com' | url2png: ttl: 604800 }}" />
```

---




## values

Takes a hash and returns the array of its values.

```liquid
{% assign incentive_configs = incentives | values %}
```
Returns `[{ad incentive config}, {fr incentive config}]`

---




## where

Select all the objects in an array where the key has the given value.

```liquid
{{ incentives | where: "amount", 10 }}
```

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/editor/history.md
===============================================================================

# History

Whenever view or stylesheet is updated editor saves changes to History which
you can access from Campaign Editor navigation bar:

[Image]




1. To preview commit changes click on its link:

[Image]  


2. To see commit diff open diff icon (change log will open from the right):

[Image]  


3. To rollback changes preview some particular commit → save changes.
Changes will be saved as a new commit.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/editor/partials.md
===============================================================================

# Partials

In Talkable, Liquid partials are reusable snippets of code that can be included in main template. This allows for modular and maintainable template design.

## Adding a Partial

To add a new Liquid partial, follow these steps:

1. **Navigate to the Partials modal**: Navigate to the HTML & CSS section of the Editor. Click on the Partials button.

2. **Create a Partial**: Click on the Create Partial button. This will open a new form where you can define your partial.

  * **Name**: Provide a unique name for your partial. This name will be used to reference the partial in your main templates. The name could be separated by underscores.

  * **Type**: Select the type of content you want to include in your partial. This can be either HTML or CSS. The content of the partial will be rendered as HTML or CSS based on the type you select.

  * **Insert to current position**: This option will insert the partial at the current cursor position in the editor.

[Image]

## Default Partials

Talkable provides a set of default partials that can be used in your templates.
These partials are pre-defined snippets of code that can be included in your main templates without the need to create them from scratch,
each partial has description with detailed information about its purpose and usage.

[Image]

## Including a Partial in a Main Template

To include a partial in a main template, use the name of the partial you created. The syntax for including a partial is as follows:

```liquid
{% render 'partial_name' %}
```
Replace `partial_name` with the actual name of your partial. This will insert the content of the partial at the specified location in your main template.

## Example

Here is an example of how to create and use a Liquid partial:

1. **Create a Partial**:

  * **Name**: header

  * **Type**: HTML

  * **Content**:

```liquid
<header>
  <h1>{{ site.title }}</h1>
</header>
```

2. **Render the Partial in a Main Template**:

```liquid
<body>
  {% render 'header' %}
  <main>
    {{ content }}
  </main>
</body>
```

3. **Variables assigned using variable tags can be passed to a template by listing them as parameters on the render tag**:

```liquid
{% assign my_variable = 'apples' %}
{% render 'header', my_variable: my_variable, my_other_variable: 'oranges' %}
```
> **Note:**
>
> The code within the rendered template does not automatically have access to the variables assigned using variable tags within the parent template. Similarly, variables assigned within the rendered template cannot be accessed by code in any other template.

By following these steps, you can efficiently manage reusable components within your Liquid templates, enhancing both modularity and maintainability.
> **Seealso:**
>
> [Liquid Partials documentation](https://shopify.github.io/liquid/tags/template/#render)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/editor/variables.md
===============================================================================

# Variables

Variables are used to show dynamic data like Campaign tag, Advocate info, etc.  
All Variables are enclosed into `{{ }}` which means [Liquid Output](https://shopify.dev/api/liquid#liquid-syntax).

Each Campaign View has its own set of Variables located inside Editor
navigation:

[Image]




Each Variable is represented with Name and Value:

[Image]

* Name describes meaning of the Variable

* Notation explains how to write Variable inside Template/Styles editor area

* Value shows what this particular Variable results with (Value may be
different between preview and production scenarious)




There are also variables marked as deprecated, those will be deleted in the future, so please do not use them.

List of deprecated variables:

* {{ advocate_offer.manual_signup }}

* {{ campaign_setup.tiers[0].id }}

* {{ campaign_setup.tiers[0].name }}

* {{ campaign_setup.tiers[0].threshold }}

* {{ campaign_setup.tiers[0].localized_range }}

* {{ campaign_setup.tiers[0].multiplier }}

* {{ campaign_setup.tiers[0].icon_url }}

* {{ campaign_setup.tiers[0].active }}




---




## {{ advocate_info }}

**Available in**: all Views  
**Type**: `Object`

Personal data for Advocate.

| Property               | Value                                                     | Description                                                                                                                                                                                                                  |
| ---------------------- | --------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| email                  | “[affiliate@example.com](mailto:affiliate%40example.com)” | Advocate email he is registered with                                                                                                                                                                                         |
| first\_name            | “John”                                                    | Advocate first name provided on Signup                                                                                                                                                                                       |
| last\_name             | “Smith”                                                   | Advocate last name provided on Signup                                                                                                                                                                                        |
| external\_customer\_id | “1jsh17136”                                               | Advocate unique ID passed by Merchant to [Talkable Integration](https://docs.talkable.com/integration/standard/integration_components.md#integration-standard-integration-components-initialization-script) as `customer_id` |
| sub\_choice            | false \| true                                             | Advocate custom parameter which can be used to pass additional data to Advocate Signup/Share Page                                                                                                                            |
| purchases\_count       | 0                                                         | Advocate number of tracked store purchases                                                                                                                                                                                   |




## {{ advocate_origin }}

**Available in**: all Views  
**Type**: `Object`

Origin data for Advocate.

| Property                         | Value                                              | Description                                                                                                                               |
| -------------------------------- | -------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| id                               | 1234567890                                         | Advocate origin id                                                                                                                        |
| new\_customer                    | false \| true                                      | Advocate is a new customer or not                                                                                                         |
| created\_at                      | “2016-07-27T00:00:00.000+03:00”                    | Time when Advocate origin was created                                                                                                     |
| event\_category                  | “purchase”                                         | Advocate origin event category                                                                                                            |
| coupon\_codes                    | [“AD\_DISCOUNT”]                                   | Coupon codes that are used in Advocate origin                                                                                             |
| ip.address                       | “52.6.41.1”                                        | Advocate IP address                                                                                                                       |
| ip.qa                            | false \| true                                      | Shows if the IP address is listed as QA                                                                                                   |
| ip.location.country              | “United States”                                    | Advocate geolocation country based on their IP address                                                                                    |
| ip.location.city                 | “San Jose”                                         | Advocate geolocation city based on their IP address                                                                                       |
| ip.location.country\_code        | “US”                                               | Advocate geolocation country code based on their IP address                                                                               |
| ip.location.subdivision\_1\_code | “VA”                                               | Region-portion of the [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) code for the 1st level region associated with the IP address |
| ip.location.subdivision\_1\_code | “”                                                 | Region-portion of the [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) code for the 2nd level region associated with the IP address |
| product.sku                      | “AJ7292-002”                                       | Product SKU                                                                                                                               |
| product.title                    | “Nike Air VaporMax 95”                             | Product title                                                                                                                             |
| product.url                      | “[https://bit.ly/2IPp0rX](https://bit.ly/2IPp0rX)” | Product URL                                                                                                                               |
| product.image\_url               | “[https://bit.ly/2GuVAMQ](https://bit.ly/2GuVAMQ)” | Product image URL                                                                                                                         |
| product.description              | “Cool sneakers”                                    | Product description                                                                                                                       |
| product.custom\_properties       | {“price”: “190”}                                   | Product custom properties                                                                                                                 |




## {{ coupon }}

**Available in**: Friend Claim Page, Advocate Redemption Email, Advocate Reward
Paid Email  
**Type**: `String`

Coupon is given to a person as a Reward based on Incentive (condition of
giving out the Reward).

[Image]




Make sure Incentives are correct:

* If its `single-use` Coupon Code, make sure Coupon List exist and it has
enough coupons and they are valid in terms of uniqueness and validity

* If its `multi-use` Coupon Code, make sure it has a correct value

[Image]



---




## {{ incentives }}

**Available in**: all Views  
**Type**: `Object`

Reflects entire Campaign Incentives list including. This object can include
several Incentives which are also objects.

Here is an example of `{{ incentives }}` Variable with two incentives: Advocate and Friend:

```javascript
{
  advocate: {
    amount: 10.0,
    description: "$10",
    percentage: false
  },
  friend: {
    amount: 100.0,
    description: "100%",
    percentage: true
  }
}
```
And here is an example of using `{{ incentives }}` values:

```liquid
Give your friend {{ incentives.friend.description }} OFF!
```
Which outputs:

```text
Give your friend 100% OFF!
```


| Property          | Value         | Description                                                                              |
| ----------------- | ------------- | ---------------------------------------------------------------------------------------- |
| Liquid slug       | “referrer”    | Incentive identifier                                                                     |
| amount            | 50.0          | Incentive amount (float)                                                                 |
| description       | “$50”         | Formatted Incentive including currency and amount                                        |
| percentage        | true \| false | Type of Incentive amount: fixed or percentage                                            |
| required\_actions | 0             | Number of required actions to trigger reward (i.e. 2 purchases needed to trigger reward) |

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/editor/videos.md
===============================================================================

# Videos

Welcome to the Talkable Liquid Template Tutorials.

In these videos, we will test the waters with Liquid and show you the most basic
steps in order to dive in.

We will give you a swift intro on Liquid, and show you how you can navigate your
liquid customize screens within Talkable.

To get the most out of Liquid Templating, one should already be somewhat familiar
with HTML, CSS, & some scripting languages.

Luckily Liquid Templating is growing fast in popularity and there are plenty of
resources already out there if one has the desire to learn more.

You can read more basics at [https://shopify.dev/api/liquid/basics](https://shopify.dev/api/liquid/basics)

## Liquid Tutorial 1: Intro & Navigation

[https://fast.wistia.net/embed/iframe/akeaiptdp2](https://fast.wistia.net/embed/iframe/akeaiptdp2)

## Liquid Tutorial 2: Using Variables and Filters

[https://fast.wistia.net/embed/iframe/upf8tdkdy4](https://fast.wistia.net/embed/iframe/upf8tdkdy4)

## Liquid Tutorial 3: Using Custom Assets

[https://fast.wistia.net/embed/iframe/p08rp1t2gy](https://fast.wistia.net/embed/iframe/p08rp1t2gy)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/localization.md
===============================================================================

# Localization

Each template can be localized.
Localization is not a part of the view template. Default Talkable campaigns are comming with localization now. It is stored in campaign allowing multiple campaign to use same template with different localization and ability to edit Copy of a campaign outside of liquid editor (making interface significantly easier for marketer).

Campaign localization is done using a liquid filter localize:

```liquid
{{ "offer_title" | localize: 'Get [[incentives.referrer.description]]' }}
```
You can add this filter in the Campaign Editor section under HTML & CSS, and it will appear in the Copy tab:

[Image]

Any campaign that uses view with localize call have this data appeared.
Now you are able to change the default value to something else like Obten {{incentives.referrer.description}} (Spanish)

Campaign Localization is copied when campaign is copied, so you are able to use the following flow:

1. Create Campaign

2. Build templates with localization support

3. Make a copy of the campaign

4. Translate localization in a copy to different language.

Campaigns with phone input have country automatically detected based on user IP:

[Image]

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/offers_expiration.md
===============================================================================

# Offers Expiration

Talkable Campaign allows to set offer expiration for Advocate and Friend by specifying specific date or setting offer duration in hours.

## Advocate

* `Advocate deadline` - Advocate will no longer be able to share after this date.

* All existing Advocate offers are always affected if specified date is changed
while campaign is live.

* Advocate Deadline is not copied when campaign is copied.

* When campaign is deactivated, all Advocate offers instantly become expired because deactivating a campaign is equal to set Advocate offer deadline to now.

* When Advocate offer is expired, Advocate is still eligible for reward.
In other words Advocate offer expiration only prevents Advocate from sharing but not from getting rewarded.

* This setting doesn’t affect Friend reward in any way.

## Friend

* `Friend Deadline` - Friend will no longer be able to claim the offer after this date.

* `Friend Offer Duration` - Friend will no longer be able to claim the offer X
hours after Advocate shared it with him. Leave blank to disable expiration at all.

* All existing Friend offers will be affected if specified date or offer duration is
changed while campaign is live.

* If a deadline and an offer duration are both specified, Friend offer will be expired on
the closest date calculated from offer duration or specified in deadline.

* Friend offer deadline should never be earlier than Advocate offer deadline
(because there is no sense to share offer that cannot be claimed).

* When Friend offer is expired, Friend and Advocate are not able to receive any rewards.
But they still may try to use coupon they received earlier because Talkable platform doesn’t control coupon expiration. Only merchant site does that.

* When campaign is copied only offer duration gets copied, but not deadline.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/tutorials.md
===============================================================================

# Tutorials

Contents:

* [Global](https://docs.talkable.com/campaigns/tutorials/global.md)
  * [ZeroClipboard](https://docs.talkable.com/campaigns/tutorials/global.md#zeroclipboard)
  * [Allow showing coupon in the Friend Share Email and its reminder](https://docs.talkable.com/campaigns/tutorials/global.md#allow-showing-coupon-in-the-friend-share-email-and-its-reminder)
* [Advocate Signup/Share Page](https://docs.talkable.com/campaigns/tutorials/offers_show.md)
  * [Instant Reward](https://docs.talkable.com/campaigns/tutorials/offers_show.md#instant-reward)
  * [CloudSponge Integration](https://docs.talkable.com/campaigns/tutorials/offers_show.md#cloudsponge-integration)
  * [Multiple Email Fields](https://docs.talkable.com/campaigns/tutorials/offers_show.md#multiple-email-fields)
  * [LinkedIn](https://docs.talkable.com/campaigns/tutorials/offers_show.md#linkedin)
* [Friend Claim Page](https://docs.talkable.com/campaigns/tutorials/offers_claim.md)
  * [Email Gating](https://docs.talkable.com/campaigns/tutorials/offers_claim.md#email-gating)
* [Incentive Criteria](https://docs.talkable.com/campaigns/tutorials/incentive_criteria.md)
* [SDK Campaign Setup](https://docs.talkable.com/campaigns/tutorials/sdk_campaign_setup.md)
  * [Campaign Tags](https://docs.talkable.com/campaigns/tutorials/sdk_campaign_setup.md#campaign-tags)
    * [Default Campaign Tags](https://docs.talkable.com/campaigns/tutorials/sdk_campaign_setup.md#default-campaign-tags)
    * [Custom Campaign Tags](https://docs.talkable.com/campaigns/tutorials/sdk_campaign_setup.md#custom-campaign-tags)
  * [Native Sharing for Mobile](https://docs.talkable.com/campaigns/tutorials/sdk_campaign_setup.md#native-sharing-for-mobile)
    * [Enabling Native Sharing](https://docs.talkable.com/campaigns/tutorials/sdk_campaign_setup.md#enabling-native-sharing)
  * [Mobile View Modes](https://docs.talkable.com/campaigns/tutorials/sdk_campaign_setup.md#mobile-view-modes)
    * [Default Mode](https://docs.talkable.com/campaigns/tutorials/sdk_campaign_setup.md#default-mode)
    * [Suggested Mode](https://docs.talkable.com/campaigns/tutorials/sdk_campaign_setup.md#suggested-mode)
  * [Sharing Channel Configuration](https://docs.talkable.com/campaigns/tutorials/sdk_campaign_setup.md#sharing-channel-configuration)
    * [Understanding user_agent Helper](https://docs.talkable.com/campaigns/tutorials/sdk_campaign_setup.md#understanding-user-agent-helper)
    * [SMS Sharing](https://docs.talkable.com/campaigns/tutorials/sdk_campaign_setup.md#sms-sharing)
    * [WhatsApp Sharing](https://docs.talkable.com/campaigns/tutorials/sdk_campaign_setup.md#whatsapp-sharing)
    * [Email Sharing](https://docs.talkable.com/campaigns/tutorials/sdk_campaign_setup.md#email-sharing)
    * [Link Sharing](https://docs.talkable.com/campaigns/tutorials/sdk_campaign_setup.md#link-sharing)
    * [Facebook/X Sharing](https://docs.talkable.com/campaigns/tutorials/sdk_campaign_setup.md#facebook-x-sharing)
  * [Best Practices](https://docs.talkable.com/campaigns/tutorials/sdk_campaign_setup.md#best-practices)
    * [Campaign Tag Strategy](https://docs.talkable.com/campaigns/tutorials/sdk_campaign_setup.md#campaign-tag-strategy)
    * [Sharing Channel Strategy](https://docs.talkable.com/campaigns/tutorials/sdk_campaign_setup.md#sharing-channel-strategy)
  * [Related Documentation](https://docs.talkable.com/campaigns/tutorials/sdk_campaign_setup.md#related-documentation)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/tutorials/global.md
===============================================================================

# Global

## ZeroClipboard

If you are using more multiple ZeroClipboard instances and one of them is placed inside hidden block (with display: none;), make sure to fire up that instance like following:

**HTML:**

```html
<div class="js-before">
  <div data-clipboard-text="First" data-copied-label="First" class="js-click-to-copy">
    First element
  </div>
</div>
<div class="js-after hidden">
  <div data-clipboard-text="Second" data-copied-label="Second" class="js-click-to-copy">
    Second element
  </div>
</div>
```
**JS:**

```javascript
$(function() {

  Talkable.bindClickToCopy('.js-click-to-copy');

  var switchBlocks = function() {
    $('.js-before, .js-after').toggleClass("hidden");
    // Re-init ZeroClipboard instance to refresh tooltip position
    Talkable.bindClickToCopy('.js-click-to-copy');
  };

});
```
**CSS:**

```css
.hidden {
  display: none;
}
```

## Allow showing coupon in the Friend Share Email and its reminder

This option means that there could be only one visitor for each email share (one per email per offer). When this option is active such opportunities appear:

* **Show Coupon in the Friend Share Email and its reminder:**

    Talkable allows you to control whether you want to generate a unique coupon code for each email share or all shares made by an Advocate should have an exact same coupon code associated with it. When using single-use coupons it is recommended to enable this option only if you want to show the coupon inside Friend Share email and its reminder(s).

* **{{ coupon_code_used }} interpolation:**

    {{ coupon_code_used }} becomes available as an interpolation in Friend share email and its reminder(s). It allows you to check whether the coupon code has been used already at checkout.

* **Skip email gating:**

    Allows you to make a smooth user experience for Friend where they can surpass email gating on the Friend Claim page when clicking from the Friend Share email and its reminder(s). This is done for Friend’s convenience.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/tutorials/incentive_criteria.md
===============================================================================

# Incentive Criteria

When you create an incentive for Advocate or Friend, you can set its trigger condition.

Condition is processed by [Liquid](https://github.com/Shopify/liquid) and the result should evaluate to `true` for incentive to be triggered.

If condition is left blank, it is assumed to be `true`.

#### Example

If you want to reward Advocate only if Friend is a new customer and used  
Talkable single-use coupon at checkout, the right trigger condition would be:

[Image]

If condition evaluates to anything else than `true` or `false`, the value
it returns will be visible in Referrals Report.

This way, you can know which part of a condition was the reason Advocate didn’t
get a reward:

[Image]
[Image]

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/tutorials/offers_claim.md
===============================================================================

# Friend Claim Page

## Email Gating

Email gating is used when you need RD to provide an email to get a
reward. It is used on the Friend Claim Page and looks like a popup with email
field, submit button, and “signup for latest news” checkbox.

**Basic Setup**

**HTML:**

```html
{% if gated_email != blank %}
  <div class="js-coupon-code">{{ coupon_code }}</div>
  <a class="js-proceed-link" href="{{ proceed_to_merchant_path }}">Shop using this code</a>
{% else %}
  <div class="js-hide">
    <form action="#" class="js-gating-unlock">
      <input type="email" class="js-gating-email" placeholder="myname@example.com"/>
      <button>Claim your coupon code</button>
    </form>
  </div>

  <!-- What to show after submitting email. Hidden by default! -->
  <div class="js-show" style="display: none;">
    <div class="js-coupon-code">...</div>
    <a class="js-proceed-link" href="{{ proceed_to_merchant_path }}">Shop using this code</a>
  </div>
{% endif %}
```
**JS:**

```javascript
$(document).ready(function() {
  var $proceedLink    = $('.js-proceed-link'),
      $gatingEmail    = $('.js-gating-email'),
      $contentGating  = $('.js-hide'),
      $gatingUnlock   = $('.js-gating-unlock'),
      $contentHidden  = $('.js-show'),
      $couponCode     = $('.js-coupon-code');

  Talkable.subscribe('email_gating_passed', function(data) {
    $contentGating.hide();
    $contentHidden.show();
    $couponCode.text(data.coupon_code); // Insert coupon code
  });

  function unlockGating(e) {
    var email, emailValid, proxyParams, query;
    e.preventDefault();

    proxyParams = {};
    email = $.trim($gatingEmail.val());
    emailValid = /^[^@]+@([^@\.]+\.)+[^@\.]+$/.test(email);

    if (email.length && emailValid) {
      query = $.param({proxy_params: $.extend(proxyParams, {email: email})});
      Talkable.passEmailGating(query);
    } else {
      alert("Something isn’t right. Please try again");
    }
  }

  $gatingUnlock.submit(function(e) {
    unlockGating(e);
  });
});
```
**Advanced Setup**

1. Click to copy functionality for coupon code

2. Sign up for news checkbox

3. Email validation messages

**HTML:**

```html
{% if gated_email != blank %}
  <div class="js-coupon-code">{{ coupon_code }}</div>
  <a class="js-proceed-link" href="{{ proceed_to_merchant_path }}">Shop using this code</a>
{% else %}
  <div class="js-hide">
    <form action="#" class="js-gating-unlock">
      <input type="email" class="js-gating-email" placeholder="myname@example.com"/>
      <label for="email-subscription">
        <input type="checkbox" checked="checked" id="email-subscription" class="js-gating-checkbox" />
        Sign me up for the latest news
      </label>
      <button>Claim your coupon code</button>
    </form>
  </div>

  <!-- What to show after submitting email. Hidden by default! -->
  <div class="js-show" style="display: none;">
    <div class="js-coupon-code">...</div>
    <a class="js-proceed-link" href="{{ proceed_to_merchant_path }}">Shop using this code</a>
  </div>

  <!-- Show errors in case something's wrong with the email. Hidden by default! -->
  <div class="js-validation" style="display: none;"></div>
{% endif %}
```
**JS:**

```javascript
$(document).ready(function() {
  var $proceedLink    = $('.js-proceed-link'),
      $gatingEmail    = $('.js-gating-email'),
      $contentGating  = $('.js-hide'),
      $gatingUnlock   = $('.js-gating-unlock'),
      $gatingCheckbox = $('.js-gating-checkbox'),
      $contentHidden  = $('.js-show'),
      $notice         = $('.js-validation'),
      $couponCode     = $('.js-coupon-code');

  function displayNotice(data) {
    $notice.html(data);
    $notice.fadeIn(300);
    setTimeout(function() {
      $notice.fadeOut(300);
    }, 3000);
  }

  Talkable.subscribe('email_gating_passed', function(data) {
    $contentGating.slideUp(300);
    setTimeout(function() {
      $contentHidden.slideDown(300);
      $couponCode.text(data.coupon_code); // Insert coupon code
      bindClipToCopy('.js-coupon-code');
    }, 300);
  });

  function unlockGating(e) {
    var email, subChoice, emailValid, proxyParams, query;
    e.preventDefault();

    proxyParams = {};
    email = $.trim($gatingEmail.val());
    proxyParams.sub_choice = $gatingCheckbox.is(':checked') ? 'yes' : 'no';
    emailValid = /^[^@]+@([^@\.]+\.)+[^@\.]+$/.test(email);

    if (email.length && emailValid) {
      query = $.param({proxy_params: $.extend(proxyParams, {email: email})});
      Talkable.passEmailGating(query);
    } else {
      displayNotice("Something isn't right. Please try again");
    }
  }

  $gatingUnlock.submit(function(e) {
    unlockGating(e);
  });
});
```

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/tutorials/offers_show.md
===============================================================================

# Advocate Signup/Share Page

## Instant Reward

Instant reward campaign is used when we need to reward RR immediately
after he shares. If RR redemption email is turned on it will be sent
right after successful share. The most popular share channel is
Facebook.

To make instant reward work you need to use FB App share instead of a
default sharer.php.
Also make sure **RR social sharing incentive** is set.

After that we need to setup Advocate Signup/Share Page with the following markup:

**HTML:**

```html
<!-- Prompt user to share -->
<a href="#" class="js-share-offer-via-facebook">Share on Facebook</a>
<!-- Insert coupon code after successful share -->
<div class="js-coupon-code"></div>
```
**JS:**

```javascript
Talkable.subscribe('facebook_share_succeeded', function(data) {
  if (data.coupon_code) {
    $('.js-coupon-code').text(data.coupon_code); // Insert coupon code as a text
  } else {
    $('.js-coupon-code').text('No coupon code provided'); // Show error that coupon code wasn't provided.
  }
});
```
If you need to hide/show some information when shared and copy code on
click here is more advanced setup:

**HTML:**

```html
<!-- Prompt user to share -->
<div class="js-not-shared">
  <a href="#" class="js-share-offer-via-facebook">Share on Facebook</a>
</div>

<!-- Show coupon code after successful share. Hidden by default. -->
<div class="js-shared" style="display: none;">
  <div class="js-coupon-code">...</div>
</div>
```
**JS:**

```javascript
Talkable.subscribe('facebook_share_succeeded', function(data) {
  if (data.coupon_code) {
    $('.js-coupon-code').text(data.coupon_code); // Insert coupon code as a text
    $('.js-coupon-code').attr('data-clipboard-text', data.coupon_code); // Copy coupon code on click
    $('.js-not-shared').hide(); // Hide everything with class `.js-not-shared`
    $('.js-shared').show(); // Show everything with class `.js-shared`
    bindClipToCopy('.js-coupon-code'); // Initiate click to copy functionality
  } else {
    $('.js-coupon-code').text('No coupon code provided'); // Show error that coupon code wasn't provided.
  }
});
```

## CloudSponge Integration

**HTML:**

```html
<a class="cs_import" href="#">Import contacts</a>
<script type="text/javascript" src="//api.cloudsponge.com/address_books.js"></script>
<script type="text/javascript">
  var csPageOptions = {
    "include": ["email"],
    "locale": "english",
    "domain_key": "PHAUB8N7PNYWP555F7YB",
    "textarea_id": "email_recipients_list"
  };
</script>
```


1. `domain_key` — CloudSponge account (Talkable by default)

2. `textarea_id` — ID attribute to populate data to

**CloudSponge and Custom Domain**

CloudSponge integration is bound to specific domain. In order to use it with
custom domain you’ll need to obtain separate `domain_key`.

1. Go to [CloudSponge](https://www.cloudsponge.com/)

2. Add new domain, use your custom domain as domain name

3. Copy & Paste new `domain_key` to your template

## Multiple Email Fields

```html
<form action="#" class="js-share-via-email-form share-via-email">
  <input type="email" name="email_recipient_list[]" />
  <input type="email" name="email_recipient_list[]" />
  <input type="email" name="email_recipient_list[]" />
</form>
```

## LinkedIn

**Separate Wording**

Enable separate LinkedIn share wording (Open Graph title and message).

```liquid
{% if user_agent contains "LinkedInBot" %}
  Special offer title for LinkedIn friends
{% else %}
  Special offer title for Facebook friends
{% endif %}
```
**Basic Setup**

**HTML:**

```html
<script src="//platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/Share" data-url="{{ 'linkedin' | claim_url }}" data-onsuccess="fireOnLinkedInShare"></script>
```
**JS:**

```javascript
function fireOnLinkedInShare() {
  Talkable.share_succeeded('linkedin');
}
```
**Advanced Setup**

**HTML:**

```html
<span class="js-linkedin-button-holder" style="display: none;">
  <script src="//platform.linkedin.com/in.js" type="text/javascript"></script>
  <script type="IN/Share" data-url="{{ 'linkedin' | claim_url }}" data-onsuccess="fireOnLinkedInShare"></script>
</span>
```
Remember to wrap LI scripts into an `js-linkedin-button-holder` container which is hidden by default not to show LinkedIn custom button
until it is loaded.

**JS:**

```javascript
function fireOnLinkedInShare() {
  Talkable.share_succeeded('linkedin');
}

function configureShareOnLinkedIn(params) {
  $('.IN-widget').attr('style', '').find('a').addClass(params.className);
  $('.IN-widget').find('span').each(function(i, element) {
    $(element).attr({style: '', id: ''});
    if ($(element).text() === 'in') {
      $(element).remove();
    } else if ($(element).text() === 'Share') {
      $(element).text(params.text);
    }
  });
}

var initLinkedInShareButton = setInterval(function() {
  if ($('span').hasClass('IN-widget')) {
    clearInterval(initLinkedInShareButton);
    $('.js-linkedin-button-holder').fadeIn(300);
    configureShareOnLinkedIn({
      className: 'btn btn-linkedin', // Button class
      text: 'LinkedIn' // Button text
    });
  }
}, 500);
```


1. `fireOnLinkedInShare` — triggering this method is required to make
Talkable visits tracking work.

2. `initLinkedInShareButton` — checks for LI button to load and then
show its container `js-linkedin-button-holder` and trigger `configureShareOnLinkedIn`.

3. `configureShareOnLinkedIn` — strips all unnecessary styles and `id` attributes from all LI button children nodes and allows to
change `class` attribute and button text by passing an object.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/tutorials/sdk_campaign_setup.md
===============================================================================

# SDK Campaign Setup

This guide explains how to set up Talkable campaigns to work seamlessly with iOS and Android mobile SDKs.

When creating campaigns for mobile SDKs, you need to configure specific settings that differ from standard web campaigns. This includes:

* Campaign tags for SDK targeting

* Native sharing channels for mobile devices

* Mobile-optimized layouts and user experience

* Platform-specific sharing options

## Campaign Tags

Campaign tags are essential for SDK integration as they determine which campaigns are displayed when the SDK makes a request.

### Default Campaign Tags

Each SDK uses default tags based on the campaign type:

| Platform | Campaign Type | Default Tag             | SDK Code         |
| -------- | ------------- | ----------------------- | ---------------- |
| iOS      | Standalone    | `ios-invite`            | Default behavior |
| iOS      | Post Purchase | `ios-post-purchase`     | Default behavior |
| Android  | Standalone    | `android-invite`        | Default behavior |
| Android  | Post Purchase | `android-post-purchase` | Default behavior |
> **Note:**
>
> **Event-based integration** does not use default tags. You **must** specify campaign tags explicitly
> when using custom events. See [iOS Custom Events](https://docs.talkable.com/ios_sdk/integration/event.md#ios-sdk-integration-event) and [Android Custom Events](https://docs.talkable.com/android_sdk/integration/event.md#android-sdk-integration-event) for details.

### Custom Campaign Tags

You can specify custom tags for more control over which campaigns are shown:

**iOS Example:**

```objc
[[Talkable manager] registerOrigin:TKBLAffiliateMember params:@{TKBLCampaignTags: @"your-custom-tag"}];
```
**Android Example:**

```java
AffiliateMember affiliateMember = new AffiliateMember(customer);
affiliateMember.setCampaignTag("your-custom-tag");
```
**Campaign Configuration:**

1. Navigate to **Campaign → Rules → Tags**

2. Add your custom tag (e.g., `your-custom-tag`)

3. Ensure the campaign status is **Live** or **Test**
> **Tip:**
>
> Use custom tags when running multiple campaigns simultaneously or when you want to
> show different campaigns to different user segments.

## Native Sharing for Mobile

Native sharing allows users to share offers using their device’s built-in sharing capabilities, providing access to all installed apps (Messages, WhatsApp, Instagram, etc.).

### Enabling Native Sharing

To enable native sharing in your campaign:

**1. Configure Mobile View Options**

Add or update the following localization:

```liquid
{% assign mobile_share_page_sharing_channels = "mobile_share_page_sharing_channels" | localize: "All", "Native Sharing only" %}
```
**Options:**

* `"All"` - Shows traditional sharing channels (SMS, Email, etc.) plus a “Share more” button for native sharing

* `"Native Sharing only"` - Shows only a native share button (recommended for mobile-first experiences)

**2. Add Native Sharing Localizations**

Add these localizations to your campaign:

```liquid
{% assign native_sharing_cta = "native_sharing_cta" | localize: "Share with friends" %}

{% assign native_share_title = "native_share_title" | localize: "Special offer from [[ site_setup.name ]]" %}

{% assign native_share_description = "native_share_description" | localize: "Get [[ friend_incentive.description ]] off at [[ site_setup.name ]]" %}
```
**3. Add Native Share Button**

Add this button to your share page template:

```liquid
<a href="#" class="button is-native js-share-native">
  <span class="button-icon is-native">
    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
      <circle cx="12" cy="5" r="2"/><circle cx="12" cy="12" r="2"/><circle cx="12" cy="19" r="2"/>
    </svg>
  </span>
  <span class="button-text">{{ native_sharing_cta }}</span>
</a>
```
**4. Add JavaScript Implementation**

Add this JavaScript to handle native sharing:

```javascript
function native_share(title, url, description) {
  if (navigator.share) {
    navigator.share({
      title: title,
      text: description,
      url: url
    }).then(function () {
      Talkable.shareSucceeded("native_share");
    }).catch(function (error) {
      console.error("Error sharing:", error);
    });
  } else {
    // Fallback for browsers without Web Share API
    alert("Native sharing is not supported on this device");
  }
}

$(".js-share-native").click(function(e) {
  e.preventDefault();
  native_share(
    "{{ 'native_share_title' | localize }}",
    "{{ 'native_share' | claim_url }}",
    "{{ 'native_share_description' | localize }}"
  );
});
```

> **Note:**
>
> Native sharing uses the **Web Share API**, which is supported on:
>
> * iOS Safari 12.2+
>
> * Android Chrome 61+
>
> * Android Firefox 71+
>
> * WebView components in iOS and Android SDKs
>
> It is **not** supported on most desktop browsers.

## Mobile View Modes

The SDK campaigns support two mobile view optimization modes:

### Default Mode

Shows all enabled sharing channels in standard order:

```liquid
{% assign mobile_view_option = "mobile_view_option" | localize: "Default", "Suggested" %}

{% if mobile_view_option == "Default" %}
  <!-- Standard layout -->
{% endif %}
```
**Characteristics:**

* All channels displayed equally

* Native sharing appears at bottom

* Traditional sharing button layout

### Suggested Mode

Optimized layout that prioritizes SMS and native sharing:

```liquid
{% if mobile_view_option == "Suggested" %}
  <!-- SMS appears first if enabled -->
  <!-- Native sharing more prominent -->
{% endif %}
```
**Characteristics:**

* SMS sharing appears first (if enabled)

* Native sharing button is more prominent

* Optimized for mobile user experience

* Better conversion rates on mobile devices

## Sharing Channel Configuration

Configure which sharing channels are available in your mobile campaign.

### Understanding user_agent Helper

Talkable provides a `user_agent` helper object that detects device capabilities and platform:

**Device Detection:**

```liquid
{% if user_agent.mobile %}
  <!-- Mobile device (phone or tablet) -->
{% endif %}

{% if user_agent.desktop %}
  <!-- Desktop device -->
{% endif %}

{% if user_agent.tablet %}
  <!-- Tablet device -->
{% endif %}
```
**Native Features Supported by SDK:**

The SDK automatically detects and reports the following native features:

| Feature                        | Description                                                          |
| ------------------------------ | -------------------------------------------------------------------- |
| `send_sms`                     | SMS sharing capability (requires SIM card and telephony support)     |
| `copy_to_clipboard`            | Copy referral link to device clipboard (always available)            |
| `share_via_native_mail`        | Native email app sharing (detects available email clients)           |
| `share_via_facebook`           | Facebook sharing (requires Facebook SDK initialization)              |
| `share_via_facebook_messenger` | Facebook Messenger sharing (requires Facebook SDK and Messenger app) |
| `share_via_x`                  | X sharing (currently disabled on mobile SDKs)                        |
| `share_via_whatsapp`           | WhatsApp sharing (detects WhatsApp installation)                     |

**Feature Detection Examples:**

```liquid
{% if user_agent.features.send_sms %}
  <!-- Device supports SMS sharing -->
{% endif %}

{% if user_agent.features.share_via_facebook %}
  <!-- Facebook SDK is initialized -->
{% endif %}

{% if user_agent.features.share_via_whatsapp %}
  <!-- WhatsApp is installed -->
{% endif %}

{% if user_agent.features.copy_to_clipboard %}
  <!-- Clipboard access available (always true on mobile) -->
{% endif %}
```

> **Tip:**
>
> Always use `user_agent.features` checks to ensure sharing buttons only appear when the device
> supports them. This prevents showing non-functional buttons to users.

### SMS Sharing

```liquid
{% assign advocate_share_page_channel_sms = "advocate_share_page_channel_sms"
   | localize: trait: "boolean", default: "Enabled" %}
```
**Implementation in template:**

```liquid
{% if advocate_share_page_channel_sms and user_agent.features.send_sms %}
  <li>
    <a href="#" class="button js-share-offer-via-sms">
      <span class="button-icon is-sms">
        <svg><!-- SMS icon --></svg>
      </span>
      Share by SMS
    </a>
  </li>
{% endif %}
```
**Requirements:**

* Only available on mobile devices

* Requires `user_agent.features.send_sms` capability check

* Automatically detected by device browser

* Button only renders when both localization is enabled AND device supports SMS

### WhatsApp Sharing

```liquid
{% assign advocate_share_page_channel_whatsapp = "advocate_share_page_channel_whatsapp"
   | localize: "Enable for mobile only", "Enable for desktop only",
               "Enable for desktop and mobile", "Disable for desktop and mobile",
               default: 'Disable for desktop and mobile' %}
```
**Implementation in template:**

```text
{% if advocate_share_page_channel_whatsapp == "Enable for desktop and mobile" %}
  {% assign show_whatsapp = true %}
{% endif %}
{% if advocate_share_page_channel_whatsapp == "Enable for mobile only" and user_agent.mobile %}
  {% assign show_whatsapp = true %}
{% endif %}
{% if advocate_share_page_channel_whatsapp == "Enable for desktop only" and user_agent.desktop %}
  {% assign show_whatsapp = true %}
{% endif %}

{% if show_whatsapp %}
  <li>
    <a href="#" class="button js-share-offer-via-whatsapp" target="_blank">
      Share via WhatsApp
    </a>
  </li>
{% endif %}
```
**Options:**

* `"Enable for mobile only"` - Recommended for SDK campaigns (checks `user_agent.mobile`)

* `"Enable for desktop only"` - For web-only campaigns (checks `user_agent.desktop`)

* `"Enable for desktop and mobile"` - Both platforms

* `"Disable for desktop and mobile"` - Disabled

### Email Sharing

```liquid
{% assign advocate_share_page_channel_email = "advocate_share_page_channel_email" | localize: trait: "boolean", default: "Enabled" %}
```
**Features:**

* Opens email form in popup/modal

* Supports single or multiple recipients

* Can include personalized message

* Works on all platforms

### Link Sharing

```liquid
{% assign advocate_share_page_channel_link = "advocate_share_page_channel_link" | localize: trait: "boolean", default: "Enabled" %}
```
**Features:**

* Copy referral link to clipboard

* Share via any channel

* Useful as fallback option

### Facebook/X Sharing

```liquid
{% assign advocate_share_page_desktop_facebook_sharing = "advocate_share_page_desktop_facebook_sharing"
   | localize: "Wall Post", "Direct Message", "Both", "Disabled" %}

{% assign advocate_share_page_channel_x = "advocate_share_page_channel_x"
   | localize: trait: "boolean", default: "Disabled" %}
```
**Implementation in template:**

```text
{% if advocate_share_page_desktop_facebook_sharing != "Disabled"
      and user_agent.features.share_via_facebook %}
  <li>
    <a href="#" class="button js-share-offer-via-facebook">
      Share on Facebook
    </a>
  </li>
{% endif %}

{% if advocate_share_page_channel_x and user_agent.features.share_via_x %}
  <li>
    <a href="#" class="button js-share-offer-via-x">
      Share on X
    </a>
  </li>
{% endif %}
```
**Feature Detection:**

* Facebook: Requires `user_agent.features.share_via_facebook`

* X: Requires `user_agent.features.share_via_x`

* These features are automatically detected based on browser/device capabilities
> **Note:**
>
> For iOS SDK, Facebook and X sharing require delegate method implementation.
> See [iOS Social Sharing](https://docs.talkable.com/ios_sdk/social_sharing.md#ios-sdk-social-sharing) for details.

## Best Practices

### Campaign Tag Strategy

**Single Campaign:**

* Use default tags (`ios-invite`, `android-invite`)

* Simplest setup, lowest maintenance

**Multiple Campaigns:**

* Use custom tags for segmentation

* Example: `vip-ios-invite`, `standard-ios-invite`

* Allows A/B testing different offers
> **Important:**
>
> **Campaign Matching Behavior**: When multiple campaigns have matching tags, only **one campaign will be selected** and displayed to the user. The selection is based on campaign priority and other internal factors. Ensure your tag strategy accounts for this behavior to avoid unexpected campaign conflicts.

**Seasonal Campaigns:**

* Include date/season in tag: `summer-2024-ios`

* Easy to identify and manage

* Clear campaign lifecycle

### Sharing Channel Strategy

**For Mobile-First Experience:**

1. **Enable Native Sharing**: Set `mobile_share_page_sharing_channels` to `"Native Sharing only"`

  * Simplest user experience

  * Access to all device apps

  * Highest conversion rate

2. **Enable SMS**: Most popular mobile sharing method

  * Set `advocate_share_page_channel_sms` to `"Enabled"`

  * Works on all mobile devices

  * High open and click rates

3. **Use “Suggested” Mobile View**: For optimized mobile layout

  * Set `mobile_view_option` to `"Suggested"`

  * Prioritizes SMS and native sharing

  * Better mobile user experience

**For Hybrid Experience (Mobile + Web):**

1. **Enable “All” Sharing Channels**: Set `mobile_share_page_sharing_channels` to `"All"`

  * Shows traditional channels (Email, Facebook, etc.)

  * Plus native sharing as “Share more” option

  * Works across all devices

2. **Configure Platform-Specific Channels**:

  * WhatsApp: `"Enable for mobile only"`

  * Facebook: Configure for desktop

  * SMS: Mobile only

## Related Documentation

* [iOS SDK Standalone Campaign](https://docs.talkable.com/ios_sdk/integration/standalone.md#ios-sdk-integration-standalone)

* [Android SDK Standalone Campaign](https://docs.talkable.com/android_sdk/integration/standalone.md#android-sdk-integration-standalone)

* [iOS Social Sharing](https://docs.talkable.com/ios_sdk/social_sharing.md#ios-sdk-social-sharing)

* [iOS Advanced Features](https://docs.talkable.com/ios_sdk/advanced.md#ios-sdk-advanced)

* [Android Advanced Features](https://docs.talkable.com/android_sdk/advanced.md#android-sdk-advanced)

* [Campaign Localization](https://docs.talkable.com/campaigns/localization.md#campaigns-localization)

* [Campaign Views](https://docs.talkable.com/campaigns/views.md#campaigns-views)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/views.md
===============================================================================

# Views

Understanding Page-Views is easy, just go through the glossary and learn who lands on what Page-View and where. Email-Views are more tricky in terms of understanding when they are sent. All Email-Views must go through a pre-validation step before they are sent:

1. Check if the Campaign View is in use (controlled inside Campaign Editor). Otherwise the email will never be sent.

[Image]

2. Is the recipient email in a valid email format (i.e. Talkable mail servers can deliver an email to a real recipient)? If so, we move on to campaign specific rules to determine whether or not the email should be sent (see Email sending conditions section inside each Email-View).

After pre-validation Talkable campaign level validation kicks in:

1. Who is the recipient? Advocate or Friend?

2. What are the email sending conditions for the campaign?

3. Time Conditional → send an email in 3 days

4. Action Conditional → send email after friend purchases

5. Inaction Conditional → send 2nd email if friend does not purchase

6. Offer State Conditional → send email only if offer still valid / send email is
offer is expired

7. Customer Attribute Conditional → send email if user is new customer

## Views glossary

* [Advocate Signup/Share Page](https://docs.talkable.com/campaigns/views/offers_show.md)
* [Advocate Offer Email](https://docs.talkable.com/campaigns/views/notifier_offers_email.md)
* [Friend Share Email](https://docs.talkable.com/campaigns/views/notifier_offers_share_via_email.md)
* [Friend Share Email Reminder](https://docs.talkable.com/campaigns/views/notifier_offers_share_via_email_reminder.md)
* [Friend Claim Page](https://docs.talkable.com/campaigns/views/offers_claim.md)
* [Advocate Reward Confirmation Email](https://docs.talkable.com/campaigns/views/advocate_rewards_confirmation.md)
* [Advocate Reward Paid Email](https://docs.talkable.com/campaigns/views/advocate_rewards_paid.md)
* [Friend Reward Paid Email](https://docs.talkable.com/campaigns/views/friend_rewards_paid.md)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/views/advocate_rewards_confirmation.md
===============================================================================

# Advocate Reward Confirmation Email

Main purpose of this email is to send a notification about Reward via email to an Advocate before Referral approving.

## Email sending conditions

By default is sent immediately after the reward is created, but can be delayed by configuration.
However, this email does not work with tiered campaigns because rewards are being issued after the referral approval.
> **Note:**
>
> Ideal email width is 480px. This is a most universal width for both
> mobile and desktop platforms. [Read more about email design](https://docs.talkable.com/campaigns/designer.md#designer-email).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/views/advocate_rewards_paid.md
===============================================================================

# Advocate Reward Paid Email

Let Advocates know they have been rewarded, or a partial refund has been issued.  
The email is triggered and sent when an Advocate receives a reward. It can be a Signup, Share, or Referral reward (when Referral is marked as `Approved`).
All trigger conditions are configured via [Incentive Criteria](https://docs.talkable.com/campaigns/tutorials/incentive_criteria.md#incentive-criteria).

Advocate Reward Paid Email template could be customised via [Editor](https://docs.talkable.com/campaigns/editor.md#editor).

Frequently used Variables:

* To show Reward Coupon Code use `{{ coupon_code }}`.

* Main CTA should point to a merchant site to start shopping `{{ proceed_to_advocate_destination_url }}`.

[Image]

> **Note:**
>
> Ideal email width is 480px. This is a most universal width for both
> mobile and desktop platforms. [Read more about email design](https://docs.talkable.com/campaigns/designer.md#designer-email).

## Email sending conditions

By default is sent immediately after the reward status turns into Paid, but can be delayed by configuration.  


When the coupon list for Sharing or Signup incentive is empty at the moment of reward issuing, **Reward Paid Email** will not be sent.
We will try to reward the Advocate and send the email in the background for 60 days (with an increasing duration between retries) in the case of coupon list fulfillment.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/views/friend_rewards_paid.md
===============================================================================

# Friend Reward Paid Email

Main purpose of this email is to send a Reward via email, and remind about
it in the future.  
Email is triggered to a Friend who passed Email Gating, and received Reward
(i.e. coupon code).  


The email will be sent once Talkable knows Friend’s email which they provides on the Friend Claim Page (such technique works great for email capturing). See [Email Gating](https://docs.talkable.com/campaigns/tutorials/offers_claim.md#tutorials-email-gating) for more details.

Frequently used Variables:

* Main CTA should point to a merchant site to start shopping `{{ proceed_to_merchant_path }}`.

* To show coupon code use `{{ coupon_code }}`.

* To show expiration date use `{{ valid_until }}`. [Formatting options](https://docs.talkable.com/campaigns/editor/filters.md#liquid-filter-format-date).




[Image]




```liquid
Here is your {{ reward.incentive.description }} OFF deal you just claimed!
Use it on any purchase by {{ valid_until }}
Coupon code: {{ coupon_code }}
<a href="{{ proceed_to_merchant_path }}">Shop now</a>
```

> **Note:**
>
> Ideal email width is 480px. This is a most universal width for both
> mobile and desktop platforms. [Read more about email design](https://docs.talkable.com/campaigns/designer.md#designer-email).

## Email sending conditions

By default is sent immediately after the reward is created, but can be delayed by configuration.

Main email sending criteria (unable to change):

1. The Email **will not** be sent only if all three conditions meet:

  1. Reward type is Click

  2. ‘Allow coupon in the Friend Share Email’ is enabled inside Campaign Rules

  3. Friend Share Email is already sent

In all other scenarious the email will be sent immediately unless delayed by configuration.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/views/notifier_offers_email.md
===============================================================================

# Advocate Offer Email

Email is triggered to an Advocate on sign up. Explain the value proposition
and encourage Advocate to share using the buttons.

* For Standalone Campaign it triggers when Advocate signs up.

* For Post-Checkout Campaign it triggers when Advocate makes store purchase.

Main CTA should point to an Advocate Signup/Share Page — `{{ share_page_url }}`.




[Image]



> **Note:**
>
> Ideal email width is 480px. This is a most universal width for both
> mobile and desktop platforms. [Read more about email design](https://docs.talkable.com/campaigns/designer.md#designer-email).

## Email sending conditions

By default is sent immediately after the offer is created, but can be delayed by configuration.

1. Talkable creates an offer based on the following criteria:

  1. Purchase creation

  2. Affiliate member signup. Advocate can sign up manually by entering their email, or their email is passed via JS integration (or URL). For example, a customer signs up to refer-a-friend on a /share page. This triggers an affiliate member signup.

2. Main email sending criteria (unable to change):

  1. If Advocate offer is active

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/views/notifier_offers_share_via_email.md
===============================================================================

# Friend Share Email

Email is triggered by an Advocate to their Friends from the [Advocate Signup/Share Page](https://docs.talkable.com/campaigns/views/offers_show.md#advocate-signup-share-page-view).  
The main purpose of this email is to invite a Friend by showing a personal
Share Message from Advocate along with a unique Friend Claim Page link. Some
information about offer itself is recommended.

Frequently used Variables:

* Main CTA should point to a [Friend Claim Page](https://docs.talkable.com/campaigns/views/offers_claim.md#friend-claim-page-view) — `{{ short_url }}`.

* To show Email Share Message from Advocate use `{{ custom_message_body }}`.




[Image]

> **Note:**
>
> Ideal email width is 480px. This is a most universal width for both
> mobile and desktop platforms. [Read more about email design](https://docs.talkable.com/campaigns/designer.md#designer-email).

## Email sending conditions

By default is sent immediately after the offer is shared, but can be delayed by configuration.

1. Main email sending criteria (unable to change):

  1. Only one email for recipient with the same offer (if Advocate shares twice with one Friend Talkable sends only one share email)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/views/notifier_offers_share_via_email_reminder.md
===============================================================================

# Friend Share Email Reminder

Email is triggered only if Friend Share Email Reminder checkbox was checked
on the [Advocate Signup/Share Page](https://docs.talkable.com/campaigns/views/offers_show.md#advocate-signup-share-page-view) when sharing.  
By default reminder email sends out in 72 hours after sharing if Friend didn’t
use their Offer (i.e. didn’t make a store purchase using coupon code).

Main CTA should point to a Friend Claim Page — `{{ short_url }}`.  
To change email trigger delay open `Editor` / `Extra fields` for the
particular email.




[Image]

> **Note:**
>
> Ideal email width is 480px. This is a most universal width for both
> mobile and desktop platforms. [Read more about email design](https://docs.talkable.com/campaigns/designer.md#designer-email).

## Email sending conditions

By default the email is sent in 72 hours after the offer is shared.

Main email sending criteria (unable to change):

* If Friend offer is active

* Recipient (Friend) was not referred by this offer yet

* Current offer is the last one shared with the recipient (if were delayed few reminders Talkable sends the last one)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/views/offers_claim.md
===============================================================================

# Friend Claim Page

Friend lands here from [Friend Share Email](https://docs.talkable.com/campaigns/views/notifier_offers_share_via_email.md#friend-share-email-view).  
Explain him what special discount he will get when using this link.  
It’s recommended to show coupon code for the Friend on this page
(and only on this page).

Frequently used Variables:

* Main CTA should point to a merchant site to start shopping `{{ proceed_to_merchant_path }}`.  


* To show coupon code use `{{ coupon_code }}`.

* To show expiration date use `{{ valid_until }}`. [Formatting options](https://docs.talkable.com/campaigns/editor/filters.md#liquid-filter-format-date).




[Image]

```liquid
{% if offer_active %}
  Copy your code: {{ coupon_code }}
  <a href="{{ proceed_to_merchant_path }}">Shop now</a>
  Offer is valid until {{ friend_offer.valid_until | format_date }}.
{% else %}
  Offer expired.
  <a href="{{ proceed_to_merchant_path }}">Proceed without offer</a>
{% endif %}
```

> **Note:**
>
> Do not change `name` and `class` attributes, otherwise
> functionality won’t work. js- class prefix means it is used in Talkable API.

Related tutorials for this View:

* [Email Gating](https://docs.talkable.com/campaigns/tutorials/offers_claim.md#tutorials-email-gating)

* [ZeroClipboard](https://docs.talkable.com/campaigns/tutorials/global.md#tutorials-zeroclipboard)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/campaigns/views/offers_show.md
===============================================================================

# Advocate Signup/Share Page

Combining the Signup and Share page brings a smoother experience to our customers.

First we show Advocate Signup Form. Signup is skipped when we know the advocate or Email gating for advocate is disabled (by default - enabled).
On this page Advocate signs up by entering their email address and phone number(optional).

[Image]

After signup, without reloading page, Advocate Share form is shown:

[Image]

Here Advocate shares an offer with their Friends. Explain the value proposition
to Advocate and Friend, that both will receive an exclusive discount.

Available sharing methods:

* Email sharing

* Social sharing (Facebook, Twitter, LinkedIn)

* Link sharing (direct link to the Friend Claim Page)

#### Email sharing example:




[Image]

Note `Send my friend a reminder e-mail in 3 days` checkbox — this is [Friend Share Email Reminder](https://docs.talkable.com/campaigns/views/notifier_offers_share_via_email_reminder.md#friend-share-email-reminder-view) trigger.

#### Facebook sharing example (simplified):

```html
<a href="#" class="js-share-offer-via-facebook">
  Share on Facebook
</a>
```


#### Twitter sharing example (simplified):

```html
<a href="{{ twitter_share_link }}">
  Share on Twitter
</a>
```


#### Share by link example (simplified):

```html
<div data-clipboard-text="{{ short_url }}"
     data-copied-label="Copied!"
     data-placement="top"
     title="Click to Copy"
     class="js-share-by-link">
  Copy and share by link
</div>
```


* `data-clipboard-text` — data to be copied to a user clipboard on click.

* `data-copied-label` — tooltip text after copying.

* `data-placement` — tooltip placement. Possible values: `top`, `right`, `bottom`, `left`.

* `title` — tooltip text on hover.
> **Note:**
>
> Do not change `name` and `class` attributes, otherwise
> functionality won’t work. js- class prefix means it is used in Talkable API.

Related tutorials for this View:

* [Instant Reward](https://docs.talkable.com/campaigns/tutorials/offers_show.md#tutorials-instant-reward)

* [CloudSponge Integration](https://docs.talkable.com/campaigns/tutorials/offers_show.md#tutorials-cloudsponge)

* [Multiple Email Fields](https://docs.talkable.com/campaigns/tutorials/offers_show.md#tutorials-multiple-email-fields)

* [LinkedIn](https://docs.talkable.com/campaigns/tutorials/offers_show.md#tutorials-linkedin)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation.md
===============================================================================

# Email Marketing & Automation

With these tools, Talkable synchronizes everyone who opts in for Talkable marketing communications during signup, allowing you to manage all your emails in one place automatically.

## Contents:

* [Bluecore](https://docs.talkable.com/email_marketing_and_automation/bluecore.md)
* [Braze](https://docs.talkable.com/email_marketing_and_automation/braze.md)
* [Cordial](https://docs.talkable.com/email_marketing_and_automation/cordial.md)
* [CreateSend](https://docs.talkable.com/email_marketing_and_automation/createsend.md)
* [Cheetah](https://docs.talkable.com/email_marketing_and_automation/cheetah.md)
* [Dotdigital](https://docs.talkable.com/email_marketing_and_automation/dotdigital.md)
* [Klaviyo](https://docs.talkable.com/email_marketing_and_automation/klaviyo.md)
* [Yotpo](https://docs.talkable.com/email_marketing_and_automation/yotpo.md)
* [Ometria](https://docs.talkable.com/email_marketing_and_automation/ometria.md)

* [Oracle Bronto](https://docs.talkable.com/email_marketing_and_automation/oracle_bronto.md)
* [Omnisend](https://docs.talkable.com/email_marketing_and_automation/omnisend.md)
* [Mailchimp](https://docs.talkable.com/email_marketing_and_automation/mailchimp.md)
* [Sailthru](https://docs.talkable.com/email_marketing_and_automation/sailthru.md)
* [SendGrid](https://docs.talkable.com/email_marketing_and_automation/sendgrid.md)
* [Salesforce Marketing Cloud](https://docs.talkable.com/email_marketing_and_automation/sfmc.md)
* [GetResponse](https://docs.talkable.com/email_marketing_and_automation/getresponse.md)
* [TargetBay](https://docs.talkable.com/email_marketing_and_automation/targetbay.md)
* [Emarsys](https://docs.talkable.com/email_marketing_and_automation/emarsys.md)

* [Exponea](https://docs.talkable.com/email_marketing_and_automation/exponea.md)
* [Hubspot](https://docs.talkable.com/email_marketing_and_automation/hubspot.md)
* [Iterable](https://docs.talkable.com/email_marketing_and_automation/iterable.md)
* [Listrak](https://docs.talkable.com/email_marketing_and_automation/listrak.md)
* [Attentive](https://docs.talkable.com/email_marketing_and_automation/attentive.md)
* [Apsis](https://docs.talkable.com/email_marketing_and_automation/apsis.md)
* [WhatCounts](https://docs.talkable.com/email_marketing_and_automation/what_counts_pro.md)
* [Custom App](https://docs.talkable.com/email_marketing_and_automation/custom_app.md)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation/apsis.md
===============================================================================

# Apsis

Talkable syncs referral opt-ins and contact data into Apsis — an email marketing and automation platform — so every Advocate and Friend who opts in during a campaign flows into your marketing in real
time.

## What this integration does

Talkable turns referral sign-ups into enriched, segmentable contacts in your ESP —
automatically. The integration:

* **Syncs referral opt-ins** — every Advocate and Friend who opts in during a Talkable
campaign is sent to your ESP as a contact create-or-update, so referral sign-ups grow
your marketable audience in real time.

* **Targets the right list or audience** — each contact is added to the specific list,
audience, or subscription group you choose, so referred customers drop straight into the
right welcome series, nurture flow, or segment.

* **Enriches contacts with referral data** — map Talkable data such as referral and share
counts, advocate status, and campaign details to your ESP’s fields through interpolation
variables, powering referral-based segmentation, triggers, and personalization.

## When opt-ins are synced

An opt-in can happen at two points in a referral — the Advocate’s and the Friend’s —
and Talkable syncs each one to your ESP the instant it happens, so no opted-in contact is
missed or left for a manual export. Here is where that fits in the referral journey:

1. **Advocate opts in.** A customer enters a Talkable campaign (post-purchase, standalone,
floating widget, and so on) and opts in for marketing communications.

2. **Advocate synced** → Talkable sends the advocate’s contact details and opt-in status to
your ESP.

3. **Advocate shares the offer.** They share by email, social, SMS, or a unique link.

4. **Friend opts in.** A friend follows the referral link, enters the campaign, and opts in
to claim the offer.

5. **Friend synced** → Talkable sends the friend’s contact details and opt-in status to your
ESP.

## Segmentation use cases

With referral data flowing into your ESP, you can:

* Build a segment of active advocates (people with one or more successful referrals) for
VIP or loyalty campaigns.

* Trigger a welcome series for friends acquired through a referral.

* Re-engage advocates who have not shared recently.

* Personalize messages with relational details — the person’s name and who referred them —
so referral emails feel personal, not like another generic promo.

## Available data points

You can attach a wide range of Talkable referral data to each contact you sync. The exact
variable names are shown in the product when you configure the integration; at a glance, the
data available includes:

| Data              | What’s included                                                                                                                     |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Contact details   | Email, phone number, and name                                                                                                       |
| Opt-in status     | Email and SMS opt-in state, and when each opt-in happened                                                                           |
| Person profile    | Advocate and loyalty status, when and where they signed up (including location), and any custom properties you pass from your store |
| Referral activity | Referrals made (total, approved, and pending), shares made, and who referred them — by name and email                               |
| Rewards           | The coupon code and reward value the person earned                                                                                  |
| Campaign          | Campaign name, type, tags, and whether it’s active                                                                                  |

## Sample payload

Here is what a referral opt-in looks like when Talkable syncs it through your Custom App
endpoint — you choose exactly which referral data to include:

```json
{
  "email": "jordan.lee@example.com",
  "first_name": "Jordan",
  "email_optin": true,
  "is_advocate": true,
  "referrals_total": 7,
  "friends_referred": 5,
  "times_shared": 12,
  "referred_by_first_name": "Casey",
  "referred_by_last_name": "Morgan",
  "referred_by_email": "casey.morgan@example.com",
  "reward_coupon_code": "FRIEND25",
  "reward_earned": "$25 account credit",
  "campaign_name": "Spring Referral 2026"
}
```


## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation/attentive.md
===============================================================================

# Attentive
> **Tip:**
>
> This is a custom integration that can be implemented with extra effort. If you wish to integrate this vendor, please contact your Customer Success Manager to apply it to your campaigns.

Talkable converts customers into brand advocates by enabling trusted, word-of-mouth referrals. Attentive connects with customers on the most engaging channel: SMS.

Together, Talkable and Attentive drive personalized brand engagement and the **acquisition of high-value, loyal customers.**

**Use cases:**

1. Capture phone numbers through Talkable to seamlessly grow your SMS subscriber list. The integration automatically passes these numbers to your Attentive messaging flow.

2. Promote refer-a-friend to your SMS list to facilitate increased sharing. Mobile messages have a 99% open rate.

    **Sample SMS triggered post-purchase:**
> Thanks for your recent purchase! A referral from you would mean a lot to us! Share ‘Brand name’ with friends & we’ll share $10 with you 😃

3. Trigger referral messages through SMS for increased engagement.

    For example, send advocates their referral reward via text to increase redemptions and repeat shoppers.

## App Store

Integration with Attentive is done in Talkable with the corresponding App store application.

It supports next data to be synchronized from Talkable to Attentive:

* Email and phone opt ins

* Reward coupons
> **Note:**
>
> For phone and phone opt-in synchronization, corresponding attributes should be configured in a Talkable campaign: [Phone number gating](https://docs.talkable.com/advanced_features/phone_number_gating.md#advanced-features-phone-number-gating)

Here are the conditions when Talkable acquires phone numbers:

1. Advocate signs up, provides phone number and opts in for Talkable marketing text messages:

[[Image]](https://docs.talkable.com/_images/signup_advocate_sms.png.md)

2. Friend passes phone gating and opts in for Talkable marketing text messages:

[[Image]](https://docs.talkable.com/_images/signup_friend_sms.png.md)

Each ESP application allows custom attributes to be included with each request. The following interpolation variables are allowed:

1. `{{ person }}` - a data object for either Advocate or Friend whenever they sign up or pass phone gating and opt-in for marketing text messages.

2. `{{ ip }}` – a data object from which IP address either a signup or phone gating occurred.

3. `{{ campaign }}` – a data object with details about the campaign within which the phone was captured.

[[Image]](https://docs.talkable.com/_images/variables.png.md)

Each variable is described in the “Available variables” sidebar and can be expanded to see all nested properties.

## How to add a new app?

Please use the following guide to start using an app you need:

1. Navigate into the App store:

[[Image]](https://docs.talkable.com/_images/app_store_step_1.png.md) [[Image]](https://docs.talkable.com/_images/app_store_step_2.png.md)

2. Choose an app you need by clicking “Install”

3. Fill in all necessary fields. You can use tips on the right that instruct how to find all necessary credentials.

4. Complete installation and enable the app:

[Image]

5. Test the app by pressing on the “Send sample payload” and then check if you are seeing a test request inside your ESP:

[[Image]](https://docs.talkable.com/_images/send_sample_payload.png.md)

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation/bluecore.md
===============================================================================

# Bluecore

Talkable syncs referral opt-ins and contact data into Bluecore — a retail marketing platform — so every Advocate and Friend who opts in during a campaign flows into your marketing in real
time.

## What this integration does

Talkable turns referral sign-ups into enriched, segmentable contacts in your ESP —
automatically. The integration:

* **Syncs referral opt-ins** — every Advocate and Friend who opts in during a Talkable
campaign is sent to your ESP as a contact create-or-update, so referral sign-ups grow
your marketable audience in real time.

* **Targets the right list or audience** — each contact is added to the specific list,
audience, or subscription group you choose, so referred customers drop straight into the
right welcome series, nurture flow, or segment.

* **Enriches contacts with referral data** — map Talkable data such as referral and share
counts, advocate status, and campaign details to your ESP’s fields through interpolation
variables, powering referral-based segmentation, triggers, and personalization.

## When opt-ins are synced

An opt-in can happen at two points in a referral — the Advocate’s and the Friend’s —
and Talkable syncs each one to your ESP the instant it happens, so no opted-in contact is
missed or left for a manual export. Here is where that fits in the referral journey:

1. **Advocate opts in.** A customer enters a Talkable campaign (post-purchase, standalone,
floating widget, and so on) and opts in for marketing communications.

2. **Advocate synced** → Talkable sends the advocate’s contact details and opt-in status to
your ESP.

3. **Advocate shares the offer.** They share by email, social, SMS, or a unique link.

4. **Friend opts in.** A friend follows the referral link, enters the campaign, and opts in
to claim the offer.

5. **Friend synced** → Talkable sends the friend’s contact details and opt-in status to your
ESP.

## Segmentation use cases

With referral data flowing into your ESP, you can:

* Build a segment of active advocates (people with one or more successful referrals) for
VIP or loyalty campaigns.

* Trigger a welcome series for friends acquired through a referral.

* Re-engage advocates who have not shared recently.

* Personalize messages with relational details — the person’s name and who referred them —
so referral emails feel personal, not like another generic promo.

## Available data points

You can attach a wide range of Talkable referral data to each contact you sync. The exact
variable names are shown in the product when you configure the integration; at a glance, the
data available includes:

| Data              | What’s included                                                                                                                     |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Contact details   | Email, phone number, and name                                                                                                       |
| Opt-in status     | Email and SMS opt-in state, and when each opt-in happened                                                                           |
| Person profile    | Advocate and loyalty status, when and where they signed up (including location), and any custom properties you pass from your store |
| Referral activity | Referrals made (total, approved, and pending), shares made, and who referred them — by name and email                               |
| Rewards           | The coupon code and reward value the person earned                                                                                  |
| Campaign          | Campaign name, type, tags, and whether it’s active                                                                                  |

## Sample payload

When a referred customer opts in, Talkable triggers a Bluecore campaign to their address:

```json
{
  "email": "jordan.lee@example.com",
  "campaign_id": "your_campaign_id"
}
```


## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation/braze.md
===============================================================================

# Braze

With ESP apps clients can synchronize emails that Talkable acquires with their ESP. Here are the conditions when Talkable acquires emails:

1. Advocate signs up and opts in for Talkable marketing emails:

[[Image]](https://docs.talkable.com/_images/signup_advocate.png.md)

2. A friend passes email gating and opts in for Talkable marketing emails:

[[Image]](https://docs.talkable.com/_images/signup_friend.png.md)

Each ESP application allows custom attributes to be included with each request. The following interpolation variables are allowed:

1. `{{ person }}` - a data object for either advocate or friend whenever they sign up or pass email gating and opt-in for marketing emails.

2. `{{ ip }}` – a data object from which IP address either a signup or email gating occurred.

3. `{{ campaign }}` – a data object with details about the campaign within which the email was captured.

[[Image]](https://docs.talkable.com/_images/variables.png.md)

Each variable is described in the “Available variables” sidebar and can be expanded to see all nested properties.

## How to add a new app?

Please use the following guide to start using an app you need:

1. Navigate into the App store:

[[Image]](https://docs.talkable.com/_images/app_store_step_1.png.md) [[Image]](https://docs.talkable.com/_images/app_store_step_2.png.md)

2. Choose an app you need by clicking “Install”.

3. Fill in all necessary fields using the credentials found through the instructions above.
> **Important:**
>
> When creating or choosing an API key to use for Talkable opt-ins, make sure that the API key has the
> following permission: `users.track`

4. Complete installation in Talkable and enable the app:

[Image]

5. Test the app by pressing on the “Send sample payload” and then check if you are seeing a test request inside your ESP:

[[Image]](https://docs.talkable.com/_images/send_sample_payload.png.md)

## Subscription group identifier

Talkable allows to specify a subscription group that the person will be added to upon email opt-in.
Copy the subscription group identifier from the Braze admin at Audience → Subscription Group Management (the ID column)
and paste it in Talkable in the “Subscription group identifier” field.

## User aliases

Optionally, you can provide a [user alias](https://www.braze.com/docs/api/objects_filters/user_alias_object) that will be sent with other user attributes after the opt-in.
To add an alias, modify the action payload in Talkable to include the following fields:

* `user_alias.alias_name`

* `user_alias.alias_label`

Any other payload additions will be sent as user attributes.

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation/cheetah.md
===============================================================================

# Cheetah

Talkable syncs referral opt-ins and contact data into Cheetah — a cross-channel marketing platform — so every Advocate and Friend who opts in during a campaign flows into your marketing in real
time.

## What this integration does

Talkable turns referral sign-ups into enriched, segmentable contacts in your ESP —
automatically. The integration:

* **Syncs referral opt-ins** — every Advocate and Friend who opts in during a Talkable
campaign is sent to your ESP as a contact create-or-update, so referral sign-ups grow
your marketable audience in real time.

* **Targets the right list or audience** — each contact is added to the specific list,
audience, or subscription group you choose, so referred customers drop straight into the
right welcome series, nurture flow, or segment.

* **Enriches contacts with referral data** — map Talkable data such as referral and share
counts, advocate status, and campaign details to your ESP’s fields through interpolation
variables, powering referral-based segmentation, triggers, and personalization.

## When opt-ins are synced

An opt-in can happen at two points in a referral — the Advocate’s and the Friend’s —
and Talkable syncs each one to your ESP the instant it happens, so no opted-in contact is
missed or left for a manual export. Here is where that fits in the referral journey:

1. **Advocate opts in.** A customer enters a Talkable campaign (post-purchase, standalone,
floating widget, and so on) and opts in for marketing communications.

2. **Advocate synced** → Talkable sends the advocate’s contact details and opt-in status to
your ESP.

3. **Advocate shares the offer.** They share by email, social, SMS, or a unique link.

4. **Friend opts in.** A friend follows the referral link, enters the campaign, and opts in
to claim the offer.

5. **Friend synced** → Talkable sends the friend’s contact details and opt-in status to your
ESP.

## Segmentation use cases

With referral data flowing into your ESP, you can:

* Build a segment of active advocates (people with one or more successful referrals) for
VIP or loyalty campaigns.

* Trigger a welcome series for friends acquired through a referral.

* Re-engage advocates who have not shared recently.

* Personalize messages with relational details — the person’s name and who referred them —
so referral emails feel personal, not like another generic promo.

## Available data points

You can attach a wide range of Talkable referral data to each contact you sync. The exact
variable names are shown in the product when you configure the integration; at a glance, the
data available includes:

| Data              | What’s included                                                                                                                     |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Contact details   | Email, phone number, and name                                                                                                       |
| Opt-in status     | Email and SMS opt-in state, and when each opt-in happened                                                                           |
| Person profile    | Advocate and loyalty status, when and where they signed up (including location), and any custom properties you pass from your store |
| Referral activity | Referrals made (total, approved, and pending), shares made, and who referred them — by name and email                               |
| Rewards           | The coupon code and reward value the person earned                                                                                  |
| Campaign          | Campaign name, type, tags, and whether it’s active                                                                                  |

## Sample payload

Here is what a referral opt-in looks like when Talkable syncs it to Cheetah Digital — each
value maps to a column in your Cheetah data table:

```json
{
  "data": [
    { "name": "email", "value": "jordan.lee@example.com" },
    { "name": "first_name", "value": "Jordan" },
    { "name": "last_name", "value": "Lee" },
    { "name": "email_optin", "value": "true" },
    { "name": "referrals_total", "value": "7" },
    { "name": "friends_referred", "value": "5" },
    { "name": "times_shared", "value": "12" },
    { "name": "is_advocate", "value": "true" },
    { "name": "referred_by_first_name", "value": "Casey" },
    { "name": "referred_by_last_name", "value": "Morgan" },
    { "name": "referred_by_email", "value": "casey.morgan@example.com" },
    { "name": "reward_coupon_code", "value": "FRIEND25" },
    { "name": "reward_earned", "value": "$25 account credit" },
    { "name": "campaign_name", "value": "Spring Referral 2026" }
  ]
}
```


## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation/cordial.md
===============================================================================

# Cordial

Talkable syncs referral opt-ins and contact data into Cordial — a cross-channel messaging platform — so every Advocate and Friend who opts in during a campaign flows into your marketing in real
time.

## What this integration does

Talkable turns referral sign-ups into enriched, segmentable contacts in your ESP —
automatically. The integration:

* **Syncs referral opt-ins** — every Advocate and Friend who opts in during a Talkable
campaign is sent to your ESP as a contact create-or-update, so referral sign-ups grow
your marketable audience in real time.

* **Targets the right list or audience** — each contact is added to the specific list,
audience, or subscription group you choose, so referred customers drop straight into the
right welcome series, nurture flow, or segment.

* **Enriches contacts with referral data** — map Talkable data such as referral and share
counts, advocate status, and campaign details to your ESP’s fields through interpolation
variables, powering referral-based segmentation, triggers, and personalization.

## When opt-ins are synced

An opt-in can happen at two points in a referral — the Advocate’s and the Friend’s —
and Talkable syncs each one to your ESP the instant it happens, so no opted-in contact is
missed or left for a manual export. Here is where that fits in the referral journey:

1. **Advocate opts in.** A customer enters a Talkable campaign (post-purchase, standalone,
floating widget, and so on) and opts in for marketing communications.

2. **Advocate synced** → Talkable sends the advocate’s contact details and opt-in status to
your ESP.

3. **Advocate shares the offer.** They share by email, social, SMS, or a unique link.

4. **Friend opts in.** A friend follows the referral link, enters the campaign, and opts in
to claim the offer.

5. **Friend synced** → Talkable sends the friend’s contact details and opt-in status to your
ESP.

## Segmentation use cases

With referral data flowing into your ESP, you can:

* Build a segment of active advocates (people with one or more successful referrals) for
VIP or loyalty campaigns.

* Trigger a welcome series for friends acquired through a referral.

* Re-engage advocates who have not shared recently.

* Personalize messages with relational details — the person’s name and who referred them —
so referral emails feel personal, not like another generic promo.

## Available data points

You can attach a wide range of Talkable referral data to each contact you sync. The exact
variable names are shown in the product when you configure the integration; at a glance, the
data available includes:

| Data              | What’s included                                                                                                                     |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Contact details   | Email, phone number, and name                                                                                                       |
| Opt-in status     | Email and SMS opt-in state, and when each opt-in happened                                                                           |
| Person profile    | Advocate and loyalty status, when and where they signed up (including location), and any custom properties you pass from your store |
| Referral activity | Referrals made (total, approved, and pending), shares made, and who referred them — by name and email                               |
| Rewards           | The coupon code and reward value the person earned                                                                                  |
| Campaign          | Campaign name, type, tags, and whether it’s active                                                                                  |

## Sample payload

Here is what a referral opt-in looks like when Talkable syncs it to Cordial — referral
data lands as contact attributes, ready for segments and automations:

```json
{
  "channels": {
    "email": { "address": "jordan.lee@example.com", "subscribeStatus": "subscribed" }
  },
  "first_name": "Jordan",
  "last_name": "Lee",
  "referrals_total": 7,
  "friends_referred": 5,
  "times_shared": 12,
  "is_advocate": true,
  "referred_by_first_name": "Casey",
  "referred_by_last_name": "Morgan",
  "referred_by_email": "casey.morgan@example.com",
  "reward_coupon_code": "FRIEND25",
  "reward_earned": "$25 account credit",
  "campaign_name": "Spring Referral 2026"
}
```


## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation/createsend.md
===============================================================================

# CreateSend

Talkable syncs referral opt-ins and contact data into CreateSend — an email marketing platform — so every Advocate and Friend who opts in during a campaign flows into your marketing in real
time.

## What this integration does

Talkable turns referral sign-ups into enriched, segmentable contacts in your ESP —
automatically. The integration:

* **Syncs referral opt-ins** — every Advocate and Friend who opts in during a Talkable
campaign is sent to your ESP as a contact create-or-update, so referral sign-ups grow
your marketable audience in real time.

* **Targets the right list or audience** — each contact is added to the specific list,
audience, or subscription group you choose, so referred customers drop straight into the
right welcome series, nurture flow, or segment.

* **Enriches contacts with referral data** — map Talkable data such as referral and share
counts, advocate status, and campaign details to your ESP’s fields through interpolation
variables, powering referral-based segmentation, triggers, and personalization.

## When opt-ins are synced

An opt-in can happen at two points in a referral — the Advocate’s and the Friend’s —
and Talkable syncs each one to your ESP the instant it happens, so no opted-in contact is
missed or left for a manual export. Here is where that fits in the referral journey:

1. **Advocate opts in.** A customer enters a Talkable campaign (post-purchase, standalone,
floating widget, and so on) and opts in for marketing communications.

2. **Advocate synced** → Talkable sends the advocate’s contact details and opt-in status to
your ESP.

3. **Advocate shares the offer.** They share by email, social, SMS, or a unique link.

4. **Friend opts in.** A friend follows the referral link, enters the campaign, and opts in
to claim the offer.

5. **Friend synced** → Talkable sends the friend’s contact details and opt-in status to your
ESP.

## Segmentation use cases

With referral data flowing into your ESP, you can:

* Build a segment of active advocates (people with one or more successful referrals) for
VIP or loyalty campaigns.

* Trigger a welcome series for friends acquired through a referral.

* Re-engage advocates who have not shared recently.

* Personalize messages with relational details — the person’s name and who referred them —
so referral emails feel personal, not like another generic promo.

## Available data points

You can attach a wide range of Talkable referral data to each contact you sync. The exact
variable names are shown in the product when you configure the integration; at a glance, the
data available includes:

| Data              | What’s included                                                                                                                     |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Contact details   | Email, phone number, and name                                                                                                       |
| Opt-in status     | Email and SMS opt-in state, and when each opt-in happened                                                                           |
| Person profile    | Advocate and loyalty status, when and where they signed up (including location), and any custom properties you pass from your store |
| Referral activity | Referrals made (total, approved, and pending), shares made, and who referred them — by name and email                               |
| Rewards           | The coupon code and reward value the person earned                                                                                  |
| Campaign          | Campaign name, type, tags, and whether it’s active                                                                                  |

## Sample payload

Here is what a referral opt-in looks like when Talkable syncs it to CreateSend — referral
data lands in the subscriber’s custom fields:

```json
{
  "EmailAddress": "jordan.lee@example.com",
  "Name": "Jordan Lee",
  "ConsentToTrack": "Yes",
  "CustomFields": [
    { "Key": "referrals_total", "Value": "7" },
    { "Key": "friends_referred", "Value": "5" },
    { "Key": "times_shared", "Value": "12" },
    { "Key": "is_advocate", "Value": "true" },
    { "Key": "referred_by_first_name", "Value": "Casey" },
    { "Key": "referred_by_last_name", "Value": "Morgan" },
    { "Key": "referred_by_email", "Value": "casey.morgan@example.com" },
    { "Key": "reward_coupon_code", "Value": "FRIEND25" },
    { "Key": "reward_earned", "Value": "$25 account credit" },
    { "Key": "campaign_name", "Value": "Spring Referral 2026" }
  ]
}
```


## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation/custom_app.md
===============================================================================

# Custom App

## Overview

Custom App is a powerful solution that enables seamless data transfer from Talkable to various external systems, such as: your website, Email Service Providers (ESP), Customer Data Platforms (CDP).

Unlike traditional webhooks, which require setting up multiple individual endpoints for different event types, Custom App provides a centralized way to manage and control data flows in a more flexible manner.

[Migration from Webhooks to Custom App](https://docs.talkable.com/web_hooks/migration_to_custom_app.md#web-hooks-migration-to-custom-app)

### Key Features

* **Event-Based Data Synchronization**: Automatically sends customer-related event data to a specified endpoint, ensuring real-time updates and accurate tracking.

* **Centralized Configuration**: Allows users to configure multiple event actions within a single interface instead of managing separate webhook URLs.

* **Customizable Payloads**: Supports additional attributes and interpolation variables, allowing for flexible data structures.

## Set Up

1. Navigate to the App store:

[[Image]](https://docs.talkable.com/_images/app_store_step_1.png.md) [[Image]](https://docs.talkable.com/_images/app_store_step_2.png.md)

2. Choose a Custom app and click “Install”

3. Fill in Endpoint URL and App name fields, and enable the required actions.

4. Complete installation and enable the app:

[Image]

## Webhook Signature Verification

The x-talkable-signature header is included in each request and contains a signature that you have to verify to make sure the request is not compromised.

Talkable generates the signature using a [Base64](https://en.wikipedia.org/wiki/Base64) encoded hash-based message authentication code ([HMAC](https://en.wikipedia.org/wiki/HMAC)) with [SHA-256](https://en.wikipedia.org/wiki/SHA-2).

To verify the signature, you should complete the following steps:

1. Prepare the payload_json string

    Create a JSON string from the payload of the request.

2. Determine the expected signature

  * Compute an hex encoded **HMAC** with the **SHA256** hash function. Use the **Webhook security key** as a key, and use the payload_json string as a message.

  * Encode a computed hash with **Base64**

    Your Talkable **Webhook security key** can be found in the Webhook set up page by navigating to **Menu** then **Webhooks**.

[Image]

---
[Image]

3. Compare the signatures

    Compare the signature from the header with your calculated signature.

**Examples:**

*Ruby:*

```ruby
require 'base64'
require 'openssl'
require 'active_support/security_utils'

WEBHOOK_SECRET_KEY = 'my_webhook_secret'

def verify_webhook(data, header_signature)
  calculated_signature = Base64.strict_encode64(OpenSSL::HMAC.hexdigest('sha256', WEBHOOK_SECRET_KEY, data))
  ActiveSupport::SecurityUtils.secure_compare(calculated_signature, header_signature)
end
```
*JavaScript:*

```javascript
const crypto = require('crypto');

const WEBHOOK_SECRET_KEY = 'my_webhook_secret';

function verifyWebhook(data, headerSignature) {
  // Calculate HMAC
  const calculatedSignature = btoa(crypto
    .createHmac('sha256', WEBHOOK_SECRET_KEY)
    .update(data)
    .digest('hex')
  );

  return crypto.timingSafeEqual(
    Buffer.from(calculatedSignature, 'base64'),
    Buffer.from(headerSignature, 'base64')
  );
}
```

## Available actions

Each action allows custom attributes to be included. You can see allowed interpolation variables by clicking Show available variables button:

[[Image]](https://docs.talkable.com/_images/variables.png.md)

### Sync signups

This action automatically synchronizes all people whenever they sign up no matter if person opted in by email or phone number.

*Default payload:*

```JSON
{
  "email": "person-9eb230f8d189fca9@talkable-sample.com",
  "email_optin": "true",
  "phone_number": "+12025551111",
  "phone_optin": "true"
}
```

### Sync email opt-ins

This action automatically synchronizes all people whenever they sign up and opt in. Email signups without opt-in are not triggered by this action.

*Default payload:*

```JSON
{
  "site_id": "1",
  "email": "person-40728a5b940e3247@talkable-sample.com",
  "email_optin": "true"
}
```

### Sync phone opt-ins

This action automatically synchronizes all people whenever they sign up and opt in for text messages. Signups without phone opt-in are not triggered by this action.

*Default payload:*

```JSON
{
  "site_id": "1",
  "email": "person-fa8e880e25bd47b3@talkable-sample.com",
  "phone_number": "+12025551111"
}
```

### Unsubscribe

This action automatically synchronizes all people who unsubscribe from Talkable emails.

*Default payload:*

```JSON
{
  "site_id": "1",
  "email": "person-591542c54ff21a49@talkable-sample.com"
}
```

### Offer share

This action automatically synchronizes all offer shares made by Advocates.

*Default payload:*

```JSON
{
  "site_id": "1",
  "email": "person-591542c54ff21a49@talkable-sample.com"
}
```

### Send reward

This action automatically synchronizes reward information whenever a reward is issued.

*Default payload:*

```JSON
{
  "description": "$5",
  "amount": "5.0",
  "coupon_code": "FR_NEW_5_OFF",
  "reason": "click",
  "site_id": "1"
}
```

### Create coupon

This action automatically sends coupons generated by Talkable to your system, allowing you to implement their applicability in your store. It is triggered whenever the quantity of available coupons drops below a Talkable threshold.

*Default payload:*

```JSON
{
  "site_id": "1",
  "coupon_code": "SAMPLE-COUPON-CODE",
  "coupon_discount_amount": "0.0"
}
```

### Event

This action automatically synchronizes all registered Events and Purchases.

*Default payload:*

```JSON
{
  "site_id": "1",
  "type": "Event",
  "created_at": "2024-11-25 00:00:00 -0800",
  "event_category": "public_event",
  "event_number": "183247241",
  "subtotal": "100.0",
  "currency_iso_code": "USD",
  "email": "advocate@example.com"
}
```

### Refund

This action automatically synchronizes all created refunds.

*Default payload:*

```JSON
{
  "site_id": "3",
  "refunded_at": "2025-11-21 07:44:15 -0800",
  "partially_refunded": "false",
  "subtotal": "100.0",
  "refund_subtotal": "100.0"
}
```

### Referral Create

This action automatically synchronizes all created referrals.

*Default payload:*

```JSON
{
  "site_id": "1",
  "campaign_id": "142",
  "referral_status": "in_progress",
  "advocate_email": "advocate@example.com",
  "friend_email": "friend@example.com"
}
```

### Referral status change

This action automatically synchronizes all referral status changes.

*Default payload:*

```JSON
{
  "site_id": "1",
  "campaign_id": "142",
  "referral_status": "in_progress",
  "advocate_email": "advocate@example.com",
  "friend_email": "friend@example.com"
}
```

### Click reward verification

This action sends information about a Friend when they attempt claiming a reward. The response from the Endpoint URL is checked to decide if a reward should be given. To reject unverified rewards, use click_reward_verified liquid variable in the incentive criteria.

**Note:** By default, the verification request times out at 1 second, and in that case the reward is considered verified.

*Default payload:*

```JSON
{
  "email": "friend@example.com",
  "site_id": "1"
}
```

### Check unsubscribed

This action is used to ensure emails are not sent from Talkable to user email addresses who have unsubscribed from the client side.

**Note:** By default, the request times out at 1 second, and in that case the user is considered subscribed.

*Default payload:*

```JSON
{
  "site_id": "1",
  "email": "unsubscribed@talkable.com",
  "campaign_id": "123",
  "email_type": "share_email"
}
```

### Sync loyalty actions

This action automatically synchronizes all loyalty actions performed by loyalty members.

*Default payload:*

```JSON
{
  "site_id": "1",
  "email": "loyalty@talkable.com"
}
```

### Sync loyalty tier transitions

This action automatically synchronizes all tier transitions of loyalty members whenever their tier changes.

*Default payload:*

```JSON
{
  "site_id": "1",
  "email": "loyalty@talkable.com"
}
```

## Testing

Testing Custom app actions can be accomplished with the help of Webhook Tester, an external service that tests your post-receive messages.

1. Visit [Webhook Tester](https://webhook.site/) and click **Copy** to copy the URL you are given.

2. Open your Custom app.

3. Paste your Webhook Tester URL into **Endpoint URL** field and save.

4. Click **Send sample payload** near the action you want to test.

[[Image]](https://docs.talkable.com/_images/send_sample_payload.png.md)

5. After you finish the implementation on your site **change Webhook Tester URL
to the live URL** in your Custom app.

6. Click **Send sample payload** to test action with Live URL.

## Whitelisting Talkable IPs

In case your servers are behind firewall, you may need to whitelist Talkable IP
addresses so webhooks can be delivered. Pass list of these addresses to your network administrator:

| 100.26.94.244<br>18.207.91.200<br>18.210.165.17<br>18.232.203.127<br>18.233.48.151<br>184.73.206.68<br>23.21.155.129 | 3.222.226.72<br>34.197.54.191<br>34.226.253.236<br>34.231.104.179<br>34.232.247.192<br>35.169.186.170<br>35.171.77.58 | 35.173.87.187<br>44.217.136.252<br>44.219.211.174<br>50.16.143.102<br>50.17.244.178<br>52.204.148.18<br>52.22.0.55 | 52.6.41.1<br>52.7.94.243<br>54.164.128.44<br>54.208.14.192<br>54.86.208.153<br>54.86.241.218<br>54.91.51.228 |
| -------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation/dotdigital.md
===============================================================================

# Dotdigital

With the Dotdigital app, clients can synchronize emails and phone numbers that Talkable acquires with their Dotdigital platform. The integration supports:

* Email opt-ins from advocates and friends

* Phone number opt-ins for SMS marketing

* Email unsubscribe management

Here are the conditions when Talkable acquires emails and phone numbers:

1. Advocate signs up and opts in for Talkable marketing emails:

[[Image]](https://docs.talkable.com/_images/signup_advocate.png.md)

2. A friend passes email gating and opts in for Talkable marketing emails:

[[Image]](https://docs.talkable.com/_images/signup_friend.png.md)

3. Phone numbers are captured when users opt in for SMS communications during the referral process.

4. Email unsubscribes are automatically synchronized to ensure compliance with email preferences.

## How to add a new app?

Please use the following guide to start using the Dotdigital app:

1. Navigate into the App store:

[[Image]](https://docs.talkable.com/_images/app_store_step_1.png.md) [[Image]](https://docs.talkable.com/_images/app_store_step_2.png.md)

2. Choose the Dotdigital app by clicking “Install”

3. Fill in all necessary fields. You can use tips on the right that instruct how to find all necessary credentials from your Dotdigital account:

  * API User Email

  * API User Password
> **Note:**
>
> Regional API Endpoint will be filled by Talkable automatically, so it can be left blank.

> **Important:**
>
> When creating an API user, make sure to select “Tiered” for the Rate limiting option.

4. Complete installation and enable the app:

[Image]

Dotdigital application allows data fields to be included with each contact import. By default, Talkable sets the following data fields:

* `FIRSTNAME`

* `LASTNAME`

You can add custom data fields by modifying the payload of an app action.

[[Image]](https://docs.talkable.com/_images/dotdigital_payload.png.md)

Talkable will add a prefix to each custom data field name

```JSON
{
  "FAVORITE_COLOR": "{{ person.custom_properties.favorite_color }}", // Data field as defined in the payload
  "TKBL_FAVORITE_COLOR": "{{ person.custom_properties.favorite_color }}", // Data field sent to Dotdigital
}
```

## About Dotdigital

Dotdigital is a leading customer experience and data platform that helps marketing teams create personalized campaigns across email, SMS, social media, and other channels. With powerful automation tools and comprehensive analytics, Dotdigital enables brands to build lasting customer relationships and drive revenue growth.

For more information about Dotdigital’s features and capabilities, visit [dotdigital.com](https://dotdigital.com/).

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation/emarsys.md
===============================================================================

# Emarsys

Talkable syncs referral opt-ins and contact data into Emarsys — an omnichannel customer engagement platform — so every Advocate and Friend who opts in during a campaign flows into your marketing in real
time.

## What this integration does

Talkable turns referral sign-ups into enriched, segmentable contacts in your ESP —
automatically. The integration:

* **Syncs referral opt-ins** — every Advocate and Friend who opts in during a Talkable
campaign is sent to your ESP as a contact create-or-update, so referral sign-ups grow
your marketable audience in real time.

* **Targets the right list or audience** — each contact is added to the specific list,
audience, or subscription group you choose, so referred customers drop straight into the
right welcome series, nurture flow, or segment.

* **Enriches contacts with referral data** — map Talkable data such as referral and share
counts, advocate status, and campaign details to your ESP’s fields through interpolation
variables, powering referral-based segmentation, triggers, and personalization.

## When opt-ins are synced

An opt-in can happen at two points in a referral — the Advocate’s and the Friend’s —
and Talkable syncs each one to your ESP the instant it happens, so no opted-in contact is
missed or left for a manual export. Here is where that fits in the referral journey:

1. **Advocate opts in.** A customer enters a Talkable campaign (post-purchase, standalone,
floating widget, and so on) and opts in for marketing communications.

2. **Advocate synced** → Talkable sends the advocate’s contact details and opt-in status to
your ESP.

3. **Advocate shares the offer.** They share by email, social, SMS, or a unique link.

4. **Friend opts in.** A friend follows the referral link, enters the campaign, and opts in
to claim the offer.

5. **Friend synced** → Talkable sends the friend’s contact details and opt-in status to your
ESP.

## Segmentation use cases

With referral data flowing into your ESP, you can:

* Build a segment of active advocates (people with one or more successful referrals) for
VIP or loyalty campaigns.

* Trigger a welcome series for friends acquired through a referral.

* Re-engage advocates who have not shared recently.

* Personalize messages with relational details — the person’s name and who referred them —
so referral emails feel personal, not like another generic promo.

## Available data points

You can attach a wide range of Talkable referral data to each contact you sync. The exact
variable names are shown in the product when you configure the integration; at a glance, the
data available includes:

| Data              | What’s included                                                                                                                     |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Contact details   | Email, phone number, and name                                                                                                       |
| Opt-in status     | Email and SMS opt-in state, and when each opt-in happened                                                                           |
| Person profile    | Advocate and loyalty status, when and where they signed up (including location), and any custom properties you pass from your store |
| Referral activity | Referrals made (total, approved, and pending), shares made, and who referred them — by name and email                               |
| Rewards           | The coupon code and reward value the person earned                                                                                  |
| Campaign          | Campaign name, type, tags, and whether it’s active                                                                                  |

## Sample payload

Here is what a referral opt-in looks like when Talkable syncs it to Emarsys — referral
data maps to your Emarsys contact fields:

```json
{
  "key_id": "email",
  "email": "jordan.lee@example.com",
  "first_name": "Jordan",
  "last_name": "Lee",
  "email_optin": true,
  "referrals_total": 7,
  "friends_referred": 5,
  "times_shared": 12,
  "is_advocate": true,
  "referred_by_first_name": "Casey",
  "referred_by_last_name": "Morgan",
  "referred_by_email": "casey.morgan@example.com",
  "reward_coupon_code": "FRIEND25",
  "reward_earned": "$25 account credit",
  "campaign_name": "Spring Referral 2026"
}
```

> **Note:**
>
> Emarsys references each contact field by a numeric ID that is specific to your account.
> Readable names are shown above for clarity.

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation/exponea.md
===============================================================================

# Exponea

Talkable syncs referral opt-ins and contact data into Exponea — a customer data and engagement platform — so every Advocate and Friend who opts in during a campaign flows into your marketing in real
time.

## What this integration does

Talkable turns referral sign-ups into enriched, segmentable contacts in your ESP —
automatically. The integration:

* **Syncs referral opt-ins** — every Advocate and Friend who opts in during a Talkable
campaign is sent to your ESP as a contact create-or-update, so referral sign-ups grow
your marketable audience in real time.

* **Targets the right list or audience** — each contact is added to the specific list,
audience, or subscription group you choose, so referred customers drop straight into the
right welcome series, nurture flow, or segment.

* **Enriches contacts with referral data** — map Talkable data such as referral and share
counts, advocate status, and campaign details to your ESP’s fields through interpolation
variables, powering referral-based segmentation, triggers, and personalization.

## When opt-ins are synced

An opt-in can happen at two points in a referral — the Advocate’s and the Friend’s —
and Talkable syncs each one to your ESP the instant it happens, so no opted-in contact is
missed or left for a manual export. Here is where that fits in the referral journey:

1. **Advocate opts in.** A customer enters a Talkable campaign (post-purchase, standalone,
floating widget, and so on) and opts in for marketing communications.

2. **Advocate synced** → Talkable sends the advocate’s contact details and opt-in status to
your ESP.

3. **Advocate shares the offer.** They share by email, social, SMS, or a unique link.

4. **Friend opts in.** A friend follows the referral link, enters the campaign, and opts in
to claim the offer.

5. **Friend synced** → Talkable sends the friend’s contact details and opt-in status to your
ESP.

## Segmentation use cases

With referral data flowing into your ESP, you can:

* Build a segment of active advocates (people with one or more successful referrals) for
VIP or loyalty campaigns.

* Trigger a welcome series for friends acquired through a referral.

* Re-engage advocates who have not shared recently.

* Personalize messages with relational details — the person’s name and who referred them —
so referral emails feel personal, not like another generic promo.

## Available data points

You can attach a wide range of Talkable referral data to each contact you sync. The exact
variable names are shown in the product when you configure the integration; at a glance, the
data available includes:

| Data              | What’s included                                                                                                                     |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Contact details   | Email, phone number, and name                                                                                                       |
| Opt-in status     | Email and SMS opt-in state, and when each opt-in happened                                                                           |
| Person profile    | Advocate and loyalty status, when and where they signed up (including location), and any custom properties you pass from your store |
| Referral activity | Referrals made (total, approved, and pending), shares made, and who referred them — by name and email                               |
| Rewards           | The coupon code and reward value the person earned                                                                                  |
| Campaign          | Campaign name, type, tags, and whether it’s active                                                                                  |

## Sample payload

When a referred customer opts in, Talkable sends their email and marketing consent to
Exponea:

```json
{
  "email": "jordan.lee@example.com",
  "consent": { "category": "email", "action": "accept" }
}
```


## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation/getresponse.md
===============================================================================

# GetResponse

Talkable syncs referral opt-ins and contact data into GetResponse — an email marketing and automation platform — so every Advocate and Friend who opts in during a campaign flows into your marketing in real
time.

## What this integration does

Talkable turns referral sign-ups into enriched, segmentable contacts in your ESP —
automatically. The integration:

* **Syncs referral opt-ins** — every Advocate and Friend who opts in during a Talkable
campaign is sent to your ESP as a contact create-or-update, so referral sign-ups grow
your marketable audience in real time.

* **Targets the right list or audience** — each contact is added to the specific list,
audience, or subscription group you choose, so referred customers drop straight into the
right welcome series, nurture flow, or segment.

* **Enriches contacts with referral data** — map Talkable data such as referral and share
counts, advocate status, and campaign details to your ESP’s fields through interpolation
variables, powering referral-based segmentation, triggers, and personalization.

## When opt-ins are synced

An opt-in can happen at two points in a referral — the Advocate’s and the Friend’s —
and Talkable syncs each one to your ESP the instant it happens, so no opted-in contact is
missed or left for a manual export. Here is where that fits in the referral journey:

1. **Advocate opts in.** A customer enters a Talkable campaign (post-purchase, standalone,
floating widget, and so on) and opts in for marketing communications.

2. **Advocate synced** → Talkable sends the advocate’s contact details and opt-in status to
your ESP.

3. **Advocate shares the offer.** They share by email, social, SMS, or a unique link.

4. **Friend opts in.** A friend follows the referral link, enters the campaign, and opts in
to claim the offer.

5. **Friend synced** → Talkable sends the friend’s contact details and opt-in status to your
ESP.

## Segmentation use cases

With referral data flowing into your ESP, you can:

* Build a segment of active advocates (people with one or more successful referrals) for
VIP or loyalty campaigns.

* Trigger a welcome series for friends acquired through a referral.

* Re-engage advocates who have not shared recently.

* Personalize messages with relational details — the person’s name and who referred them —
so referral emails feel personal, not like another generic promo.

## Available data points

You can attach a wide range of Talkable referral data to each contact you sync. The exact
variable names are shown in the product when you configure the integration; at a glance, the
data available includes:

| Data              | What’s included                                                                                                                     |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Contact details   | Email, phone number, and name                                                                                                       |
| Opt-in status     | Email and SMS opt-in state, and when each opt-in happened                                                                           |
| Person profile    | Advocate and loyalty status, when and where they signed up (including location), and any custom properties you pass from your store |
| Referral activity | Referrals made (total, approved, and pending), shares made, and who referred them — by name and email                               |
| Rewards           | The coupon code and reward value the person earned                                                                                  |
| Campaign          | Campaign name, type, tags, and whether it’s active                                                                                  |

## Sample payload

Here is what a referral opt-in looks like when Talkable syncs it to GetResponse — referral
data maps to your GetResponse custom fields:

```json
{
  "email": "jordan.lee@example.com",
  "name": "Jordan Lee",
  "campaign": { "campaignId": "your_list" },
  "customFieldValues": [
    { "customFieldId": "referrals_total", "value": ["7"] },
    { "customFieldId": "friends_referred", "value": ["5"] },
    { "customFieldId": "times_shared", "value": ["12"] },
    { "customFieldId": "is_advocate", "value": ["true"] },
    { "customFieldId": "referred_by_first_name", "value": ["Casey"] },
    { "customFieldId": "referred_by_last_name", "value": ["Morgan"] },
    { "customFieldId": "referred_by_email", "value": ["casey.morgan@example.com"] },
    { "customFieldId": "reward_coupon_code", "value": ["FRIEND25"] },
    { "customFieldId": "reward_earned", "value": ["$25 account credit"] },
    { "customFieldId": "campaign_name", "value": ["Spring Referral 2026"] }
  ]
}
```

> **Note:**
>
> GetResponse references each custom field by an ID that is specific to your account.
> Readable names are shown above for clarity.

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation/hubspot.md
===============================================================================

# Hubspot

With ESP apps clients can synchronize emails that Talkable acquires with their ESP. Here are the conditions when Talkable acquires emails:

1. Advocate signs up and opts in for Talkable marketing emails:

[[Image]](https://docs.talkable.com/_images/signup_advocate.png.md)

2. A friend passes email gating and opts in for Talkable marketing emails:

[[Image]](https://docs.talkable.com/_images/signup_friend.png.md)

Each ESP application allows custom attributes to be included with each request. The following interpolation variables are allowed:

1. `{{ person }}` - a data object for either advocate or friend whenever they sign up or pass email gating and opt-in for marketing emails.

2. `{{ ip }}` – a data object from which IP address either a signup or email gating occurred.

3. `{{ campaign }}` – a data object with details about the campaign within which the email was captured.

[[Image]](https://docs.talkable.com/_images/variables.png.md)

Each variable is described in the “Available variables” sidebar and can be expanded to see all nested properties.

## How to add a new app?

Please use the following guide to start using an app you need:

1. Navigate into the App store:

[[Image]](https://docs.talkable.com/_images/app_store_step_1.png.md) [[Image]](https://docs.talkable.com/_images/app_store_step_2.png.md)

2. Choose an app you need by clicking “Install”

3. Fill in all necessary fields. You can use tips on the right that instruct how to find all necessary credentials.

4. Complete installation and enable the app:

[Image]

5. Test the app by pressing on the “Send sample payload” and then check if you are seeing a test request inside your ESP:

[[Image]](https://docs.talkable.com/_images/send_sample_payload.png.md)

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation/iterable.md
===============================================================================

# Iterable

Talkable syncs referral opt-ins and contact data into Iterable — a cross-channel marketing platform — so every Advocate and Friend who opts in during a campaign flows into your marketing in real
time.

## What this integration does

Talkable turns referral sign-ups into enriched, segmentable contacts in your ESP —
automatically. The integration:

* **Syncs referral opt-ins** — every Advocate and Friend who opts in during a Talkable
campaign is sent to your ESP as a contact create-or-update, so referral sign-ups grow
your marketable audience in real time.

* **Targets the right list or audience** — each contact is added to the specific list,
audience, or subscription group you choose, so referred customers drop straight into the
right welcome series, nurture flow, or segment.

* **Enriches contacts with referral data** — map Talkable data such as referral and share
counts, advocate status, and campaign details to your ESP’s fields through interpolation
variables, powering referral-based segmentation, triggers, and personalization.

## When opt-ins are synced

An opt-in can happen at two points in a referral — the Advocate’s and the Friend’s —
and Talkable syncs each one to your ESP the instant it happens, so no opted-in contact is
missed or left for a manual export. Here is where that fits in the referral journey:

1. **Advocate opts in.** A customer enters a Talkable campaign (post-purchase, standalone,
floating widget, and so on) and opts in for marketing communications.

2. **Advocate synced** → Talkable sends the advocate’s contact details and opt-in status to
your ESP.

3. **Advocate shares the offer.** They share by email, social, SMS, or a unique link.

4. **Friend opts in.** A friend follows the referral link, enters the campaign, and opts in
to claim the offer.

5. **Friend synced** → Talkable sends the friend’s contact details and opt-in status to your
ESP.

## Segmentation use cases

With referral data flowing into your ESP, you can:

* Build a segment of active advocates (people with one or more successful referrals) for
VIP or loyalty campaigns.

* Trigger a welcome series for friends acquired through a referral.

* Re-engage advocates who have not shared recently.

* Personalize messages with relational details — the person’s name and who referred them —
so referral emails feel personal, not like another generic promo.

## Available data points

You can attach a wide range of Talkable referral data to each contact you sync. The exact
variable names are shown in the product when you configure the integration; at a glance, the
data available includes:

| Data              | What’s included                                                                                                                     |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Contact details   | Email, phone number, and name                                                                                                       |
| Opt-in status     | Email and SMS opt-in state, and when each opt-in happened                                                                           |
| Person profile    | Advocate and loyalty status, when and where they signed up (including location), and any custom properties you pass from your store |
| Referral activity | Referrals made (total, approved, and pending), shares made, and who referred them — by name and email                               |
| Rewards           | The coupon code and reward value the person earned                                                                                  |
| Campaign          | Campaign name, type, tags, and whether it’s active                                                                                  |

## Sample payload

Here is what a referral opt-in looks like when Talkable syncs it to Iterable — referral
data lands in the contact’s `dataFields`, ready to use in lists and journeys:

```json
{
  "listId": 482913,
  "subscribers": [
    {
      "email": "jordan.lee@example.com",
      "dataFields": {
        "first_name": "Jordan",
        "last_name": "Lee",
        "email_optin": true,
        "referrals_total": 7,
        "friends_referred": 5,
        "times_shared": 12,
        "is_advocate": true,
        "referred_by_first_name": "Casey",
        "referred_by_last_name": "Morgan",
        "referred_by_email": "casey.morgan@example.com",
        "reward_coupon_code": "FRIEND25",
        "reward_earned": "$25 account credit",
        "campaign_name": "Spring Referral 2026"
      }
    }
  ]
}
```


## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation/klaviyo.md
===============================================================================

# Klaviyo

With ESP apps clients can synchronize emails that Talkable acquires with their ESP. Here are the conditions when Talkable acquires emails:

1. Advocate signs up and opts in for Talkable marketing emails:

[[Image]](https://docs.talkable.com/_images/signup_advocate.png.md)

2. A friend passes email gating and opts in for Talkable marketing emails:

[[Image]](https://docs.talkable.com/_images/signup_friend.png.md)

Each ESP application allows custom attributes to be included with each request. The following interpolation variables are allowed:

1. `{{ person }}` - a data object for either advocate or friend whenever they sign up or pass email gating and opt-in for marketing emails.

2. `{{ ip }}` – a data object from which IP address either a signup or email gating occurred.

3. `{{ campaign }}` – a data object with details about the campaign within which the email was captured.

[[Image]](https://docs.talkable.com/_images/variables.png.md)

Each variable is described in the “Available variables” sidebar and can be expanded to see all nested properties.

## How to add a new app?

Please use the following guide to start using an app you need:

1. Navigate into the App store:

[[Image]](https://docs.talkable.com/_images/app_store_step_1.png.md) [[Image]](https://docs.talkable.com/_images/app_store_step_2.png.md)

2. Choose an app you need by clicking “Install”

3. Confirm the app installation in Klaviyo

4. Complete installation in Talkable and enable the app:

[Image]

5. Test the app by pressing on the “Send sample payload” and then check if you are seeing a test request inside your ESP:

[[Image]](https://docs.talkable.com/_images/send_sample_payload.png.md)

## Talkable profile properties

Every time a Talkable event reaches Klaviyo, Talkable adds extra information about the person to their Klaviyo profile —
things like how many friends they’ve referred, whether they’ve shared an offer, and which campaign brought them in.
This happens automatically, on top of the standard fields (email, first name, phone, etc.) you see under **Payload attributes** in each action.

You can use these properties in Klaviyo to build segments, trigger flows, and personalize emails — for example,
send a thank-you email to advocates with three or more approved referrals, or greet a referred customer
with a “your friend just signed up” message.

Which profiles get updated, by action:

* **Sync email opt-ins** / **Sync phone opt-ins** — the person who just opted in.

* **Track offer shares** — the advocate who shared their offer.

* **Track referral approvals** — both the friend (the new customer) and the advocate who referred them.
The friend’s profile gets the advocate’s email saved on `talkable_referred_by_email`,
which is how the *Talkable Referred Customers* segment finds them.

* **Track reward issued** — the person receiving the reward.

* **Sync loyalty actions** / **Sync loyalty tier transitions** — the loyalty member.

| Property                           | Value        | What it means                                                                                                  |
| ---------------------------------- | ------------ | -------------------------------------------------------------------------------------------------------------- |
| `talkable_advocate`                | true / false | Whether this person has received at least one Talkable referral offer (i.e. has ever been an advocate).        |
| `talkable_referral_count_total`    | Number       | Total number of friends this person has referred, regardless of status.                                        |
| `talkable_referral_count_approved` | Number       | Number of this person’s referrals that have been approved (rewards earned).                                    |
| `talkable_referral_count_pending`  | Number       | Number of this person’s referrals still awaiting approval.                                                     |
| `talkable_shares_count`            | Number       | How many times this person has shared their offer across all channels (email, SMS, Facebook, copy link, etc.). |
| `talkable_referred_by_email`       | Email        | The advocate’s email — set only on friends who came in through a referral.                                     |
| `talkable_referred_by_first_name`  | Text         | The advocate’s first name — set only on friends who came in through a referral.                                |
| `talkable_referred_by_last_name`   | Text         | The advocate’s last name — set only on friends who came in through a referral.                                 |
| `talkable_latest_offer_date`       | Date         | Date of the most recent Talkable referral offer this person received.                                          |
| `talkable_loyalty_member`          | true / false | Whether this person is enrolled in your Talkable loyalty program.                                              |
| `talkable_campaign_name`           | Text         | Name of the Talkable campaign that drove the current event.                                                    |
| `talkable_campaign_tags`           | List of tags | Tags assigned to the Talkable campaign that drove the current event.                                           |

If a property doesn’t apply to someone (for example, `talkable_referred_by_email` for a person who signed up directly),
it’s simply left off — Klaviyo will treat it as “not set” in segment conditions.

## Segments

When the Klaviyo app is installed, Talkable creates a set of starter segments built on top of the
profile properties above. You can find them in Klaviyo under **Audience → Lists & Segments**.

Segment creation requires the `segments:read` and `segments:write` OAuth scopes. Klaviyo
includes them in the consent screen when you install the app, and its consent is all-or-nothing —
you can’t approve some scopes and decline others — so a fresh install grants these automatically.

If your installation predates Talkable’s segments feature and you haven’t reauthorized the app
since, the stored grant won’t include the segment scopes and Talkable will quietly skip segment
creation. Reinstall the app from the Talkable App Store (look for the **Reinstall** badge) to pick
up the new scopes; the segments will be created right after that to preserve the app activation status.

The segment-creation step runs on each **app activation** — fresh install, reinstall, or toggling
the app off and back on. On every run, Talkable looks up Klaviyo segments by their original
Talkable names:

* If a matching name exists, Talkable leaves the segment untouched — **editing the conditions** of a Talkable segment is safe; your edits won’t be overwritten.

* If a matching name is missing, Talkable creates a fresh segment with that name and the default
conditions. **Renaming** a Talkable segment causes Talkable to recreate the original on the next
activation (your renamed copy stays alongside it); **deleting** one means it reappears on the
next activation.

To customize a Talkable segment safely, edit its conditions in place rather than renaming or
deleting it. If you need a meaningfully different segment, build it as a separate segment in
Klaviyo.

| Segment                            | Conditions (joined with AND)                                                                                                                                                                                               |
| ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Talkable Opted In Never Shared** | `talkable_advocate` equals `true` AND `talkable_shares_count` equals `0`. Advocates who opted in but never shared their offer — good candidates for a nudge.                                                               |
| **Talkable High-Value Advocates**  | `talkable_referral_count_approved` is at least `3`. Your top referrers — use for VIP treatment, ambassador invites, or special rewards.                                                                                    |
| **Talkable Referred Customers**    | `talkable_referred_by_email` is set. People who came in through a referral — useful for welcome flows that acknowledge the advocate.                                                                                       |
| **Talkable Lapsed Advocates**      | `talkable_advocate` equals `true` AND `talkable_shares_count` is greater than `0` AND `talkable_latest_offer_date` is at least `30` days ago. Previously-engaged advocates who’ve gone quiet — target with win-back flows. |

## Metrics

Talkable fires Klaviyo **metric events** for the most important moments in a referral lifecycle.
Each event becomes a trigger you can use to start a Klaviyo Flow — welcome series, thank-you emails,
reward notifications, and so on.

The following metric events are sent when the corresponding action is enabled:

| Metric name                    | Triggered by                        | Profile that receives the event                                                                                      |
| ------------------------------ | ----------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| **Talkable Email Opted In**    | Sync email opt-ins                  | The opted-in person                                                                                                  |
| **Talkable Phone Opted In**    | Sync phone opt-ins                  | The opted-in person                                                                                                  |
| **Talkable Offer Shared**      | Track offer shares in Klaviyo       | The advocate who shared                                                                                              |
| **Talkable Referral Approved** | Track referral approvals in Klaviyo | The advocate (the friend’s profile is updated separately so the *Talkable Referred Customers* segment picks them up) |
| **Talkable Reward Issued**     | Track reward issued in Klaviyo      | The reward recipient                                                                                                 |

The **Sync loyalty actions** and **Sync loyalty tier transitions** actions also generate metric
events. Their metric names come from the `metric_name` payload attribute
(defaults: `loyalty_action_performed` and `loyalty_tier_transitioned`), so you can rename them
or split them across multiple metrics by editing the payload.

### Metric event properties

Every metric event carries two layers of data:

1. **Profile properties** — all the `talkable_*` properties listed in *Talkable profile properties* above are attached to the recipient’s profile alongside the event. Use them as Flow filters or
reference them in the email body as `{{ person.talkable_referral_count_approved }}`.

2. **Event properties** — whatever you’ve configured in the action’s **Payload attributes** panel
(minus `email` and `metric_name`, which Klaviyo handles specially) ends up here. By default
the track-* actions send only the recipient’s email, so the event properties bag is empty until
you add custom attributes.

### Viewing and filtering metrics in Analytics

Open **Analytics → Metrics** in Klaviyo and pick any Talkable metric (for example, *Talkable Referral Approved*) to see an over-time chart of event volume. From the chart’s controls
you can:

* **Filter (Where)** — restrict the chart to events whose property matches a specific value
(for example, only events where `campaign_name` equals `"Holiday 2025"`).

* **Group by (By)** — break the chart into one line per property value (for example, group *Talkable Offer Shared* by `channel` to compare email, SMS, and Facebook shares side by side).

Any custom attribute you add to the action’s payload becomes available as a filter/group-by option
on its metric. For richer analysis, build a **Custom Report** under **Analytics → Custom Reports** —
single-metric Deep Dive reports support property filters and grouping, while multi-metric reports do
not (each metric has its own property schema).

### Using event properties in email bodies

In a Flow triggered by a Talkable metric, event properties are available in the email template as `{{ event.<property_name> }}` — for example, `{{ event.first_name }}` or `{{ event.custom_source }}`.

Tags are **case-sensitive** and must match the exact key you set on the payload. The easiest way
to get the right tag is to open the email’s **Preview** pane in Klaviyo, find the property in the
event preview, and click it — Klaviyo copies the exact tag to your clipboard.

For property names containing spaces or punctuation (for example `Accepts Marketing`), use
Klaviyo’s `lookup` filter — see the [Klaviyo personalization reference](https://help.klaviyo.com/hc/en-us/articles/4408802648731).
To keep templates simple, prefer `snake_case` keys for any custom payload attributes you add.

Event properties can only be used in **metric-triggered** Flow emails. They are not available in
campaigns or in Flows triggered by list membership or by profile-property changes — for those, rely
on the profile-properties layer instead.

## Customizing the payload

Each action has a **Payload attributes** panel where you can add custom key/value pairs. Values
support Liquid templating against the action’s context — the **Available variables** sidebar shows
what’s accessible (for example, `{{ person }}` on opt-in actions, `{{ sharer }}` on offer
shares, `{{ advocate_person }}` on referral approvals).

Where those attributes land in Klaviyo depends on the action type:

* **Opt-in actions** (*Sync email opt-ins*, *Sync phone opt-ins*) — the payload feeds two places
at once:

  * The person’s **Klaviyo profile** is created or updated with these attributes. Keys that match
standard Klaviyo profile fields (`email`, `phone_number`, `external_id`, `first_name`, `last_name`, `organization`, `title`, `image`, `location`) are mapped to those
built-in fields; any other key becomes a **custom profile property** on the person.

  * The same attributes are attached to the **metric event** as event properties, so they’re
available in Flow emails as `{{ event.<key> }}`.

* **Track actions** (*Track offer shares in Klaviyo*, *Track referral approvals in Klaviyo*, *Track reward issued in Klaviyo*) — the payload feeds **only** the metric event as event
properties. The recipient’s profile is *not* updated from this payload (Talkable still attaches
the `talkable_*` profile properties to the event alongside it). Use these actions to enrich
Flow emails with reward, share, or referral details that are specific to one event and don’t
need to live on the profile permanently.

* **Loyalty actions** (*Sync loyalty actions*, *Sync loyalty tier transitions*) — the payload
feeds the metric event as event properties. The `metric_name` key in the payload controls the **name of the Klaviyo metric itself**; override it to route different loyalty events to different
metrics (and different Flows).

A few rules of thumb when designing custom payloads:

* **Avoid the talkable_ prefix** for your own keys. Names starting with `talkable_` are managed
automatically by Talkable and will be overwritten on the next event.

* **Prefer snake_case keys** — they’re easier to reference in email templates as `{{ event.order_total }}` than `Order Total` is via the `lookup` filter.

* **Empty Liquid renders drop the key.** If a variable can’t be resolved for a given event
(for example, `{{ purchase.subtotal }}` on an opt-in that wasn’t tied to a purchase), Talkable
omits the attribute from the request rather than sending an empty string — so your Klaviyo
profile and metric event stay free of blank values.

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation/listrak.md
===============================================================================

# Listrak

## Overview

Talkable offers seamless integration with Listrak to enhance your marketing and communication efforts by synchronizing email and phone number data. With ESP apps clients can synchronize emails that Talkable acquires with their ESP.

This integration is divided into two components:

1. **Listrak Email Marketing** Talkable synchronizes all people who opt in for Talkable email marketing during sign-up, ensuring all your emails are stored in one place in an automated way.

2. **Listrak SMS** Talkable syncs phone numbers to Listrak and enables the setup of reward SMS messages for campaigns, enhancing customer engagement through direct messaging.

Here are the conditions when Talkable acquires emails and phone numbers:

1. Advocate signs up and opts in for Talkable marketing emails:

[[Image]](https://docs.talkable.com/_images/signup_advocate.png.md)

2. A friend passes email gating and opts in for Talkable marketing emails:

[[Image]](https://docs.talkable.com/_images/signup_friend.png.md)

## Available Data Fields

Each ESP application allows custom attributes to be included with each request. The following interpolation variables are allowed:

1. `{{ person }}` - a data object for either advocate or friend whenever they sign up or pass email gating and opt-in for marketing emails

2. `{{ ip }}` - a data object from which IP address either a signup or email gating occurred

3. `{{ campaign }}` - a data object with details about the campaign within which the email was captured

[[Image]](https://docs.talkable.com/_images/variables.png.md)

Each variable is described in the “Available variables” sidebar and can be expanded to see all nested properties.

## How to Set Up

Please use the following guide to start using the Listrak app:

1. Navigate into the App store:

[[Image]](https://docs.talkable.com/_images/app_store_step_1.png.md) [[Image]](https://docs.talkable.com/_images/app_store_step_2.png.md)

2. Choose the Listrak app and click “Install”

3. Fill in all necessary fields. You can use tips on the right that instruct how to find all necessary credentials.

4. Complete installation in Talkable and enable the app:

[Image]

5. Test the app by pressing “Send sample payload” and then check if you are seeing a test request inside your Listrak:

[[Image]](https://docs.talkable.com/_images/send_sample_payload.png.md)

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation/mailchimp.md
===============================================================================

# Mailchimp

With ESP apps clients can synchronize emails that Talkable acquires with their ESP. Here are the conditions when Talkable acquires emails:

1. Advocate signs up and opts in for Talkable marketing emails:

[[Image]](https://docs.talkable.com/_images/signup_advocate.png.md)

2. A friend passes email gating and opts in for Talkable marketing emails:

[[Image]](https://docs.talkable.com/_images/signup_friend.png.md)

Each ESP application allows custom attributes to be included with each request. The following interpolation variables are allowed:

1. `{{ person }}` - a data object for either advocate or friend whenever they sign up or pass email gating and opt-in for marketing emails.

2. `{{ ip }}` – a data object from which IP address either a signup or email gating occurred.

3. `{{ campaign }}` – a data object with details about the campaign within which the email was captured.

[[Image]](https://docs.talkable.com/_images/variables.png.md)

Each variable is described in the “Available variables” sidebar and can be expanded to see all nested properties.

## How to add a new app?

Please use the following guide to start using an app you need:

1. Navigate into the App store:

[[Image]](https://docs.talkable.com/_images/app_store_step_1.png.md) [[Image]](https://docs.talkable.com/_images/app_store_step_2.png.md)

2. Choose an app you need by clicking “Install”

3. Fill in all necessary fields. You can use tips on the right that instruct how to find all necessary credentials.

4. Complete installation and enable the app:

[Image]

5. Test the app by pressing on the “Send sample payload” and then check if you are seeing a test request inside your ESP:

[[Image]](https://docs.talkable.com/_images/send_sample_payload.png.md)

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation/ometria.md
===============================================================================

# Ometria

Talkable syncs referral opt-ins and contact data into Ometria — a retail customer data and marketing platform — so every Advocate and Friend who opts in during a campaign flows into your marketing in real
time.

## What this integration does

Talkable turns referral sign-ups into enriched, segmentable contacts in your ESP —
automatically. The integration:

* **Syncs referral opt-ins** — every Advocate and Friend who opts in during a Talkable
campaign is sent to your ESP as a contact create-or-update, so referral sign-ups grow
your marketable audience in real time.

* **Targets the right list or audience** — each contact is added to the specific list,
audience, or subscription group you choose, so referred customers drop straight into the
right welcome series, nurture flow, or segment.

* **Enriches contacts with referral data** — map Talkable data such as referral and share
counts, advocate status, and campaign details to your ESP’s fields through interpolation
variables, powering referral-based segmentation, triggers, and personalization.

## When opt-ins are synced

An opt-in can happen at two points in a referral — the Advocate’s and the Friend’s —
and Talkable syncs each one to your ESP the instant it happens, so no opted-in contact is
missed or left for a manual export. Here is where that fits in the referral journey:

1. **Advocate opts in.** A customer enters a Talkable campaign (post-purchase, standalone,
floating widget, and so on) and opts in for marketing communications.

2. **Advocate synced** → Talkable sends the advocate’s contact details and opt-in status to
your ESP.

3. **Advocate shares the offer.** They share by email, social, SMS, or a unique link.

4. **Friend opts in.** A friend follows the referral link, enters the campaign, and opts in
to claim the offer.

5. **Friend synced** → Talkable sends the friend’s contact details and opt-in status to your
ESP.

## Segmentation use cases

With referral data flowing into your ESP, you can:

* Build a segment of active advocates (people with one or more successful referrals) for
VIP or loyalty campaigns.

* Trigger a welcome series for friends acquired through a referral.

* Re-engage advocates who have not shared recently.

* Personalize messages with relational details — the person’s name and who referred them —
so referral emails feel personal, not like another generic promo.

## Available data points

You can attach a wide range of Talkable referral data to each contact you sync. The exact
variable names are shown in the product when you configure the integration; at a glance, the
data available includes:

| Data              | What’s included                                                                                                                     |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Contact details   | Email, phone number, and name                                                                                                       |
| Opt-in status     | Email and SMS opt-in state, and when each opt-in happened                                                                           |
| Person profile    | Advocate and loyalty status, when and where they signed up (including location), and any custom properties you pass from your store |
| Referral activity | Referrals made (total, approved, and pending), shares made, and who referred them — by name and email                               |
| Rewards           | The coupon code and reward value the person earned                                                                                  |
| Campaign          | Campaign name, type, tags, and whether it’s active                                                                                  |

## Sample payload

Here is what a referral opt-in looks like when Talkable syncs it to Ometria — including
phone, opt-in status, list, and referral data in `properties`:

```json
[
  {
    "@type": "contact",
    "id": "cust_7898734",
    "email": "jordan.lee@example.com",
    "firstname": "Jordan",
    "lastname": "Lee",
    "phone_number": "+12025551111",
    "marketing_optin": "EXPLICITLY_OPTEDIN",
    "@add_to_lists": [482913],
    "properties": {
      "referrals_total": 7,
      "friends_referred": 5,
      "times_shared": 12,
      "is_advocate": true,
      "referred_by_first_name": "Casey",
      "referred_by_last_name": "Morgan",
      "referred_by_email": "casey.morgan@example.com",
      "reward_coupon_code": "FRIEND25",
      "reward_earned": "$25 account credit",
      "campaign_name": "Spring Referral 2026"
    }
  }
]
```


## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation/omnisend.md
===============================================================================

# Omnisend

Talkable syncs referral opt-ins and contact data into Omnisend — an ecommerce email and SMS marketing platform — so every Advocate and Friend who opts in during a campaign flows into your marketing in real
time.

## What this integration does

Talkable turns referral sign-ups into enriched, segmentable contacts in your ESP —
automatically. The integration:

* **Syncs referral opt-ins** — every Advocate and Friend who opts in during a Talkable
campaign is sent to your ESP as a contact create-or-update, so referral sign-ups grow
your marketable audience in real time.

* **Targets the right list or audience** — each contact is added to the specific list,
audience, or subscription group you choose, so referred customers drop straight into the
right welcome series, nurture flow, or segment.

* **Enriches contacts with referral data** — map Talkable data such as referral and share
counts, advocate status, and campaign details to your ESP’s fields through interpolation
variables, powering referral-based segmentation, triggers, and personalization.

## When opt-ins are synced

An opt-in can happen at two points in a referral — the Advocate’s and the Friend’s —
and Talkable syncs each one to your ESP the instant it happens, so no opted-in contact is
missed or left for a manual export. Here is where that fits in the referral journey:

1. **Advocate opts in.** A customer enters a Talkable campaign (post-purchase, standalone,
floating widget, and so on) and opts in for marketing communications.

2. **Advocate synced** → Talkable sends the advocate’s contact details and opt-in status to
your ESP.

3. **Advocate shares the offer.** They share by email, social, SMS, or a unique link.

4. **Friend opts in.** A friend follows the referral link, enters the campaign, and opts in
to claim the offer.

5. **Friend synced** → Talkable sends the friend’s contact details and opt-in status to your
ESP.

## Segmentation use cases

With referral data flowing into your ESP, you can:

* Build a segment of active advocates (people with one or more successful referrals) for
VIP or loyalty campaigns.

* Trigger a welcome series for friends acquired through a referral.

* Re-engage advocates who have not shared recently.

* Personalize messages with relational details — the person’s name and who referred them —
so referral emails feel personal, not like another generic promo.

## Available data points

You can attach a wide range of Talkable referral data to each contact you sync. The exact
variable names are shown in the product when you configure the integration; at a glance, the
data available includes:

| Data              | What’s included                                                                                                                     |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Contact details   | Email, phone number, and name                                                                                                       |
| Opt-in status     | Email and SMS opt-in state, and when each opt-in happened                                                                           |
| Person profile    | Advocate and loyalty status, when and where they signed up (including location), and any custom properties you pass from your store |
| Referral activity | Referrals made (total, approved, and pending), shares made, and who referred them — by name and email                               |
| Rewards           | The coupon code and reward value the person earned                                                                                  |
| Campaign          | Campaign name, type, tags, and whether it’s active                                                                                  |

## Sample payload

Here is what a referral opt-in looks like when Talkable syncs it to Omnisend — referral
data lands in `customProperties`, ready for segments and automations:

```json
{
  "identifiers": [
    {
      "id": "jordan.lee@example.com",
      "type": "email",
      "channels": { "email": { "status": "subscribed" } }
    }
  ],
  "firstName": "Jordan",
  "lastName": "Lee",
  "tags": ["referral-advocate"],
  "customProperties": {
    "referrals_total": 7,
    "friends_referred": 5,
    "times_shared": 12,
    "is_advocate": true,
    "referred_by_first_name": "Casey",
    "referred_by_last_name": "Morgan",
    "referred_by_email": "casey.morgan@example.com",
    "reward_coupon_code": "FRIEND25",
    "reward_earned": "$25 account credit",
    "campaign_name": "Spring Referral 2026"
  }
}
```


## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation/oracle_bronto.md
===============================================================================

# Oracle Bronto

With ESP apps clients can synchronize emails that Talkable acquires with their ESP. Here are the conditions when Talkable acquires emails:

1. Advocate signs up and opts in for Talkable marketing emails:

[[Image]](https://docs.talkable.com/_images/signup_advocate.png.md)

2. A friend passes email gating and opts in for Talkable marketing emails:

[[Image]](https://docs.talkable.com/_images/signup_friend.png.md)

Each ESP application allows custom attributes to be included with each request. The following interpolation variables are allowed:

1. `{{ person }}` - a data object for either advocate or friend whenever they sign up or pass email gating and opt-in for marketing emails.

2. `{{ ip }}` – a data object from which IP address either a signup or email gating occurred.

3. `{{ campaign }}` – a data object with details about the campaign within which the email was captured.

[[Image]](https://docs.talkable.com/_images/variables.png.md)

Each variable is described in the “Available variables” sidebar and can be expanded to see all nested properties.

## How to add a new app?

Please use the following guide to start using an app you need:

1. Navigate into the App store:

[[Image]](https://docs.talkable.com/_images/app_store_step_1.png.md) [[Image]](https://docs.talkable.com/_images/app_store_step_2.png.md)

2. Choose an app you need by clicking “Install”

3. Fill in all necessary fields. You can use tips on the right that instruct how to find all necessary credentials.

4. Complete installation and enable the app:

[Image]

5. Test the app by pressing on the “Send sample payload” and then check if you are seeing a test request inside your ESP:

[[Image]](https://docs.talkable.com/_images/send_sample_payload.png.md)

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation/sailthru.md
===============================================================================

# Sailthru

With ESP apps clients can synchronize emails that Talkable acquires with their ESP. Here are the conditions when Talkable acquires emails:

1. Advocate signs up and opts in for Talkable marketing emails:

[[Image]](https://docs.talkable.com/_images/signup_advocate.png.md)

2. A friend passes email gating and opts in for Talkable marketing emails:

[[Image]](https://docs.talkable.com/_images/signup_friend.png.md)

Each ESP application allows custom attributes to be included with each request. The following interpolation variables are allowed:

1. `{{ person }}` - a data object for either advocate or friend whenever they sign up or pass email gating and opt-in for marketing emails.

2. `{{ ip }}` – a data object from which IP address either a signup or email gating occurred.

3. `{{ campaign }}` – a data object with details about the campaign within which the email was captured.

[[Image]](https://docs.talkable.com/_images/variables.png.md)

Each variable is described in the “Available variables” sidebar and can be expanded to see all nested properties.

## How to add a new app?

Please use the following guide to start using an app you need:

1. Navigate into the App store:

[[Image]](https://docs.talkable.com/_images/app_store_step_1.png.md) [[Image]](https://docs.talkable.com/_images/app_store_step_2.png.md)

2. Choose an app you need by clicking “Install”

3. Fill in all necessary fields. You can use tips on the right that instruct how to find all necessary credentials.

4. Complete installation and enable the app:

[Image]

5. Test the app by pressing on the “Send sample payload” and then check if you are seeing a test request inside your ESP:

[[Image]](https://docs.talkable.com/_images/send_sample_payload.png.md)

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation/sendgrid.md
===============================================================================

# SendGrid

Talkable syncs referral opt-ins and contact data into SendGrid — an email delivery and marketing platform — so every Advocate and Friend who opts in during a campaign flows into your marketing in real
time.

## What this integration does

Talkable turns referral sign-ups into enriched, segmentable contacts in your ESP —
automatically. The integration:

* **Syncs referral opt-ins** — every Advocate and Friend who opts in during a Talkable
campaign is sent to your ESP as a contact create-or-update, so referral sign-ups grow
your marketable audience in real time.

* **Targets the right list or audience** — each contact is added to the specific list,
audience, or subscription group you choose, so referred customers drop straight into the
right welcome series, nurture flow, or segment.

* **Enriches contacts with referral data** — map Talkable data such as referral and share
counts, advocate status, and campaign details to your ESP’s fields through interpolation
variables, powering referral-based segmentation, triggers, and personalization.

## When opt-ins are synced

An opt-in can happen at two points in a referral — the Advocate’s and the Friend’s —
and Talkable syncs each one to your ESP the instant it happens, so no opted-in contact is
missed or left for a manual export. Here is where that fits in the referral journey:

1. **Advocate opts in.** A customer enters a Talkable campaign (post-purchase, standalone,
floating widget, and so on) and opts in for marketing communications.

2. **Advocate synced** → Talkable sends the advocate’s contact details and opt-in status to
your ESP.

3. **Advocate shares the offer.** They share by email, social, SMS, or a unique link.

4. **Friend opts in.** A friend follows the referral link, enters the campaign, and opts in
to claim the offer.

5. **Friend synced** → Talkable sends the friend’s contact details and opt-in status to your
ESP.

## Segmentation use cases

With referral data flowing into your ESP, you can:

* Build a segment of active advocates (people with one or more successful referrals) for
VIP or loyalty campaigns.

* Trigger a welcome series for friends acquired through a referral.

* Re-engage advocates who have not shared recently.

* Personalize messages with relational details — the person’s name and who referred them —
so referral emails feel personal, not like another generic promo.

## Available data points

You can attach a wide range of Talkable referral data to each contact you sync. The exact
variable names are shown in the product when you configure the integration; at a glance, the
data available includes:

| Data              | What’s included                                                                                                                     |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Contact details   | Email, phone number, and name                                                                                                       |
| Opt-in status     | Email and SMS opt-in state, and when each opt-in happened                                                                           |
| Person profile    | Advocate and loyalty status, when and where they signed up (including location), and any custom properties you pass from your store |
| Referral activity | Referrals made (total, approved, and pending), shares made, and who referred them — by name and email                               |
| Rewards           | The coupon code and reward value the person earned                                                                                  |
| Campaign          | Campaign name, type, tags, and whether it’s active                                                                                  |

## Sample payload

Here is what a referral opt-in looks like when Talkable syncs it to SendGrid — referral
data lands in the contact’s `custom_fields`:

```json
{
  "list_ids": ["your_list_id"],
  "contacts": [
    {
      "email": "jordan.lee@example.com",
      "first_name": "Jordan",
      "last_name": "Lee",
      "custom_fields": {
        "referrals_total": "7",
        "friends_referred": "5",
        "times_shared": "12",
        "is_advocate": "true",
        "referred_by_first_name": "Casey",
        "referred_by_last_name": "Morgan",
        "referred_by_email": "casey.morgan@example.com",
        "reward_coupon_code": "FRIEND25",
        "reward_earned": "$25 account credit",
        "campaign_name": "Spring Referral 2026"
      }
    }
  ]
}
```

> **Note:**
>
> SendGrid references each custom field by an ID specific to your account; readable names
> are shown above for clarity.

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation/sfmc.md
===============================================================================

# Salesforce Marketing Cloud

## Overview

This integration enables the sync of friends’ and advocates’ email opt-ins from Talkable to Salesforce Marketing Cloud (SFMC). With ESP apps clients can synchronize emails that Talkable acquires with their ESP.

Here are the conditions when Talkable acquires emails:

1. Advocate signs up and opts in for Talkable marketing emails:

[[Image]](https://docs.talkable.com/_images/signup_advocate.png.md)

2. A friend passes email gating and opts in for Talkable marketing emails:

[[Image]](https://docs.talkable.com/_images/signup_friend.png.md)

## Referral Flow

1. Advocate signs up in the Talkable campaign

2. If advocate is opted in, Talkable sends the advocate email to SFMC to subscribe to email list broadcasts. Talkable adds a field to identify this user as an advocate in SFMC.

3. The advocate shares an offer with a friend

4. Friend follows the share link, signs up in the Talkable campaign to receive the reward

5. If the friend has opted in, Talkable sends friend email to SFMC to subscribe for email list broadcasts, and adds field to identify this user as a friend

## Configuration Requirements

To set up this integration, please provide the following information:

**SOAP Endpoint URL**

How to find your SOAP Endpoint URL:

1. Navigate to **Setup** → **Apps** → **Installed Packages**

2. Select your integration package you created for API access

3. In the package, under **API Integration** component details, you will see your authentication endpoint or base URL

For more information about SOAP endpoints, visit: [Salesforce Developer Documentation](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/web_service_guide.html)

**Username and Password**

How to find Username and Password:

1. When setting up the user, select **API User**

2. For accounts with role-based permissions, select the **Role** → **Email** → **Admin** → **API Access** → **WebServices API** permission

3. For accounts with legacy permissions, select the **Grant the user access to the web services** permission

4. Enable the username and password security setting by going to **Setup** → **Security** → **Security Settings** and find the setting under **Username and Logins**

**List ID**

Talkable will push email opt-ins to the specified list. Our recommendation is to add these consumers to a new list or an existing warm-up or welcome list.

How to find List ID:

1. Navigate to SFMC admin, go to **Email Studio** → **Subscribers** → **Publication Lists**

2. Open the list (alternatively create a list for referral contacts)

**Customer Key** (Optional)

If you use Data Extension object for SFMC integration, you will need to provide Customer Key. This is user-supplied unique identifier for an object within an object type. This property corresponds to the external key assigned to an object.

## Available Data Fields

Each ESP application allows custom attributes to be included with each request. The following interpolation variables are allowed:

1. `{{ person }}` - a data object for either advocate or friend whenever they sign up or pass email gating and opt-in for marketing emails

2. `{{ ip }}` - a data object from which IP address either a signup or email gating occurred

3. `{{ campaign }}` - a data object with details about the campaign within which the email was captured

[[Image]](https://docs.talkable.com/_images/variables.png.md)

Each variable is described in the “Available variables” sidebar and can be expanded to see all nested properties.

## How to Set Up

Please use the following guide to start using the SFMC app:

1. Navigate into the App store:

[[Image]](https://docs.talkable.com/_images/app_store_step_1.png.md) [[Image]](https://docs.talkable.com/_images/app_store_step_2.png.md)

2. Choose the Salesforce Marketing Cloud app and click “Install”

3. Fill in all necessary fields using the credentials found through the instructions above

4. Complete installation in Talkable and enable the app:

[Image]

5. Test the app by pressing “Send sample payload” and then check if you are seeing a test request inside your SFMC:

[[Image]](https://docs.talkable.com/_images/send_sample_payload.png.md)

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation/targetbay.md
===============================================================================

# TargetBay

Talkable syncs referral opt-ins and contact data into TargetBay — an ecommerce email marketing and reviews platform — so every Advocate and Friend who opts in during a campaign flows into your marketing in real
time.

## What this integration does

Talkable turns referral sign-ups into enriched, segmentable contacts in your ESP —
automatically. The integration:

* **Syncs referral opt-ins** — every Advocate and Friend who opts in during a Talkable
campaign is sent to your ESP as a contact create-or-update, so referral sign-ups grow
your marketable audience in real time.

* **Targets the right list or audience** — each contact is added to the specific list,
audience, or subscription group you choose, so referred customers drop straight into the
right welcome series, nurture flow, or segment.

* **Enriches contacts with referral data** — map Talkable data such as referral and share
counts, advocate status, and campaign details to your ESP’s fields through interpolation
variables, powering referral-based segmentation, triggers, and personalization.

## When opt-ins are synced

An opt-in can happen at two points in a referral — the Advocate’s and the Friend’s —
and Talkable syncs each one to your ESP the instant it happens, so no opted-in contact is
missed or left for a manual export. Here is where that fits in the referral journey:

1. **Advocate opts in.** A customer enters a Talkable campaign (post-purchase, standalone,
floating widget, and so on) and opts in for marketing communications.

2. **Advocate synced** → Talkable sends the advocate’s contact details and opt-in status to
your ESP.

3. **Advocate shares the offer.** They share by email, social, SMS, or a unique link.

4. **Friend opts in.** A friend follows the referral link, enters the campaign, and opts in
to claim the offer.

5. **Friend synced** → Talkable sends the friend’s contact details and opt-in status to your
ESP.

## Segmentation use cases

With referral data flowing into your ESP, you can:

* Build a segment of active advocates (people with one or more successful referrals) for
VIP or loyalty campaigns.

* Trigger a welcome series for friends acquired through a referral.

* Re-engage advocates who have not shared recently.

* Personalize messages with relational details — the person’s name and who referred them —
so referral emails feel personal, not like another generic promo.

## Available data points

You can attach a wide range of Talkable referral data to each contact you sync. The exact
variable names are shown in the product when you configure the integration; at a glance, the
data available includes:

| Data              | What’s included                                                                                                                     |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Contact details   | Email, phone number, and name                                                                                                       |
| Opt-in status     | Email and SMS opt-in state, and when each opt-in happened                                                                           |
| Person profile    | Advocate and loyalty status, when and where they signed up (including location), and any custom properties you pass from your store |
| Referral activity | Referrals made (total, approved, and pending), shares made, and who referred them — by name and email                               |
| Rewards           | The coupon code and reward value the person earned                                                                                  |
| Campaign          | Campaign name, type, tags, and whether it’s active                                                                                  |

## Sample payload

Here is what a referral opt-in looks like when Talkable syncs it to TargetBay:

```json
{
  "email": "jordan.lee@example.com",
  "first_name": "Jordan",
  "last_name": "Lee",
  "tags": "talkable-advocate, referral-opt-in"
}
```
Referral data — referral and share counts, advocate status, who referred them (by name and
email), the reward or coupon code earned, and the campaign — can be mapped to your
TargetBay contact fields as part of the integration setup.

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation/what_counts_pro.md
===============================================================================

# WhatCounts

Talkable syncs referral opt-ins and contact data into WhatCounts — an email marketing platform — so every Advocate and Friend who opts in during a campaign flows into your marketing in real
time.

## What this integration does

Talkable turns referral sign-ups into enriched, segmentable contacts in your ESP —
automatically. The integration:

* **Syncs referral opt-ins** — every Advocate and Friend who opts in during a Talkable
campaign is sent to your ESP as a contact create-or-update, so referral sign-ups grow
your marketable audience in real time.

* **Targets the right list or audience** — each contact is added to the specific list,
audience, or subscription group you choose, so referred customers drop straight into the
right welcome series, nurture flow, or segment.

* **Enriches contacts with referral data** — map Talkable data such as referral and share
counts, advocate status, and campaign details to your ESP’s fields through interpolation
variables, powering referral-based segmentation, triggers, and personalization.

## When opt-ins are synced

An opt-in can happen at two points in a referral — the Advocate’s and the Friend’s —
and Talkable syncs each one to your ESP the instant it happens, so no opted-in contact is
missed or left for a manual export. Here is where that fits in the referral journey:

1. **Advocate opts in.** A customer enters a Talkable campaign (post-purchase, standalone,
floating widget, and so on) and opts in for marketing communications.

2. **Advocate synced** → Talkable sends the advocate’s contact details and opt-in status to
your ESP.

3. **Advocate shares the offer.** They share by email, social, SMS, or a unique link.

4. **Friend opts in.** A friend follows the referral link, enters the campaign, and opts in
to claim the offer.

5. **Friend synced** → Talkable sends the friend’s contact details and opt-in status to your
ESP.

## Segmentation use cases

With referral data flowing into your ESP, you can:

* Build a segment of active advocates (people with one or more successful referrals) for
VIP or loyalty campaigns.

* Trigger a welcome series for friends acquired through a referral.

* Re-engage advocates who have not shared recently.

* Personalize messages with relational details — the person’s name and who referred them —
so referral emails feel personal, not like another generic promo.

## Available data points

You can attach a wide range of Talkable referral data to each contact you sync. The exact
variable names are shown in the product when you configure the integration; at a glance, the
data available includes:

| Data              | What’s included                                                                                                                     |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Contact details   | Email, phone number, and name                                                                                                       |
| Opt-in status     | Email and SMS opt-in state, and when each opt-in happened                                                                           |
| Person profile    | Advocate and loyalty status, when and where they signed up (including location), and any custom properties you pass from your store |
| Referral activity | Referrals made (total, approved, and pending), shares made, and who referred them — by name and email                               |
| Rewards           | The coupon code and reward value the person earned                                                                                  |
| Campaign          | Campaign name, type, tags, and whether it’s active                                                                                  |

## Sample payload

Here is what a referral opt-in looks like when Talkable syncs it to WhatCounts — referral
data lands in `customData`, ready for segmentation:

```json
{
  "email": "jordan.lee@example.com",
  "firstName": "Jordan",
  "lastName": "Lee",
  "customData": {
    "referrals_total": 7,
    "friends_referred": 5,
    "times_shared": 12,
    "is_advocate": true,
    "referred_by_first_name": "Casey",
    "referred_by_last_name": "Morgan",
    "referred_by_email": "casey.morgan@example.com",
    "reward_coupon_code": "FRIEND25",
    "reward_earned": "$25 account credit",
    "campaign_name": "Spring Referral 2026"
  }
}
```


## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/email_marketing_and_automation/yotpo.md
===============================================================================

# Yotpo

## Loyalty & Referrals

Yotpo Loyalty & Referrals is a comprehensive customer loyalty platform that helps businesses create loyalty programs with points and rewards, manage VIP tiers, and track customer engagement.

The Talkable integration with Yotpo allows you to **leverage customer loyalty data to create personalized referral experiences** for your most valuable customers. The saved Yotpo loyalty data can be found in their custom properties.

Integration with Yotpo is done in Talkable with the corresponding App Store application.

This integration synchronizes data **FROM Yotpo TO Talkable**. It supports the following data to be synchronized:

* Customer loyalty points balance

* VIP tier status (Bronze, Silver, Gold, etc.)

* Tier change notifications (gained or lost status)
> **Note:**
>
> This is a **pull-only integration** - Talkable receives loyalty data from Yotpo but does not send any data back to Yotpo.

Here are the conditions when Talkable receives loyalty data:

1. Customer’s loyalty points balance changes in Yotpo

2. Customer gains a VIP tier status in Yotpo

3. Customer loses a VIP tier status in Yotpo

The integration uses webhooks to automatically sync this data in real-time, ensuring your Talkable campaigns always have the most up-to-date loyalty information.

## Integration Setup

Please use the following guide to start using the Yotpo integration:

1. Navigate into the App store:

[[Image]](https://docs.talkable.com/_images/app_store_step_1.png.md) [[Image]](https://docs.talkable.com/_images/app_store_step_2.png.md)

2. Choose “Yotpo Loyalty & Referrals” by clicking “Install”

[Image]

3. You will be redirected to Yotpo for OAuth authorization:

  * Log into your Yotpo account

  * Click “Connect” to grant Talkable access to your loyalty data

  * You will be redirected back to Talkable automatically

4. Complete installation and enable the app:

    The integration will automatically configure with your Yotpo store credentials. Enable the “Sync Loyalty Data” action and then enable the app itself.

5. Test the integration by making a points adjustment in your Yotpo dashboard and verify the data appears in Talkable customer profiles.

## Loyalty data usage

New data that synced from Yotpo can be accessed through person custom properties:

Available Yotpo loyalty variables:

* yotpo.points_earned

* yotpo.point_balance

* yotpo.total_redemptions

* yotpo.total_points_redeemed

* yotpo.vip_tier_name

* yotpo.successfull_referales

* yotpo.referrales_made_and_clicked

### Tracking Loyalty-Driven Referral Performance

You can track referral performance using the provided Yotpo Loyalty variables to identify which customers generate the most referrals and use these insights to optimize your campaigns.
These custom properties can be viewed within the **People** report details:

1. Navigate to the **People** report, select the desired date range and filters, generate the report, and click the **Details** link for the customer you’re interested in.

[Image]

2. Scroll to the **Custom Properties** section and review the following values:

[Image]

### Exclusive Referral Rewards for customers

Yotpo custom properties allow you to configure referral rewards that vary by their values.
Lets create better reward for **Gold Tier** advocates in the example below:

1. Open the **Rules** page of the desired campaign and navigate to the **Incentives** section.

[Image]

2. Create a new **Advocate Referral Incentive** with the desired reward amount.

[Image]

3. Go to **Advanced Settings**, and fill in **Incentive Criteria** fields with the following code:

```liquid
{% if advocate_info.custom_properties.yotpo.vip_tier_name == "Gold Tier" %}
  true
{% else %}
  Should have Gold Tier
{% endif %}
```
[Image]

4. Learn more about incentive criteria on [Incentive Criteria](https://docs.talkable.com/campaigns/tutorials/incentive_criteria.md#campaigns-tutorials-incentive-criteria) page.

### Yotpo Points in Talkable Wallet

You can use Yotpo custom properties to display customer’s loyalty points alongside their referral rewards directly in the Talkable Wallet.
This gives customers a unified view of both referral and loyalty activity in one place.

In the example below, we’ll show how to display the customer’s Yotpo points balance in the header of the Apple Wallet pass:

1. Navigate to the **Editor** of the desired campaign:

[Image]

2. Open the **Talkable wallet for iPhone** view, on the right part of the screen you can see Apple pass preview:

[Image]

3. Update the **Apple Wallet header field label** localization with **REFERRALS | POINTS**, and set the **Apple Wallet header field value** to the following code:

```liquid
{{ referrals_count_by_status.total | default: 0 }} | {{  custom_properties.yotpo.point_balance | default: 0 }}
```

4. In the preview, you’ll see that the wallet header now displays Points in addition to Referrals:

[Image]

5. Learn more about the campaign editor on the [Editor](https://docs.talkable.com/campaigns/editor.md#campaigns-editor) page.

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/index.md
===============================================================================

# Main

### Talkable Basics

* [Talkable Campaigns](https://docs.talkable.com/campaigns.md)
  * [Campaign Types and Placements](https://docs.talkable.com/campaigns.md#campaign-types-and-placements)
  * [Campaign Structure](https://docs.talkable.com/campaigns.md#campaign-structure)
  * [Campaign Setup & tutorials](https://docs.talkable.com/campaigns.md#campaign-setup-tutorials)
  * [Designer Guide](https://docs.talkable.com/campaigns.md#designer-guide)
* [Features](https://docs.talkable.com/advanced_features.md)
  * [Coupons](https://docs.talkable.com/advanced_features/coupons.md)
  * [Shopify coupon auto-sync](https://docs.talkable.com/advanced_features/shopify_coupons_auto_sync.md)
  * [Shopify coupon auto-apply](https://docs.talkable.com/advanced_features/shopify_coupons_auto_apply.md)
  * [Shopify Purchase Syncing](https://docs.talkable.com/advanced_features/shopify_purchase_syncing.md)
  * [Referral Tracking Methods](https://docs.talkable.com/advanced_features/track_methods.md)
  * [Advocate Personal Coupon Sharing](https://docs.talkable.com/advanced_features/personal_coupon_sharing.md)
  * [Name Sharing](https://docs.talkable.com/advanced_features/name_sharing.md)
  * [Converting Into Localization](https://docs.talkable.com/advanced_features/converting_into_localization.md)
  * [Customer Service Portal](https://docs.talkable.com/advanced_features/customer_service_portal.md)
  * [Params Encryption](https://docs.talkable.com/advanced_features/params_encryption.md)
  * [Integrating Events](https://docs.talkable.com/advanced_features/events.md)
  * [File Encryption](https://docs.talkable.com/advanced_features/file_encryption.md)
  * [Facebook Login & Share](https://docs.talkable.com/advanced_features/facebook_login_share.md)
  * [Report Password Protection](https://docs.talkable.com/advanced_features/report_password_protection.md)
  * [Including Product Items](https://docs.talkable.com/advanced_features/product_items.md)
  * [Pass Custom User Data](https://docs.talkable.com/advanced_features/passing_custom_data.md)
  * [Phone number gating](https://docs.talkable.com/advanced_features/phone_number_gating.md)
  * [Referrals Approval](https://docs.talkable.com/advanced_features/referrals_approval.md)
  * [Segments](https://docs.talkable.com/advanced_features/segments.md)
  * [Subscribing To Iframe Events](https://docs.talkable.com/advanced_features/subscribing_to_events.md)
  * [Setting up Campaign Placement criteria](https://docs.talkable.com/advanced_features/reg_ex.md)
  * [BHN Rewards (formerly Rybbon)](https://docs.talkable.com/advanced_features/bhnrewards.md)
  * [Using URL Parameters](https://docs.talkable.com/advanced_features/url_parameters.md)
  * [UTM Tags](https://docs.talkable.com/advanced_features/utm_tags.md)
  * [White-labeling](https://docs.talkable.com/advanced_features/white_labeling.md)
  * [Single Sign-On (SSO)](https://docs.talkable.com/advanced_features/single_sign_on.md)
  * [Multi-currency](https://docs.talkable.com/advanced_features/multi_currency.md)
  * [SheerID Integration](https://docs.talkable.com/advanced_features/sheerid.md)
  * [Tango Integration](https://docs.talkable.com/advanced_features/tango.md)
  * [Tremendous Integration](https://docs.talkable.com/advanced_features/tremendous.md)
  * [Google Login](https://docs.talkable.com/advanced_features/google_login.md)

### Custom Integration

* [Custom Integration](https://docs.talkable.com/integration/custom.md)
  * [CrowdTwist](https://docs.talkable.com/integration/custom/crowdtwist.md)
  * [ChatGPT](https://docs.talkable.com/integration/custom/chatgpt.md)
  * [Validity](https://docs.talkable.com/integration/custom/validity.md)
  * [Trustpilot](https://docs.talkable.com/integration/custom/trustpilot.md)
  * [Recharge](https://docs.talkable.com/integration/custom/recharge.md)
  * [Salesforce Integration](https://docs.talkable.com/integration/custom/salesforce.md)
  * [Microsoft Dynamics CRM Integration](https://docs.talkable.com/integration/custom/microsoft.md)
  * [Tapcart](https://docs.talkable.com/integration/custom/tapcart.md)

### Email Marketing & Automation

* [Email Marketing & Automation](https://docs.talkable.com/email_marketing_and_automation.md)
  * [Bluecore](https://docs.talkable.com/email_marketing_and_automation/bluecore.md)
  * [Braze](https://docs.talkable.com/email_marketing_and_automation/braze.md)
  * [Cordial](https://docs.talkable.com/email_marketing_and_automation/cordial.md)
  * [CreateSend](https://docs.talkable.com/email_marketing_and_automation/createsend.md)
  * [Cheetah](https://docs.talkable.com/email_marketing_and_automation/cheetah.md)
  * [Dotdigital](https://docs.talkable.com/email_marketing_and_automation/dotdigital.md)
  * [Klaviyo](https://docs.talkable.com/email_marketing_and_automation/klaviyo.md)
  * [Yotpo](https://docs.talkable.com/email_marketing_and_automation/yotpo.md)
  * [Ometria](https://docs.talkable.com/email_marketing_and_automation/ometria.md)
  * [Oracle Bronto](https://docs.talkable.com/email_marketing_and_automation/oracle_bronto.md)
  * [Omnisend](https://docs.talkable.com/email_marketing_and_automation/omnisend.md)
  * [Mailchimp](https://docs.talkable.com/email_marketing_and_automation/mailchimp.md)
  * [Sailthru](https://docs.talkable.com/email_marketing_and_automation/sailthru.md)
  * [SendGrid](https://docs.talkable.com/email_marketing_and_automation/sendgrid.md)
  * [Salesforce Marketing Cloud](https://docs.talkable.com/email_marketing_and_automation/sfmc.md)
  * [GetResponse](https://docs.talkable.com/email_marketing_and_automation/getresponse.md)
  * [TargetBay](https://docs.talkable.com/email_marketing_and_automation/targetbay.md)
  * [Emarsys](https://docs.talkable.com/email_marketing_and_automation/emarsys.md)
  * [Exponea](https://docs.talkable.com/email_marketing_and_automation/exponea.md)
  * [Hubspot](https://docs.talkable.com/email_marketing_and_automation/hubspot.md)
  * [Iterable](https://docs.talkable.com/email_marketing_and_automation/iterable.md)
  * [Listrak](https://docs.talkable.com/email_marketing_and_automation/listrak.md)
  * [Attentive](https://docs.talkable.com/email_marketing_and_automation/attentive.md)
  * [Apsis](https://docs.talkable.com/email_marketing_and_automation/apsis.md)
  * [WhatCounts](https://docs.talkable.com/email_marketing_and_automation/what_counts_pro.md)
  * [Custom App](https://docs.talkable.com/email_marketing_and_automation/custom_app.md)

### JS Integration

* [Standard Integration](https://docs.talkable.com/integration/standard.md)
  * [Integration High-Level Overview](https://docs.talkable.com/integration/standard/overview.md)
  * [Integration Components](https://docs.talkable.com/integration/standard/integration_components.md)
  * [Verifying Integration](https://docs.talkable.com/integration/verify.md)
  * [Validating the Integration](https://docs.talkable.com/integration/standard/validating_integration.md)
  * [Cookies](https://docs.talkable.com/integration/standard/cookies.md)
  * [F.A.Q.](https://docs.talkable.com/integration/standard/questions.md)
* [Loyalty Integration](https://docs.talkable.com/integration/loyalty.md)
  * [Integration Components](https://docs.talkable.com/integration/loyalty/integration_components.md)
  * [Custom App for Loyalty](https://docs.talkable.com/integration/loyalty/custom_app.md)
  * [Auto-Enrollment](https://docs.talkable.com/integration/loyalty/auto_enrollment.md)
  * [Shopify Integration](https://docs.talkable.com/integration/loyalty/shopify_integration.md)
* [E-commerce Platforms](https://docs.talkable.com/integration/ecommerce_platforms.md)
  * [Salesforce B2C Commerce Cloud](https://docs.talkable.com/integration/ecommerce_platforms/sfcc.md)
  * [Shopify](https://docs.talkable.com/integration/ecommerce_platforms/shopify.md)
  * [BigCommerce](https://docs.talkable.com/integration/ecommerce_platforms/bigcommerce.md)
  * [Magento](https://docs.talkable.com/integration/ecommerce_platforms/magento.md)

### Back-end Integration

* [API Reference](https://docs.talkable.com/api_v2.md)
  * [Introduction](https://docs.talkable.com/api_v2/intro.md)
  * [Referral Program via API](https://docs.talkable.com/api_v2/flow.md)
  * [Origins](https://docs.talkable.com/api_v2/origins.md)
  * [Referrals](https://docs.talkable.com/api_v2/referrals.md)
* [Webhooks](https://docs.talkable.com/web_hooks.md)
  * [Create Coupons](https://docs.talkable.com/web_hooks/create_coupon.md)
  * [Referral](https://docs.talkable.com/web_hooks/referral.md)
  * [Reward](https://docs.talkable.com/web_hooks/reward.md)
  * [Post Share](https://docs.talkable.com/web_hooks/post_share.md)
  * [Advocate Signup](https://docs.talkable.com/web_hooks/offer_signup.md)
  * [Friend Email Gating](https://docs.talkable.com/web_hooks/claim_signup.md)
  * [Unsubscribe](https://docs.talkable.com/web_hooks/unsubscribe.md)
  * [Check Unsubscribe](https://docs.talkable.com/web_hooks/check_unsubscribe.md)
  * [Event](https://docs.talkable.com/web_hooks/event.md)
  * [Migration from Webhooks to Custom App](https://docs.talkable.com/web_hooks/migration_to_custom_app.md)

### For Mobile

* [Talkable iOS SDK](https://docs.talkable.com/ios_sdk.md)
  * [Getting Started](https://docs.talkable.com/ios_sdk/getting_started.md)
  * [Integration](https://docs.talkable.com/ios_sdk/integration.md)
  * [Social Sharing](https://docs.talkable.com/ios_sdk/social_sharing.md)
  * [Native Integration via API](https://docs.talkable.com/ios_sdk/api_integration.md)
  * [React Native](https://docs.talkable.com/ios_sdk/react_native.md)
  * [Advanced Usage](https://docs.talkable.com/ios_sdk/advanced.md)
  * [Integration with Third Party Deep Linking Services](https://docs.talkable.com/ios_sdk/custom_deep_linking.md)
  * [Example](https://docs.talkable.com/ios_sdk/example.md)
* [Talkable Android SDK](https://docs.talkable.com/android_sdk.md)
  * [Getting Started](https://docs.talkable.com/android_sdk/getting_started.md)
  * [Integration](https://docs.talkable.com/android_sdk/integration.md)
  * [Advanced Usage](https://docs.talkable.com/android_sdk/advanced.md)
  * [API](https://docs.talkable.com/android_sdk/api.md)
  * [React Native](https://docs.talkable.com/android_sdk/react_native.md)
  * [Integration with Third Party Deep Linking Services](https://docs.talkable.com/android_sdk/custom_deep_linking.md)
  * [Testing](https://docs.talkable.com/android_sdk/testing.md)
  * [Upgrade](https://docs.talkable.com/android_sdk/upgrade.md)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/custom.md
===============================================================================

# Custom Integration

* [CrowdTwist](https://docs.talkable.com/integration/custom/crowdtwist.md)
* [ChatGPT](https://docs.talkable.com/integration/custom/chatgpt.md)
* [Validity](https://docs.talkable.com/integration/custom/validity.md)
* [Trustpilot](https://docs.talkable.com/integration/custom/trustpilot.md)
* [Recharge](https://docs.talkable.com/integration/custom/recharge.md)
* [Salesforce Integration](https://docs.talkable.com/integration/custom/salesforce.md)
* [Microsoft Dynamics CRM Integration](https://docs.talkable.com/integration/custom/microsoft.md)
* [Tapcart](https://docs.talkable.com/integration/custom/tapcart.md)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/custom/chatgpt.md
===============================================================================

# ChatGPT

With this integration, Talkable utilizes OpenAI’s ChatGPT API to generate custom AI-driven text for Advocate’s sharing message or other campaign-specific purposes.

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/custom/crowdtwist.md
===============================================================================

# CrowdTwist

With this integration, Talkable enables store credit rewards through the CrowdTwist platform, allowing for custom incentives and campaign tagging.

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/custom/microsoft.md
===============================================================================

# Microsoft Dynamics CRM Integration

With this integration, Talkable pushes relevant customer data to Microsoft Dynamics CRM and synchronizes status changes back to Talkable.

**How it works**

* **Data Push**: Customer data collected through Talkable is automatically pushed to Microsoft Dynamics CRM, ensuring your CRM contains the latest information.

* **Status Sync**: Any status changes made in Microsoft Dynamics CRM are synced back to Talkable, ensuring your campaigns are always up to date.

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/custom/recharge.md
===============================================================================

# Recharge
> **Note:**
>
> This is a custom integration that can be implemented with extra effort. If you wish to integrate this vendor, please
> contact your Customer Success Manager to apply it to your campaigns.

Recharge allows consumers to apply accumulated rewards towards upcoming subscription orders. Please note this is essentially ‘stacking’ of referral rewards.

Talkable integration with Recharge enables next use cases:

1. Tracking Recharge orders (includes initial, subsequent).

2. Showing the Post Purchase campaign on subscription checkout with the ability to tweak it for Recharge flow specifically

3. Coupon auto-sync.  
Talkable will reward with coupons applicable on both Recharge and Shopify checkouts.
The offer should be equal for both Recharge and Shopify within the same campaign.

4. Coupon auto-apply.  
Talkable will try to apply a coupon to the next charge of the customer’s subscription. This coupon will also be sent to the customer’s email in case they want to use it for Shopify instead.  
**Version 2** of the integration also allows for accrued discounts in case the customer refers multiple friends.

5. If the Gleam widget is enabled, it can behave differently depending on the customer’s actions (if it’s set up according to a non-default flow):

    Once the Advocate receives a reward, they will be shown a Gleam widget that will be showing the coupon code as well as a notice that the coupon would be automatically applied to the ongoing subscription if the advocate has the one. The discount is still available for use on regular Shopify flow, but once used it won’t be applied to the subscription of the customer.

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/custom/salesforce.md
===============================================================================

# Salesforce Integration

With this integration, Talkable pushes relevant customer data to Salesforce and synchronizes status changes back to Talkable.

**How it works**

* **Data Push**: Customer data collected through Talkable is automatically pushed to Salesforce, ensuring your CRM has the latest information.

* **Status Sync**: Any status changes made in Salesforce are synced back to Talkable, keeping your marketing campaigns up to date.

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/custom/tapcart.md
===============================================================================

# Tapcart

The integration with Tapcart enables mobile app-based referral programs that leverage contact sharing to drive customer acquisition. This powerful combination allows your customers to easily share referral codes through their preferred communication channels, including SMS and social platforms.

Through Tapcart’s Contact Sharing feature, you can integrate with Talkable. Contact Sharing incentivizes consumers (via gift cards or discounts) to share referral-based offerings through their preferred social platform or directly with SMS contacts on their device. The integration focuses on utilizing key elements of social proof to increase consumer engagement and spending with your brand.

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/custom/trustpilot.md
===============================================================================

# Trustpilot

With this integration, Talkable tracks reviews as events in campaigns using Trustpilot’s webhook functionality, allowing reviews to be recorded and utilized in marketing efforts.

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/custom/validity.md
===============================================================================

# Validity

With this integration, Talkable performs additional validation on email addresses using the Validity service. This helps maintain accurate and clean customer data and adds an extra layer of security to your Campaign.

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/ecommerce_platforms.md
===============================================================================

# E-commerce Platforms

* [Salesforce B2C Commerce Cloud](https://docs.talkable.com/integration/ecommerce_platforms/sfcc.md)
* [Shopify](https://docs.talkable.com/integration/ecommerce_platforms/shopify.md)
  * [Automatic integration](https://docs.talkable.com/integration/ecommerce_platforms/shopify.md#automatic-integration)
  * [Manual integration](https://docs.talkable.com/integration/ecommerce_platforms/shopify.md#manual-integration)
  * [Manual migrating from a vintage theme to an Online store 2.0 theme](https://docs.talkable.com/integration/ecommerce_platforms/shopify.md#manual-migrating-from-a-vintage-theme-to-an-online-store-2-0-theme)

* [BigCommerce](https://docs.talkable.com/integration/ecommerce_platforms/bigcommerce.md)
* [Magento](https://docs.talkable.com/integration/ecommerce_platforms/magento.md)
  * [Prerequisites](https://docs.talkable.com/integration/ecommerce_platforms/magento.md#prerequisites)
  * [Installation](https://docs.talkable.com/integration/ecommerce_platforms/magento.md#installation)
  * [Accessing Talkable Configuration](https://docs.talkable.com/integration/ecommerce_platforms/magento.md#accessing-talkable-configuration)
  * [Configuring Talkable Extension](https://docs.talkable.com/integration/ecommerce_platforms/magento.md#configuring-talkable-extension)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/ecommerce_platforms/bigcommerce.md
===============================================================================

# BigCommerce

The BigCommerce integration allows seamless synchronization of coupons between Talkable and BigCommerce stores, facilitating automated coupon management. Once set up, this integration enables efficient management of marketing campaigns with coupon distribution synced to BigCommerce.

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/ecommerce_platforms/magento.md
===============================================================================

# Magento

Talkable offers free extension for Magento 2.4 which allows you to integrate and use Talkable with your Magento store.

## Prerequisites

1. Magento 2.4
> **Warning:**
>
> Magento 1.x is no longer supported. If you are currently using Magento 1.x, we recommend upgrading to Magento 2.4 to use the Talkable extension.
    To check your Magento version, navigate to your store’s admin panel. The version number will be listed in the page footer.

[Image]

2. Talkable account

3. Adobe Commerce account

    If you do not have an Adobe Commerce account configured, follow [these steps](https://experienceleague.adobe.com/en/docs/commerce-admin/start/commerce-account/commerce-account-create).

## Installation
> **Note:**
>
> Installation via Composer requires an IT administrator with SSH access to the server where Magento 2 is hosted.

1. Get the Talkable extension

    Visit the Adobe Commerce Marketplace and get the Talkable extension. [https://commercemarketplace.adobe.com/talkable-magento2-integration.html](https://commercemarketplace.adobe.com/talkable-magento2-integration.html)

[Image]




2. Open the terminal and navigate to the root directory of your Magento app.

    Usually it’s `/var/www/html/`.

```bash
cd /var/www/html/
```

3. Run the following command to access the latest version of the Talkable extension.

```bash
composer require talkable/magento2-integration
```

4. Run the following command to enable the Talkable extension you just downloaded:

```bash
php bin/magento module:enable Talkable_Integration --clear-static-content
```
    You should see the following output:
> The following modules have been enabled:
> - Talkable_Integration
>
> To make sure that the enabled modules are properly registered, run ‘setup:upgrade’.
> Cache cleared successfully.
> Generated classes cleared successfully.
> Please run the ‘setup:di:compile’ command to generate classes.
> Generated static view files cleared successfully.

5. As displayed in the sample output, you must now enable any additional modules. Run the following command to enable them:

```bash
php bin/magento setup:upgrade
```

6. To ensure that the CSS and JS on your Magento 2 store continues to work properly, you’ll need to run a static content deploy command.

```bash
php bin/magento setup:static-content:deploy -f
```

7. Installation via Composer is complete! You can now return to the Magento admin dashboard from your browser.

## Accessing Talkable Configuration

1. To access Talkable extension settings, navigate to **Stores** → **Configuration** in
your Magento admin panel.

[Image]

2. Then select **Talkable** → **Talkable Configuration** from the list of available configurations.

    If you have multiple stores, select the desired Store View you want to change the settings for.

[Image]

## Configuring Talkable Extension

Expand Integration, Campaigns and Page URLs sections to see all available configuration options.

[Image]

### Integration

The Integration section allows you to change the Talkable Site ID, which is used to connect your store
to your Talkable account.

[Image]

> **Warning:**
>
> Only change this setting if you need to connect your store to a different site in the Talkable dashboard.
> An incorrect value will prevent your campaigns from showing.

You need to paste the Site ID from your Talkable Site Dashboard into this field.

[Image]


Changing the Site ID will invalidate the full page cache. Magento will display a warning message with a link to the Cache Management page.

You would need to follow `Cache Management` link and refresh the invalidated cache types.

[Image]


As a result you should see the config status as `Enabled`.

[Image]

### Campaigns

The Campaigns section allows you to enable or disable different types of campaigns on your site.
For example, if you don’t have Standalone or Advocate Dashboard campaigns configured in Talkable,
you can disable these campaigns in extension config, so the corresponding pages are not accessible.

[Image]

### Page URLs

The Page URLs section allows you to change paths to the Standalone Share and Advocate Dashboard pages.
The paths must match the placements you have configured in Talkable for this campaign type.
Default values correspond to default placements in Talkable.

[Image]

> **Warning:**
>
> Only change these settings if you have configured custom placements for these campaign types
> in your Talkable dashboard. Incorrect values will prevent your Standalone or Dashboard campaign from showing.

[Image]

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/ecommerce_platforms/sfcc.md
===============================================================================

# Salesforce B2C Commerce Cloud
> **Note:**
>
> You must have Talkable account in order to get started

Talkable cartridge is a self-contained cartridge that can easily integrate
into any B2C Commerce Cloud store. The cartridge can be configured in
the Business Manager and contains all elements necessary to perform successful
practice implementation of Talkable. After the cartridge is deployed, configured
and integrated with the storefront templates, the customer will have full power
of Talkable marketing programs applied to their site.

Link to Talkable cartridge on AppExchange:  
[https://appexchange.salesforce.com/appxListingDetail?listingId=a0N4V00000JdkctUAB](https://appexchange.salesforce.com/appxListingDetail?listingId=a0N4V00000JdkctUAB)

Link to download integration documentation: [Integration Guide](_static/talkable-integration-guide.pdf)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/ecommerce_platforms/shopify.md
===============================================================================

# Shopify

## Automatic integration
> **Note:**
>
> If you have previously integrated with Talkable, make sure you remove the manual
> Talkable integration script located in the Additional Content & Scripts section before
> you start the Automatic integration process. See [Manual integration](#manual-integration) for details.

1. Contact [sales@talkable.com](mailto:sales%40talkable.com) to learn about our pricing and set up an account with Talkable

  * Provide a valid Shopify store URL. Example: https://123test.myshopify.com

  * Choose “Shopify” as your platform during registration process

2. Install the Shopify integration app via the link provided by Talkable team

3. After the successful installation you will be redirected back to Talkable

4. Enable “Referral Integration“ toggle

5. Create, set up, and launch Campaigns (Invite, Advocate Dashboard, etc.)

6. Verify your integration using [Verifying Integration instructions](https://docs.talkable.com/integration/verify.md#integration-verify)
> **Note:**
>
> Post Purchase campaign is located at the “Thank you” page after Checkout.
>
> To check how Standalone Campaign looks visit */pages/share* or */pages/invite* links of your store.
> You can edit these links in Administrative panel of your store.

> **Important:**
>
> If you are managing the Shopify theme code using a [Shopify Github integration](https://shopify.dev/docs/storefronts/themes/tools/github),
> make sure to pull the changes to the theme made by the automatic integration to avoid
> resetting them with a commit. The theme updates are described in the [Manual integration instructions](#integration-ecommerce-platforms-shopify-manual-integration).

## Manual integration

### For Shopify Online Store 2.0 themes

If your Shopify store uses an [Online Store 2.0 theme](https://help.shopify.com/en/manual/online-store/themes/managing-themes/versions),
please follow the instructions below.

1. Provide a valid Shopify store URL and choose “Shopify” as your platform during registration process

2. On the Welcome screen click “I’m a Developer”

3. Pass Shopify authorization

4. You will be redirected to your Shopify store, log in and click the install button

5. After successful installation you will be redirected back to Talkable

6. Click “Integrate manually“

7. In your Shopify Admin, add the integration to your layout:

  1. Create a snippet:

    * Go to **Online Store** → **Themes**

    * Click **Actions** (”…” button) → **Edit code**

    * Go to **Snippets**

    * Click “Add a new snippet“

    * Create a new snippet called talkable-partial

    * In the newly created file, add the following code:

```html
<!-- Begin Talkable integration code -->
<script type="text/javascript">
  window._talkableq = window._talkableq || [];
  {% if customer %}
    window._talkableq.push(['authenticate_customer', {
      email:        '{{ customer.email }}',
      phone_number: '{{ customer.phone }}',
      first_name:   '{{ customer.first_name }}',
      last_name:    '{{ customer.last_name }}'
    }]);
  {% endif %}
</script>
<script async src="//d2jjzw81hqbuqv.cloudfront.net/integration/clients/<YOUR-TALKABLE-SITE-ID>.min.js" type="text/javascript"></script>
<!-- End Talkable integration code -->
```

> **Note:**
>
> Replace **<YOUR-TALKABLE-SITE-ID>** with your Talkable Site ID which is displayed on the integration page.

    * Click “Save”

  2. Render the snippet in the layout:

    * In the theme code editor (**Online Store** → **Themes** → **Edit code**), go to **Layout**

    * Open theme.liquid file

    * Before closing </head> paste the following code:

```liquid
{% render "talkable-partial" %}
```

    * Click “Save”

8. In your Shopify Admin, create resources for referral share page:

  1. Create a share page section:

    * In the theme code editor (**Online Store** → **Themes** → **Edit code**), go to **Sections**

    * Click “Add a new section“

    * Create a new Liquid section called talkable-campaign.liquid

    * In the newly created file, add the <div> block for the referral campaign.

```html
<div id="talkable-offer"></div>
```

    * Optionally, update the schema name to anything meaningful, for example, “Referral campaign“

[Image]

    * Click “Save”

  2. Create a share page template:

    * Go to **Templates**

    * Click “Add a new template“

    * Create a new JSON template of type page called talkable (page.talkable.json)

    * Change the type of the main section to talkable-campaign

[Image]

> **Important:**
>
> The name of the section should be the same as the one you used
> in the previous step when naming your section file.

> **Important:**
>
> If your main section is disabled, remove the row that does it.

  3. Create a page:

    * Exit theme editor if it was opened

    * Go to **Online Store** → **Pages**

    * Click “Add page“

    * Add title: Share

    * Select theme template: talkable

    * Click “Save”

9. In your Shopify Admin, create resources for referral dashboard page:

  1. Create a dashboard page section:

    * In the theme code editor (**Online Store** → **Themes** → **Edit code**), go to **Sections**

    * Click “Add a new section“

    * Create a new Liquid section called talkable-dashboard.liquid

    * In the newly created file, add the following code:

```html
{% if shop.customer_accounts_enabled %}
  {% if customer %}
    <div id="talkable-offer"></div>
  {% else %}
    {{ 'Log in' | customer_login_link }}
  {% endif %}
{% endif %}
```

    * Optionally, update the schema name to anything meaningful, for example, “Referral dashboard“

    * Click “Save”

  2. Create a dashboard page template:

    * Go to **Templates**

    * Click “Add a new template“

    * Create a new JSON template of type page called dashboard.talkable (page.dashboard.talkable.json)

    * Change the type of the main section to talkable-dashboard

```JSON
{
  "sections": {
    "main": {
      "type": "talkable-dashboard"
    }
  }
}
```

> **Important:**
>
> The name of the section should be the same as the one you used
> in the previous step when naming your section file.

> **Important:**
>
> If your main section is disabled, remove the row that does it.

  3. Create a page:

    * Exit theme editor if it was opened

    * Go to **Online Store** → **Pages**

    * Click “Add page“

    * Add title: Referral Dashboard

    * Select theme template: dashboard.talkable

    * Click “Save” (Customer accounts must be enabled in **Settings** → **Checkout**)

10. In your Shopify Admin, add a post-purchase script:

  * Go to **Settings** → **Checkout**

  * Scroll down to **Order status page**

  * Paste the following code into **Additional scripts** field:

```html
<!-- Begin Talkable integration code -->
<script type="text/javascript">
  window._talkableq = [['init', {
    site_id: '<YOUR-TALKABLE-SITE-ID>' // REQUIRED - Replace with your Talkable Site ID
  }]];

        if (Shopify && Shopify.checkout) {
    checkout = Shopify.checkout
    var _talkable_order_items = [];
    for (idx in checkout.line_items) {
      line = checkout.line_items[idx];
      _talkable_order_items.push({
        product_id: line.sku || line.product_id, // REQUIRED - First Item Product ID
        price: line.price, // REQUIRED - First Item Unit Price
        quantity: line.quantity, // REQUIRED - First Item Quantity
        title: line.title, // Optional - Name of product
      });
    }

        var _talkable_data = {
      purchase: {
        order_number: checkout.order_id, // REQUIRED - Order number
        currency_iso_code: checkout.presentment_currency, // Optional - Purchase Currency. REQUIRED for Multi-Currency Sites
        subtotal: checkout.subtotal_price, // REQUIRED - Purchase Subtotal Price
        tax_amount: checkout.total_tax, // REQUIRED - Purchase tax amount
        discount_amount: checkout.discount ? checkout.discount.amount : null, // REQUIRED - Total Discount
        shipping_amount: checkout.shipping_rate ? checkout.shipping_rate.price : null, // REQUIRED - Total Shipping Cost
        coupon_code: checkout.discount ? checkout.discount.code : null,
        items: _talkable_order_items
      },
      customer: {
        email: checkout.email, // REQUIRED - Customer Email Address
        first_name: checkout.billing_address ? checkout.billing_address.first_name : null, // Optional - Customer first name
        last_name: checkout.billing_address ? checkout.billing_address.last_name : null // Optional - Customer last name
      }
    };

        if (checkout.shipping_address) {
      shipping_address = checkout.shipping_address;
      shipping_fields = ['address1', 'address2', 'city', 'province', 'zip', 'country'];
      address = [];

        for (var idx in shipping_fields) {
        address_key = shipping_fields[idx];
        if (shipping_address[address_key]) {
          address.push(shipping_address[address_key]);
        }
      }

        if (shipping_address.zip) {
        _talkable_data.purchase.shipping_zip = shipping_address.zip;
      }
      if (address.length) {
        _talkable_data.purchase.shipping_address = address.join(', ');
      }
    }

        _talkableq.push(['register_purchase', _talkable_data]);
  }
</script>
<script async src="//d2jjzw81hqbuqv.cloudfront.net/integration/clients/<YOUR-TALKABLE-SITE-ID>.min.js" type="text/javascript"></script>
<!-- End Talkable integration code -->
```

> **Note:**
>
> Replace **<YOUR-TALKABLE-SITE-ID>** with your Talkable Site ID which is displayed on the integration page.

  * Click “Save”.

11. Verify your integration using [Verifying Integration instructions](https://docs.talkable.com/integration/verify.md#integration-verify).
> **Important:**
>
> If you are managing the Shopify theme code using a [Shopify Github integration](https://shopify.dev/docs/storefronts/themes/tools/github),
> make sure to pull the changes to the theme made by the automatic integration to avoid
> resetting them with a commit.

### For Shopify vintage themes

If your Shopify store uses a [vintage theme](https://help.shopify.com/en/manual/online-store/themes/managing-themes/versions),
please follow the instructions below.

1. Provide a valid Shopify store URL and choose “Shopify” as your platform during registration process

2. On the Welcome screen click “I’m a Developer”

3. Pass Shopify authorization

4. You will be redirected to your Shopify store, log in and click the install button

5. After successful installation you will be redirected back to Talkable

6. Click “Integrate manually“

7. In your Shopify Admin, add the integration to your layout:

  1. Create a snippet:

    * Go to **Online Store** → **Themes**

    * Click **Actions** (”…” button) → **Edit code**

    * Go to **Snippets**

    * Click “Add a new snippet“

    * Create a new snippet called talkable-partial

    * In the newly created file, add the following code:

```html
<!-- Begin Talkable integration code -->
<script type="text/javascript">
  window._talkableq = window._talkableq || [];
  {% if customer %}
    window._talkableq.push(['authenticate_customer', {
      email:        '{{ customer.email }}',
      phone_number: '{{ customer.phone }}',
      first_name:   '{{ customer.first_name }}',
      last_name:    '{{ customer.last_name }}'
    }]);
  {% endif %}
</script>
<script async src="//d2jjzw81hqbuqv.cloudfront.net/integration/clients/<YOUR-TALKABLE-SITE-ID>.min.js" type="text/javascript"></script>
<!-- End Talkable integration code -->
```

> **Note:**
>
> Replace **<YOUR-TALKABLE-SITE-ID>** with your Talkable Site ID which is displayed on the integration page.

    * Click “Save”

  2. Render the snippet in the layout:

    * In the theme code editor (**Online Store** → **Themes** → **Edit code**), go to **Layout**

    * Open theme.liquid file

    * Before closing </head> paste the following code:

```liquid
{% render "talkable-partial" %}
```

    * Click “Save”

8. In your Shopify Admin, create resources for referral share page:

  1. Create a share page template:

    * In the theme code editor (**Online Store** → **Themes** → **Edit code**), go to **Templates**

    * Click “Add a new template“

    * Create a new Liquid template of type page called talkable (page.talkable.liquid)

    * Paste the following code inside layout of this page instead of {{ page.content }}:

```html
<div id="talkable-offer"></div>
```

    * Click “Save”

  2. Create a page:

    * Exit theme editor if it was opened

    * Go to **Online Store** → **Pages**

    * Click “Add page“

    * Add title: Share

    * Select theme template: talkable

    * Click “Save”

9. In your Shopify Admin, create resources for referral dashboard page:

  1. Create a dashboard page template:

    * In the theme code editor (**Online Store** → **Themes** → **Edit code**), go to **Templates**

    * Click “Add a new template“

    * Create a new Liquid template of type page called dashboard.talkable (page.dashboard.talkable.liquid)

    * Paste the following code inside layout of this page instead of {{ page.content }}:

```html
{% if shop.customer_accounts_enabled %}
  {% if customer %}
    <div id="talkable-offer"></div>
  {% else %}
    {{ 'Log in' | customer_login_link }}
  {% endif %}
{% endif %}
```

    * Click “Save”

  2. Create a page:

    * Exit theme editor if it was opened

    * Go to **Online Store** → **Pages**

    * Click “Add page“

    * Add title: Referral Dashboard

    * Select theme template: dashboard.talkable

    * Click “Save” (Customer accounts must be enabled in **Settings** → **Checkout**)

10. In your Shopify Admin, add a post-purchase script:

  * Go to **Settings** → **Checkout**

  * Scroll down to **Order status page**

  * Paste the following code into **Additional scripts** field:

```html
<!-- Begin Talkable integration code -->
<script type="text/javascript">
  window._talkableq = [['init', {
    site_id: '<YOUR-TALKABLE-SITE-ID>' // REQUIRED - Replace with your Talkable Site ID
  }]];

        if (Shopify && Shopify.checkout) {
    checkout = Shopify.checkout
    var _talkable_order_items = [];
    for (idx in checkout.line_items) {
      line = checkout.line_items[idx];
      _talkable_order_items.push({
        product_id: line.sku || line.product_id, // REQUIRED - First Item Product ID
        price: line.price, // REQUIRED - First Item Unit Price
        quantity: line.quantity, // REQUIRED - First Item Quantity
        title: line.title, // Optional - Name of product
      });
    }

        var _talkable_data = {
      purchase: {
        order_number: checkout.order_id, // REQUIRED - Order number
        currency_iso_code: checkout.presentment_currency, // Optional - Purchase Currency. REQUIRED for Multi-Currency Sites
        subtotal: checkout.subtotal_price, // REQUIRED - Purchase Subtotal Price
        tax_amount: checkout.total_tax, // REQUIRED - Purchase tax amount
        discount_amount: checkout.discount ? checkout.discount.amount : null, // REQUIRED - Total Discount
        shipping_amount: checkout.shipping_rate ? checkout.shipping_rate.price : null, // REQUIRED - Total Shipping Cost
        coupon_code: checkout.discount ? checkout.discount.code : null,
        items: _talkable_order_items
      },
      customer: {
        email: checkout.email, // REQUIRED - Customer Email Address
        first_name: checkout.billing_address ? checkout.billing_address.first_name : null, // Optional - Customer first name
        last_name: checkout.billing_address ? checkout.billing_address.last_name : null // Optional - Customer last name
      }
    };

        if (checkout.shipping_address) {
      shipping_address = checkout.shipping_address;
      shipping_fields = ['address1', 'address2', 'city', 'province', 'zip', 'country'];
      address = [];

        for (var idx in shipping_fields) {
        address_key = shipping_fields[idx];
        if (shipping_address[address_key]) {
          address.push(shipping_address[address_key]);
        }
      }

        if (shipping_address.zip) {
        _talkable_data.purchase.shipping_zip = shipping_address.zip;
      }
      if (address.length) {
        _talkable_data.purchase.shipping_address = address.join(', ');
      }
    }

        _talkableq.push(['register_purchase', _talkable_data]);
  }
</script>
<script async src="//d2jjzw81hqbuqv.cloudfront.net/integration/clients/<YOUR-TALKABLE-SITE-ID>.min.js" type="text/javascript"></script>
<!-- End Talkable integration code -->
```

> **Note:**
>
> Replace **<YOUR-TALKABLE-SITE-ID>** with your Talkable Site ID which is displayed on the integration page.

  * Click “Save”.

11. Verify your integration using [Verifying Integration instructions](https://docs.talkable.com/integration/verify.md#integration-verify).

```html
<span class="a">https://123test.myshopify.com</span>
```
> **Important:**
>
> If you are managing the Shopify theme code using a [Shopify Github integration](https://shopify.dev/docs/storefronts/themes/tools/github),
> make sure to pull the changes to the theme made by the automatic integration to avoid
> resetting them with a commit.

## Manual migrating from a vintage theme to an Online store 2.0 theme

If you have previously integrated Talkable in your vintage Shopify theme and want to migrate to a newer theme,
you need to do the following:

1. Share page migration:

  1. If you have a templates/page.talkable.liquid file, store its content elsewhere and delete the file

  2. Create a share page section:

    * In the theme code editor (**Online Store** → **Themes** → **Edit code**), go to **Sections**

    * Click “Add a new section“

    * Create a new Liquid section called talkable-campaign.liquid

    * In the newly created file, add the <div> block for the referral campaign.

```html
<div id="talkable-offer"></div>
```
            If there were any customizations in the templates/page.talkable.liquid, add them as well

    * Optionally, update the schema name to anything meaningful, for example, “Referral campaign“

    * Click “Save”

  3. Create a share page template:

    * Go to **Templates**

    * Click “Add a new template“

    * Create a new JSON template of type page called talkable (page.talkable.json)

    * Change the type of the main section to talkable-campaign

[Image]

> **Important:**
>
> The name of the section should be the same as the one you used
> in the previous step when naming your section file.

> **Important:**
>
> If your main section is disabled, remove the row that does it.

2. Dashboard page migration:

  1. If you have a templates/page.talkable-dashboard.liquid file, store its content elsewhere and delete the file

  2. Create a dashboard page section:

    * In the theme code editor (**Online Store** → **Themes** → **Edit code**), go to **Sections**

    * Click “Add a new section“

    * Create a new Liquid section called talkable-dashboard.liquid

    * In the newly created file, add the <div> block for the referral campaign.

```html
{% if shop.customer_accounts_enabled %}
  {% if customer %}
    <div id="talkable-offer"></div>
  {% else %}
    {{ 'Log in' | customer_login_link }}
  {% endif %}
{% endif %}
```
            If there were any customizations in the templates/page.talkable-dashboard.liquid, add them as well

    * Optionally, update the schema name to anything meaningful, for example, “Referral dashboard“

    * Click “Save”

  3. Create a dashboard page template:

    * Go to **Templates**

    * Click “Add a new template“

    * Create a new JSON template of type page called dashboard.talkable (page.dashboard.talkable.json)

    * Change the type of the main section to talkable-dashboard

```JSON
{
  "sections": {
    "main": {
      "type": "talkable-dashboard"
    }
  }
}
```

> **Important:**
>
> The name of the section should be the same as the one you used
> in the previous step when naming your section file.

> **Important:**
>
> If your main section is disabled, remove the row that does it.
> **Important:**
>
> If you are managing the Shopify theme code using a [Shopify Github integration](https://shopify.dev/docs/storefronts/themes/tools/github),
> make sure to pull the changes to the theme made by the automatic integration to avoid
> resetting them with a commit.
> **Note:**
>
> Also Talkable provides integration for Shopify Plus.

## Contact us

Interested in setting this up? Contact your CSM or get in touch [here](https://www.talkable.com/lets-talk-referral).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/loyalty.md
===============================================================================

# Loyalty Integration

Integrating Talkable Loyalty to e-commerce sites is done in
a few quick steps by adding the below scripts to your site.

## Integration

1. Initialize Talkable integration library.

    Add the [Talkable Initialization Script](https://docs.talkable.com/integration/loyalty/integration_components.md#integration-loyalty-integration-components-initialization-script) to your header or any template spanning every page.
> **Note:**
>
> Skip this step if you already have Talkable integrated on your site

2. Add Loyalty Dashboard.

    To host the Loyalty campaign, create a new HTML page with a standard
header/footer. The best practice is to create this page on `www.your-site.com/loyalty`

    Copy Talkable container DIV element & paste it exactly where the Talkable iframe should be rendered, similarly to the referral standalone placement:

```html
<div id="talkable-loyalty"></div>
```

3. Add Redeem Widget.

    Copy Talkable container DIV element & paste it at the checkout
exactly where the loyalty points redemption widget should render:

```html
<div id="talkable-loyalty"></div>
```
    It is recommended to add it above the discount field. Examples:

[Image]

4. Define Loyalty points redemption batches.

    Each redemption batch determines progressive point redemption options based on the available points balance of the loyalty member.
For example, 500 points would equal a discount coupon for $50 off, 1000 points would equal $100, and so on.

    For every redemption batch, please generate single-use coupons for
a certain discount amount ($50 off, $100 off, etc.) and upload all coupon lists into Talkable loyalty coupon lists.

    It is recommended to upload 100,000 single-use coupons into every coupon list.

[Image]
> **Note:**
>
> All design and loyalty campaign setup is done inside the Talkable platform,
> then via iframe loyalty campaign content is injected into the site.

## Requirements

1. User accounts. The website must support user accounts since the loyalty program is only available to logged in users.

2. Single-use coupons. Every loyalty member will have a choice of redemption batches to redeem points for a one-time discount.
When pressing a redeem button Talkable deducts points and issues a single-use coupon in return.

3. Ideally, only purchases without tax & shipping costs should be passed to Talkable.
This simplifies future refunds support as taxes and shipping costs are not refundable.

* [Integration Components](https://docs.talkable.com/integration/loyalty/integration_components.md)
  * [Initialization Script](https://docs.talkable.com/integration/loyalty/integration_components.md#initialization-script)
    * [Initialization Script Notes](https://docs.talkable.com/integration/loyalty/integration_components.md#initialization-script-notes)
  * [Talkable Container DIV](https://docs.talkable.com/integration/loyalty/integration_components.md#talkable-container-div)
    * [Loyalty Dashboard Notes](https://docs.talkable.com/integration/loyalty/integration_components.md#loyalty-dashboard-notes)
    * [Loyalty Widget Notes](https://docs.talkable.com/integration/loyalty/integration_components.md#loyalty-widget-notes)
  * [Loyalty Actions](https://docs.talkable.com/integration/loyalty/integration_components.md#loyalty-actions)
    * [Loyalty Actions Notes](https://docs.talkable.com/integration/loyalty/integration_components.md#loyalty-actions-notes)
* [Custom App for Loyalty](https://docs.talkable.com/integration/loyalty/custom_app.md)
  * [Sync loyalty actions](https://docs.talkable.com/integration/loyalty/custom_app.md#sync-loyalty-actions)
    * [Liquid variables hints](https://docs.talkable.com/integration/loyalty/custom_app.md#liquid-variables-hints)
  * [Sync loyalty tier transitions](https://docs.talkable.com/integration/loyalty/custom_app.md#sync-loyalty-tier-transitions)
    * [Liquid variables hints](https://docs.talkable.com/integration/loyalty/custom_app.md#id1)
* [Auto-Enrollment](https://docs.talkable.com/integration/loyalty/auto_enrollment.md)
  * [Post-Purchase Enrollment](https://docs.talkable.com/integration/loyalty/auto_enrollment.md#post-purchase-enrollment)
  * [Enrollment via JS Integration](https://docs.talkable.com/integration/loyalty/auto_enrollment.md#enrollment-via-js-integration)
    * [Code Example #1:](https://docs.talkable.com/integration/loyalty/auto_enrollment.md#code-example-1)
    * [Code Example #2:](https://docs.talkable.com/integration/loyalty/auto_enrollment.md#code-example-2)
* [Shopify Integration](https://docs.talkable.com/integration/loyalty/shopify_integration.md)
  * [Automatic integration](https://docs.talkable.com/integration/loyalty/shopify_integration.md#automatic-integration)
  * [Manual integration](https://docs.talkable.com/integration/loyalty/shopify_integration.md#manual-integration)
  * [Manual migrating from a vintage theme to an Online store 2.0 theme](https://docs.talkable.com/integration/loyalty/shopify_integration.md#manual-migrating-from-a-vintage-theme-to-an-online-store-2-0-theme)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/loyalty/auto_enrollment.md
===============================================================================

# Auto-Enrollment

Talkable allows to enroll users to loyalty without showing the loyalty dashboard page.

There are a couple of ways to do that:

* [Post-Purchase Enrollment](#post-purchase-enrollment)

* [Enrollment via JS Integration](#enrollment-via-js-integration)

## Post-Purchase Enrollment

Enroll users to loyalty after they make a purchase.
A setting to enable this behavior can be found under **Site settings** → **Loyalty settings** → **General** → **Auto-enrollment**.

## Enrollment via JS Integration

Enroll users to loyalty without showing the campaign using join_loyalty.
For example, this could be used for enrolling users during registration or login.

Don’t forget to include a consent checkbox that would inform your user that they are about to join the loyalty program.
> **Note:**
>
> join_loyalty is available since integration version 4.5.9.

### Code Example #1:

Use authenticate_customer to store current user data.

When you call join_loyalty, you can pass empty object since Talkable will have access to the data from authenticate_customer.
> **Tip:**
>
> authenticate_customer data can also be reused by other integration functions.

```js
window._talkableq.push(["authenticate_customer", {
  email: "loyalty@talkable.com", // required for `join_loyalty`
  phone_number: '+12025551111',
  first_name: "John",
  last_name: "Smith",
  custom_properties: {},
  customer_id: "11111"
}]);
window._talkableq.push("join_loyalty", {})
```

### Code Example #2:

Pass loyalty member data directly to join_loyalty.
> **Note:**
>
> Arguments passed with join_loyalty override respective arguments from authenticate_customer.

```js
window._talkableq.push(["join_loyalty", {
  email: "loyalty@talkable.com", // required
  phone_number: '+12025551111',
  first_name: "John",
  last_name: "Smith",
  custom_properties: {},
  customer_id: "11111"
}]);
```

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/loyalty/custom_app.md
===============================================================================

# Custom App for Loyalty

Talkable offers a Custom App that allows you to send Talkable data to an outside destination such as your site, ESP, or CDP.
The Custom App supports several actions. In the context of loyalty, the following actions might be useful:

* Sync loyalty actions

* Sync loyalty tier transitions

By default, the Custom App payload contains only email for loyalty-related actions.
However, it is recommended to modify the payload that will be sent when the app is triggered.

To set up a Custom App, go to **All site settings** → **App store** → **Custom app**.

## Sync loyalty actions

This feature sends Talkable data to the configured endpoint URL in the following cases:

* when a loyalty member earns points according to loyalty action configurations (eg. by subscribing to your newsletter);

* when a loyalty member earns or has points deducted due to a manual points adjustment (eg. made by a Customer Service representative);

* when a loyalty member exchanges (redeems) points for a coupon discount.

### Liquid variables hints

To determine which loyalty action triggered the Custom App, use {{ action.identifier }} liquid variable in the payload.

{{ action.identifier }} can have the following values:

* when loyalty member exchanges points for a coupon, the Action Identifier is *“redeem”*;

* when loyalty member gains or loses points due to a manual points adjustment, the Action Identifier is *“manual_adjustment”*;

* when loyalty member earns points according to loyalty action configurations, the Action Identifier varies based on the action configuration type:

  * *“optin”* for “Loyalty join”;

  * *“event”* for “Purchase points” and “Event points”;

  * *“referral”* for “Refer a friend”;

  * for a custom type, the Identifier is taken straight from the action configuration “Identifier” field.

{{ action.rule }} contains details about the action configuration that is responsible for a particular points collection.
> **Note:**
>
> {{ action.rule }} is optional for *“manual_adjustment”* actions and always blank for *“redeem”* actions.

To see the full list of available variables, click “Show available variables” on the Custom App action configuration page.

## Sync loyalty tier transitions

This feature sends Talkable data to the configured endpoint URL once a loyalty member reaches a new tier.

### Liquid variables hints

{{ tier_transition.reason }} is either *“upgrade”* or *“downgrade”*, depending on the direction of the transition.

To see the full list of available variables, click “Show available variables” on the Custom App action configuration page.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/loyalty/integration_components.md
===============================================================================

# Integration Components

Talkable Loyalty is composed of the following components:

1. [Initialization Script](#integration-loyalty-integration-components-initialization-script)

    **Script Location.** The Initialization script should be placed in the head template or some template
that spans every page. All other integration components are dependent on the Init script.

    **Data Capture.** The Initialization Script should pass variables for logged in users:

  * Email

  * Phone Number

  * First Name

  * Last Name

  * Custom Properties

  * Customer ID

2. [Talkable Container DIV](#talkable-container-div)

    **DIV Location.** Talkable Container DIV should be placed in the body of every page where you want to show a loyalty campaign. This DIV tag determines the place where the campaign is shown.

3. [Loyalty Actions](#loyalty-actions)

## Initialization Script

The Initialization script should be placed in the head template or some
template that spans every page. Talkable JS library size is typically
around 20kB and causes no noticeable impact to your site’s loading time.
All other integration components are dependent on the Initialization
script.

```html
<!-- Begin Talkable integration code -->
<script async src="https://d2jjzw81hqbuqv.cloudfront.net/integration/clients/<YOUR-TALKABLE-SITE-ID>.min.js"></script>
<script>
  window._talkableq = window._talkableq || [];
  window._talkableq.unshift(['init', { site_id: '<YOUR-TALKABLE-SITE-ID>' }]);

  window._talkableq.push(['authenticate_customer', {
    email: '', // required, loyalty program is only available to logged in users. Example: 'customer@example.com'
    phone_number: '' // Optional, pass when available. Example: '+12025551111'
    customer_id: '11111' // Optional, Customer ID inside your system
  }]);
</script>
<!-- End Talkable integration code -->
```


### Initialization Script Notes

1. **Site ID.** You can obtain your Site ID by logging into the Talkable
platform where Site ID is displayed on your Dashboard and URL as seen
here:

[Image]

2. **Variables.** Use your dynamic variables to pass user details.

## Talkable Container DIV

Add the following Talkable Container DIV in the body of every page where you want a loyalty campaign to be shown:

```html
<div id="talkable-loyalty"></div>
```
The [Talkable Initialization Script](#integration-loyalty-integration-components-initialization-script) must be present in your head template in order for the Loyalty Dashboard to work. The placement of the DIV tag is important since it’s going to determine where the campaign will be rendered.
> **Note:**
>
> The same DIV tag is used for both Loyalty Dashboard and Loyalty Redeem Widget.
> You can find more info about where to place the DIV tag in [Loyalty Dashboard Placement](https://docs.talkable.com/campaigns/campaign_placements/loyalty_dashboard.md#campaigns-campaign-placements-loyalty-dashboard) and [Loyalty Widget Placement](https://docs.talkable.com/campaigns/campaign_placements/loyalty_widget.md#campaigns-campaign-placements-loyalty-widget).

### Loyalty Dashboard Notes

The dashboard can be added inline inside your user accounts menu, however the dashboard content width for proper display is 980px.

### Loyalty Widget Notes

Add Talkable Container DIV at the checkout exactly where the loyalty points redemption widget should be rendered.

## Loyalty Actions

To register custom loyalty actions (e.g. completing surveys, adding reviews, uploading something on site),
use the following code:

```html
<script>
  window._talkableq.push(['register_loyalty_action', {
    rule_identifier: '', // required, can be found in Campaign Rules -> Loyalty action configurations -> "identifier" field
    traffic_source: '' // optional
  }]);
</script>
```


### Loyalty Actions Notes

1. register_loyalty_action optionally accepts email and custom_properties. If none provided, values will be
taken from respective parameters of authenticate_customer. Email must be provided in either of the sources to
register loyalty actions.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/loyalty/shopify_integration.md
===============================================================================

# Shopify Integration

## Automatic integration

After passing [Shopify authorization](https://docs.talkable.com/integration/ecommerce_platforms/shopify.md#integration-ecommerce-platforms-shopify-automatic-integration),
Loyalty page will be located at /pages/loyalty.

To turn Loyalty integration on/off, navigate to Talkable Shopify Integration page https://admin.talkable.com/sites/<YOUR-TALKABLE-SITE-ID>/integration/shopify

## Manual integration

1. Pass Shopify authorization

2. You will be redirected to your Shopify store, log in and click the Install button

3. After successful installation you will be redirected back to Talkable

4. Click “Integrate manually“

5. Set up Referral Integration [manually](https://docs.talkable.com/integration/ecommerce_platforms/shopify.md#integration-ecommerce-platforms-shopify-manual-integration)

6. In your Shopify Admin create resources for loyalty dashboard page:

  1. Create a loyalty dashboard page section:

    * In the theme code editor (**Online Store** → **Themes** → **Edit code**), go to **Sections**

    * Click “Add a new section“

    * Create a new Liquid section called talkable-loyalty-dashboard.liquid

    * In the newly created file, add the following code:

```html
{% if shop.customer_accounts_enabled %}
  <div id="talkable-loyalty"></div>
{% endif %}
```

    * Optionally, update the schema name to anything meaningful, for example, “Loyalty dashboard“

    * Click “Save”

  2. Create a loyalty dashboard page template:

    * Go to **Templates**

    * Click “Add a new template“

    * Create a new JSON template of type page called loyalty_dashboard.talkable (page.loyalty_dashboard.talkable.json)

    * Change the type of the main section to talkable-loyalty-dashboard

```JSON
{
  "sections": {
    "main": {
      "type": "talkable-loyalty-dashboard"
    }
  }
}
```

> **Important:**
>
> The name of the section should be the same as the one you used
> in the previous step when naming your section file.

> **Important:**
>
> If your main section is disabled, remove the row that does it.

  3. Create a page:

    * Exit theme editor if it was opened

    * Go to **Online Store** → **Pages**

    * Click “Add page“

    * Add title: Loyalty Dashboard

    * Select theme template: loyalty_dashboard.talkable

    * Click “Save”

## Requirements

User accounts. The website must support user accounts since the loyalty program is only available to logged in users.

## Manual migrating from a vintage theme to an Online store 2.0 theme

If you have previously integrated Talkable in your vintage Shopify theme and want to migrate to a newer theme,
you need to do the following:

1. [Migrate the referral pages](https://docs.talkable.com/integration/ecommerce_platforms/shopify.md#integration-ecommerce-platforms-shopify-manual-integration-theme-migration)

2. If you have a templates/page.talkable-loyalty-dashboard.liquid file, store its content elsewhere and delete the file

3. Create a loyalty dashboard page section:

  * In the theme code editor (**Online Store** → **Themes** → **Edit code**), go to **Sections**

  * Click “Add a new section“

  * Create a new Liquid section called talkable-loyalty-dashboard.liquid

  * In the newly created file, add the following code:

```html
{% if shop.customer_accounts_enabled %}
  <div id="talkable-loyalty"></div>
{% endif %}
```
        If there were any customizations in the templates/page.talkable-loyalty-dashboard.liquid, add them as well

  * Optionally, update the schema name to anything meaningful, for example, “Loyalty dashboard“

  * Click “Save”

4. Create a loyalty dashboard page template:

  * Go to **Templates**

  * Click “Add a new template“

  * Create a new JSON template of type page called loyalty_dashboard.talkable (page.loyalty_dashboard.talkable.json)

  * Change the type of the main section to talkable-loyalty-dashboard

```JSON
{
  "sections": {
    "main": {
      "type": "talkable-loyalty-dashboard"
    }
  }
}
```

> **Important:**
>
> The name of the section should be the same as the one you used
> in the previous step when naming your section file.

> **Important:**
>
> If your main section is disabled, remove the row that does it.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/standard.md
===============================================================================

# Standard Integration

## Integration High Level Overview

1. Add the [Talkable Initialization Script](https://docs.talkable.com/integration/standard/integration_components.md#integration-standard-integration-components-initialization-script) to your header or any template spanning every page.
Surface variables for email and name if user is logged in.

2. Add the [Talkable Post Purchase Script](https://docs.talkable.com/integration/standard/integration_components.md#integration-standard-integration-components-post-purchase-script) to your checkout confirmation page to pass purchase details
to Talkable for all purchases.
Surface purchase detail variables as described in more detail in [Integration Components](https://docs.talkable.com/integration/standard/integration_components.md#integration-standard-integration-components).

3. Create a new HTML page with standard header/footer to host the Talkable Standalone campaign
which will be your Advocate Landing page where you can drive traffic from email and other onsite
and offsite locations to refer friends. Copy & paste the Talkable container DIV element into the
body as seen in [Integration Components](https://docs.talkable.com/integration/standard/integration_components.md#integration-standard-integration-components).

4. Create an additional new HTML page attached to your user accounts section (if you have one) behind
login which is where referring Advocates can go to view referral details of all of the friends
they’ve shared with. Copy & paste the Talkable container DIV element into the body as seen in [Integration Components](https://docs.talkable.com/integration/standard/integration_components.md#integration-standard-integration-components).

* [Integration High-Level Overview](https://docs.talkable.com/integration/standard/overview.md)

## Contents:

* [Integration Components](https://docs.talkable.com/integration/standard/integration_components.md)
  * [Initialization Script](https://docs.talkable.com/integration/standard/integration_components.md#initialization-script)
  * [Post Purchase Script](https://docs.talkable.com/integration/standard/integration_components.md#post-purchase-script)
  * [Advocate Landing Page](https://docs.talkable.com/integration/standard/integration_components.md#advocate-landing-page)
  * [Referral Dashboard](https://docs.talkable.com/integration/standard/integration_components.md#referral-dashboard)
* [Verifying Integration](https://docs.talkable.com/integration/verify.md)
  * [Verifying Integration in JS SPAs](https://docs.talkable.com/integration/verify.md#verifying-integration-in-js-spas)
  * [Troubleshooting](https://docs.talkable.com/integration/verify.md#troubleshooting)

* [Validating the Integration](https://docs.talkable.com/integration/standard/validating_integration.md)
  * [Visual Confirmation Note](https://docs.talkable.com/integration/standard/validating_integration.md#visual-confirmation-note)
  * [Validation Checklist](https://docs.talkable.com/integration/standard/validating_integration.md#validation-checklist)
  * [How to create or check for existing campaigns](https://docs.talkable.com/integration/standard/validating_integration.md#how-to-create-or-check-for-existing-campaigns)
  * [Test Mode Display](https://docs.talkable.com/integration/standard/validating_integration.md#test-mode-display)
* [Cookies](https://docs.talkable.com/integration/standard/cookies.md)
  * [Understanding the Cookies We Use](https://docs.talkable.com/integration/standard/cookies.md#understanding-the-cookies-we-use)
  * [GDPR and CCPA compliance](https://docs.talkable.com/integration/standard/cookies.md#gdpr-and-ccpa-compliance)
* [F.A.Q.](https://docs.talkable.com/integration/standard/questions.md)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/standard/alternate_post_purchase.md
===============================================================================

# Alternate Post Purchase Script for cart line item passing

```html
<!-- Begin Talkable integration code -->
<script>
  window._talkableq = window._talkableq || [];
  var _talkable_purchase_items = [];

  // Start for loop
  _talkable_purchase_items.push({
    product_id: '', // Required — Item Product ID. Example: 'sku0001'
    price: '', // Required — Item Unit Price. Example: '199.00'
    quantity: '', // Required — Item Quantity. Example: '1'
    title: '', // Optional — Name of product. Example: 'Product Name'
    url: '', // Optional — URL for product. Example: 'http://www.store.com/product1'
    image_url: '' // Optional — URL for product image. Example: 'http://www.store.com/product1/image.jpg'
  });
  // End for loop

  var _talkable_data = {
    purchase: {
      order_number: '', // Required - Unique order number. Example: '100011'
      subtotal: '', // Required - Order subtotal (pre-tax, post-discount). Example: '23.97'
      coupon_code: '', // Coupon code that was used at checkout (pass multiple as an array). Example: 'SAVE20'
      currency_iso_code: '', // Required for multi-currency sites. Example: 'USD'
      shipping_zip: '', // Used for fraud protection by address. Example: '02222'
      shipping_address: '', // Full address of the order, make sure to strictly follow a format: 'Apt #, Street address, City, State, ZIP, Country'
      items: _talkable_purchase_items // Cart items declared in the example above
      segment1: '', // Segment 1: Represents custom segment (e.g., location, age group, source channel, platform, gender, interests).
      segment2: '', // Segment 2: Represents custom segment (e.g., location, age group, source channel, platform, gender, interests).
      segment3: '', // Segment 3: Represents custom segment (e.g., location, age group, source channel, platform, gender, interests).
    },
    customer: {
      email: '', // Required - Email of the customer who issued a purchase. Example: 'customer@example.com'
      traffic_source: '', // The source of the traffic driven to the campaign. Example: 'facebook'
      phone_optin: false, // Indicates whether the customer has provided consent for phone opt-in. The value should be boolean. If set to true, a valid phone number must be provided.
      email_optin: false // Indicates whether the customer has provided consent for email opt-in. The value should be boolean.
    }
  };

  window._talkableq.push(['register_purchase', _talkable_data]); // Pass data to Talkable and show Post Purchase campaign as a result
</script>
<!-- End Talkable integration code -->
```

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/standard/cookies.md
===============================================================================

# Cookies

At Talkable, we prioritize enhancing your digital experience.
Our use of cookies is instrumental in this endeavor, as they play a critical role in tracking referrals and conversions, personalizing content, and maintaining the overall performance and reliability of our services.

## Understanding the Cookies We Use

We broadly categorize our cookies and similar technologies as follows:

**Strictly Necessary**

These cookies and other technologies are essential to enabling your use of our Site and Services and its features.
Without these cookies, key functionalities (like sign-up processes) would be unfeasible.
These cookies may be associated with personal data.

**Functionality**

These cookies and other technologies improve your experience by enabling personalization (like remembering language and region).
They can help you fill out forms on our campaigns more easily.
These cookies may be associated with personal data.

**Analytics and Performance**

These cookies and other technologies help us learn how well our Campaigns and Services are performing.
We use these cookies to understand, improve, and research our Site and Services.

| Cookie name                                                       | Purpose                   | Domain(s)                  | Retention period(Days) |
| ----------------------------------------------------------------- | ------------------------- | -------------------------- | ---------------------- |
| `tkbl_session_id`                                                 | Strictly Necessary        | talkable.com   shop domain | 0                      |
| `tkbl_session`                                                    | Functionality             | talkable.com   shop domain | 400                    |
| `tkbl_cvuuid`                                                     | Functionality             | talkable.com   shop domain | 400                    |
| [multiple](https://newrelic.com/termsandconditions/cookie-policy) | Analytics and Performance | \*.newrelic.com            | 0-400                  |
| `bugsnag*`                                                        | Analytics and Performance | \*.bugsnag.com             | 0-400                  |
| `_ga`                                                             | Analytics and Performance | talkable.com               | 400                    |

## GDPR and CCPA compliance

Talkable ensures compliance with GDPR and CCPA regulations.
In compliant mode, we only set a session cookie during the first user interaction.
These session cookies, being temporary, disappear once the browser is closed.
Under GDPR and CCPA, setting such cookies does not require user consent.
Post-consent (e.g., during signup), Talkable activates standard cookies to monitor user activities, aligning with regulatory guidelines.
> **Note:**
>
> Limitations of compliance mode seriously hinders Talkable ability to track referrals and conversions.
> It is advised to use compliant mode only if you are legally obligated to do so.

To enable GDPR and CCPA compliant mode, please contact your Customer Success Manager.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/standard/integration_components.md
===============================================================================

# Integration Components

Talkable is composed of the following components:

1. [Initialization Script](#integration-standard-integration-components-initialization-script)

    **Script Location.** The Initialization script should be placed in the head template or some template
that spans every page. All other integration components are dependent on the Init script.

    **Data Capture.** The Initialization Script should pass variables for logged in users:

  * Email

  * Phone Number

  * First Name

  * Last Name

2. [Post Purchase Script](#integration-standard-integration-components-post-purchase-script)

    **Script Location.** The Post Purchase script should be placed on the checkout confirmation page.

    **Script Dependency.** The Post Purchase script should be fired after the Initialization script.

    **Data Capture.** This script needs to capture purchase based details

  * Email of purchaser

  * Order Number

  * Subtotal (pre-tax, post-discount amount)

  * Coupon code(s) used at checkout (can accept an array of strings if you allow for multiple coupons to
be applied at checkout)

  * Currency ISO code. It is required for multi-currency sites.

  * (optional) Shipping Address for additional fraud protection.

  * (optional) Shopping cart line items. This is only necessary if segmenting based on cart contents.

  * (optional) Segments (segment1, segment2, segment3). Custom attribute for segmenting purchases by value (e.g., location, age group, source channel, platform, gender, interests).

3. In case your business has one-time purchases and subscription model, or you are in SaaS
business we recommend integrating through Events. [Learn more](https://docs.talkable.com/advanced_features/events.md#advanced-features-events).

4. [Advocate Landing Page](#integration-standard-integration-components-advocate-landing-page).

    Create an HTML page (URL path /share) with your standard site header and footer.
Add the Talkable Container DIV in the body. This tells Talkable where to inject content.

5. [Referral Dashboard (my account)](#integration-standard-integration-components-referral-dashboard).

    Similar to the advocate landing page, create an HTML page that’s linked to from a menu in user accounts.
Add the Talkable Container DIV in the body. This tells Talkable where to inject content.

---




## Initialization Script

The Initialization script should be placed in the head template or some
template that spans every page. Talkable JS library size is typically
around 20kB and causes no noticeable impact to your site’s loading time.
All other integration components are dependent on the Initialization
script.

```html
<!-- Begin Talkable integration code -->
<script async src="https://d2jjzw81hqbuqv.cloudfront.net/integration/clients/<YOUR-TALKABLE-SITE-ID>.min.js"></script>
<script>
  window._talkableq = window._talkableq || [];
  window._talkableq.unshift(['init', { site_id: '<YOUR-TALKABLE-SITE-ID>' }]);
  window._talkableq.push(['authenticate_customer', {
    email: '', // Optional - Email of the customer, if available. Example: 'customer@example.com'
    phone_number: '', // Optional - Customer's phone number. Example: '+12025551111'
    first_name: '', // Optional - First name of the customer. Example: 'John'
    last_name: '', // Optional - Last name of the customer. Example: 'Smith'
    traffic_source: '', // Optional - Traffic source that led to the campaign. Example: 'facebook'
    segment1: '', // Optional - Custom segment (e.g., location, age group, source channel, platform, gender, interests).
    segment2: '', // Optional - Custom segment (e.g., location, age group, source channel, platform, gender, interests).
    segment3: '' // Optional - Custom segment (e.g., location, age group, source channel, platform, gender, interests).
  }]);
</script>
<!-- End Talkable integration code -->
```
In this example, segment1, segment2, and segment3 attributes are passed through authenticate_customer to enable segmentation without requiring an Origin creation.
> **Note:**
>
> Segments can also be passed in register_affiliate, register_purchase, and register_event, providing flexibility for different integration scenarios.

This approach simplifies custom data handling for customers, allowing for unified data across various methods and optimizing segmentation management without additional calls.

### Initialization Script Notes

1. **Site ID.** You can obtain your Site ID by logging into the Talkable
platform where Site ID is displayed on your Dashboard and URL as seen
here:

[Image]

2. **Variables.** Use your dynamic variables to pass user details {email,
first_name, last_name} if the user is logged in and the data
exists. If the data does not exist, you can pass a null value or a
blank string. If your website doesn’t have a user accounts section
and this info is never available, it’s acceptable to completely omit
the parameters, or pass empty strings.

---




## Post Purchase Script

The post purchase script should be placed on your checkout confirmation
page or any page that immediately follows checkout. All parameters can
be passed as strings. A Number can be passed for subtotal, however, if
using any calculation, you’re responsible for ensuring that some number is
passed where division by zero or null value does not occur.

```html
<!-- Begin Talkable integration code -->
<script>
  window._talkableq = window._talkableq || [];
  var _talkable_data = {
    purchase: {
      order_number: '', // Required - Unique order number. Example: '100011'
      subtotal: '', // Required - Order subtotal (pre-tax, post-discount). Example: '23.97'
      coupon_code: '', // Coupon code that was used at checkout (pass multiple as an array). Example: 'SAVE20'
      currency_iso_code: '', // Required for multi-currency sites. Example: 'USD'
      shipping_zip: '', // Used for fraud protection by address. Example: '02222'
      shipping_address: '', // Full address of the order, make sure to strictly follow a format: 'Apt #, Street address, City, State, ZIP, Country'
      segment1: '', // Segment 1: Represents custom segment (e.g., location, age group, source channel, platform, gender, interests).
      segment2: '', // Segment 2: Represents custom segment (e.g., location, age group, source channel, platform, gender, interests).
      segment3: '', // Segment 3: Represents custom segment (e.g., location, age group, source channel, platform, gender, interests).
    },
    customer: {
      email: '', // Required - Email of the customer who issued a purchase. Example: 'customer@example.com'
      traffic_source: '', // The source of the traffic driven to the campaign. Example: 'facebook'
      phone_optin: false, // Indicates whether the customer has provided consent for phone opt-in. The value should be boolean. If set to true, a valid phone number must be provided.
      email_optin: false // Indicates whether the customer has provided consent for email opt-in. The value should be boolean.
    }
  };
  window._talkableq.push(['register_purchase', _talkable_data]);
</script>
<!-- End Talkable integration code -->
```


### Post Purchase Script Notes

1. Mandatory parameters must be passed or the purchase will not be
passed to Talkable. Mandatory parameters are: email, order_number, subtotal

2. coupon_code is not mandatory, but it’s preferred to be passed via the script, since some of the fraud checks and referral tracking methods rely on those

3. Shipping parameters are optional but gives the added benefit of
additional fraud protection

4. If you’re using a payment gateway that directs the user away from
your domain, you should ensure that some auto return feature is
enabled so that the user returns to the checkout confirmation page to
allow the post purchase script to run.

5. If you’re using a tag manager [click here](https://docs.talkable.com/integration/standard/integration_tag_manager.md#integration-standard-integration-tag-manager).

6. If you need to pass shopping cart line items, to see the alternate
post purchase integration script [click here](https://docs.talkable.com/advanced_features/product_items.md#advanced-features-product-items).

7. For individual purchase segmentation, you have the option to utilize one of three custom
segments: segment1, segment2, segment3.
These segments can represent various criteria such as location, age group, traffic source, etc.
> **Note:**
>
> All PII params support data encryption. Find more about [Params Encryption](https://docs.talkable.com/advanced_features/params_encryption.md#advanced-features-params-encryption).

## Advocate Landing Page

Create a new HTML page with URL path (www.your-site.com/share) and add the Talkable Container DIV
in the body of the page between your standard site header and footer:
> **Note:**
>
> The Talkable Container DIV id can be changed upon request to the Talkable team.
> The current DIV id value for each Event Category can be found on the Placements page.

```html
<div id="talkable-offer"></div>
```


### Advocate Landing Page Notes

1. The Talkable Initialization script must be present in your head
template in order for the advocate landing page to work

2. Talkable will inject referral content where Talkable Container
resides in your DOM

3. URL Path: If you can’t use URL path www.your-site.com/share then
you’ll need to update the Site Placements section inside of Talkable
for the Invite Advocate Landing Page to match the exact URL path that
you intend to use via https://admin.talkable.com/sites/<YOUR-TALKABLE-SITE-ID>/placements

[Image]

---




## Referral Dashboard

Similar to the Advocate Landing Page, create a new HTML page with URL
path (www.your-site.com/referrals) and add the Talkable Container DIV in
the body of the page:
> **Note:**
>
> The Talkable Container DIV id can be changed upon request to the Talkable team.
> The current DIV id value for each Event Category can be found on the Placements page.

```html
<div id="talkable-offer"></div>
```


### Referral Dashboard Notes

1. The [Talkable Initialization Script](#integration-standard-integration-components-initialization-script) must be present in your head
template in order for the referral dashboard to work

2. Talkable will inject referral content where Talkable Container
resides in your DOM. Adding a new page is only a suggestion. The
dashboard can be added inline inside your user accounts menu, however
the dashboard content width for proper display is 980px.

3. **URL Path.** If you don’t host on www.your-site.com/referrals then
you’ll need to update the Site Placements section inside of Talkable
for the Dashboard Placement to use the exact URL path you intend to
host the Referral Dashboard on via https://www.talkable.com/sites/<YOUR-TALKABLE-SITE-ID>/placements

4. **Linking to the Referral Dashboard.** Allow your users to reach the
Referral Dashboard by adding a link from any place that makes sense
considering your website configuration. Most common uses are links in
the user accounts section, or from the user accounts menu.

5. **Host on a page that’s only accessible behind login.** The Referral
Dashboard contains semi-sensitive information about an Advocate’s
referral history. If you don’t have user logins, then the Referral
Dashboard can be configured to display partially obfuscated data for
public access.

* [Alternate Post Purchase Script for cart line item passing](https://docs.talkable.com/integration/standard/alternate_post_purchase.md)
* [Integrating with a Tag Manager](https://docs.talkable.com/integration/standard/integration_tag_manager.md)
  * [Potential Performance Impact](https://docs.talkable.com/integration/standard/integration_tag_manager.md#potential-performance-impact)
  * [Best Practices for Speed Optimization](https://docs.talkable.com/integration/standard/integration_tag_manager.md#best-practices-for-speed-optimization)
  * [Alternative Approach: Direct Integration](https://docs.talkable.com/integration/standard/integration_tag_manager.md#alternative-approach-direct-integration)
  * [Verifying success](https://docs.talkable.com/integration/standard/integration_tag_manager.md#verifying-success)
  * [Removing the Talkable Integration Script from GTM](https://docs.talkable.com/integration/standard/integration_tag_manager.md#removing-the-talkable-integration-script-from-gtm)
  * [Helpful Links](https://docs.talkable.com/integration/standard/integration_tag_manager.md#helpful-links)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/standard/integration_tag_manager.md
===============================================================================

# Integrating with a Tag Manager

* Initialization Script in a Tag Manager: Place the [Initialization Script](https://docs.talkable.com/integration/standard/integration_components.md#integration-standard-integration-components-initialization-script) in a tag that is
visible in the head template on all pages.

* Post Purchase Integration in a Tag Manager: Since the post
purchase integration on the checkout confirmation page requires the
Init script to work, you’re welcome to combine the [Initialization Script](https://docs.talkable.com/integration/standard/integration_components.md#integration-standard-integration-components-initialization-script) + [Post Purchase Script](https://docs.talkable.com/integration/standard/integration_components.md#integration-standard-integration-components-post-purchase-script) script into a
single tag for the checkout confirmation page. In fact this is
recommended for Google Tag Manager, when combining the place the
Initialization script on top/before the Post purchase script in the
tag.

* Tag Manager Data Layer to Pass Variables: You’ll need to
ensure a data layer object is set up to collect and pass the
variables to Talkable inside your tag.

* Troubleshooting: You can use window._talkableq for all talkableq variable instances if you’re having trouble with variable
interpolation and need to use a global namespace.

## Potential Performance Impact

This section addresses two key considerations for integrating Talkable using Google Tag Manager (GTM):

**1. Potential Performance Impact:**

* In some cases, using GTM to load the Talkable integration code can introduce a slight delay in the referral program’s functionality. This is because GTM typically waits for all its tags to load before executing them.

* If you’ve identified performance concerns related to the Talkable integration’s load time, consider the alternative approach outlined below.

**2. Safari Private Mode Blocking Third-Party Vendors:**

* A known issue exists where Safari in private mode blocks third-party vendors, including GTM. This can prevent the Talkable integration code from loading entirely, hindering the referral program’s operation.

## Best Practices for Speed Optimization

1. Make sure the campaign uses optimized image/file sizes and upload lower-resolution versions if it is.

2. There should be only one copy of the Initialization script on the page. Delete all duplicates if there are any.

3. Make sure you don’t have JS errors from code executed before Talkable. If there is some critical error, the browser may not be able to process Talkable scripts quickly.

4. Implementing a custom domain for your integration won’t directly increase its speed, but it will significantly reduce issues related to incognito mode and security policies blocking for third-party content.
> **Note:**
>
> If you use GTM, you can add [priority](https://support.google.com/tagmanager/answer/2772421) to the tag. The higher the priority, the quicker it gets loaded.

[Image]

## Alternative Approach: Direct Integration

To mitigate these potential issues, you can integrate Talkable directly into your web pages without using GTM. Here’s a step-by-step guide on [Custom Integration](https://docs.talkable.com/integration/standard/integration_components.md#integration-standard-integration-components).

**Benefits of Direct Integration:**

* **Improved Performance:** Eliminates the delay associated with GTM loading all tags before execution.

* **Enhanced Compatibility:** Ensures the Talkable integration code loads even in Safari private mode, where GTM might be blocked.

**Choosing the Right Approach:**

The optimal approach depends on your specific priorities:

* If performance is a critical concern, direct integration is generally recommended.

* If you prefer a more centralized tag management system for other integrations, GTM might still be suitable, but be aware of the potential performance impact and Safari private mode blocking.

**Additional Considerations:**

* Thoroughly test both approaches (GTM and direct integration) to ensure the Talkable referral program functions as expected in all browsers and scenarios.

* If you encounter further issues, check Talkable’s support resources or contact support team for assistance.

## Verifying success

1. Open Talkable admin, open or create Floating widget campaign. Scroll down to the Placements section and click on the eye button. It will open up your site with the Talkable campaign shown in test mode.

2. Submit purchase through your site.

3. Open Talkable admin, go to Reports → Purchases and find your purchase in the list.

4. Visit the Standalone page you created for the site, it should be showing up within 1-3 seconds.

## Removing the Talkable Integration Script from GTM

If you’ve decided to remove the Talkable integration script from GTM, follow these steps:

1. Log in to your Google Tag Manager account.

2. Locate the Talkable integration tag (usually named “Talkable Integration” or similar).

3. Click on the tag to open its details.

4. Click the “Delete” button to remove the Talkable integration tag.

**Important Note:** After removing the Talkable integration script from GTM, you’ll need to implement the [direct integration approach](https://docs.talkable.com/integration/standard/integration_components.md#integration-standard-integration-components) documented earlier to ensure Talkable functionality on your website.
> **Note:**
>
> Talkable doesn’t recommend adding integration as tags in Google Tag Manager because of slow loading of campaigns for certain user agents as well as GTM being blocked by some Ad blockers

## Helpful Links

* [How to make campaigns load faster?](https://talkable.freshdesk.com/support/solutions/articles/43000682297-how-to-make-campaigns-load-faster-)

* [How to integrate with a Tag Manager](https://talkable.freshdesk.com/support/solutions/articles/43000628861-how-to-integrate-with-a-tag-manager)

* [GTM tag prioritization](https://support.google.com/tagmanager/answer/2772421)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/standard/overview.md
===============================================================================

# Integration High-Level Overview

Integrating Talkable referral marketing platform to e-commerce sites is done in
a few quick steps by adding the below scripts to your site.
> **Note:**
>
> All design and referral campaign setup is done inside the Talkable platform,
> then via ‘iframe’ referral campaign content is injected into the e-commerce
> site. The below scripts also handle the collection of specific necessary user
> data for Talkable to service the referral campaigns.
>
> Site-specific integration scripts are found after logging in at `https://admin.talkable.com/sites/<YOUR-TALKABLE-SITE-ID>/integration/other`

## Integration Steps

1. Add the [Talkable Initialization Script](https://docs.talkable.com/integration/standard/integration_components.md#integration-standard-integration-components-initialization-script) to your header or any template spanning every page. Surface variables for
email and name if the user is logged in.

2. Add the [Talkable Post Purchase Script](https://docs.talkable.com/integration/standard/integration_components.md#integration-standard-integration-components-post-purchase-script) to your checkout confirmation page to pass purchase details to Talkable for
all purchases.

    Surface purchase detail variables as described in more detail in [Integration Components](https://docs.talkable.com/integration/standard/integration_components.md#integration-standard-integration-components).
> **Note:**
>
> If a business has both one-time purchases and subscription transactions, or
> the business has a strictly subscription or SaaS model we recommend integrating
> the ‘Post Purchase’ through Events. [Learn more](https://docs.talkable.com/advanced_features/events.md#advanced-features-events).
>
> Post Purchase step is the only step which changes for subscription business
> model integration - other steps remain the same.

3. To host the Invite Standalone campaign, create a new HTML page with standard
header/footer. Best practice is to create this page on `www.your-site.com/share`

    The Invite Standalone campaign will be your landing page to drive traffic to
from marketing email and other onsite and offsite locations to refer friends.
Copy & paste the Talkable container DIV element into the body as seen in [Integration Components](https://docs.talkable.com/integration/standard/integration_components.md#integration-standard-integration-components).

```html
<div id="talkable-offer"></div>
```

4. To host the Advocate Dashboard Standalone campaign, create an additional new
HTML page under your user accounts section behind login.

    This Advocate Dashboard Standalone page allows Advocates to view referral
details for the friends they’ve shared with. Copy & paste the Talkable container
DIV element into the body as seen in [Integration Components](https://docs.talkable.com/integration/standard/integration_components.md#integration-standard-integration-components).

```html
<div id="talkable-offer"></div>
```

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/standard/questions.md
===============================================================================

# F.A.Q.

1. [Does the post purchase script need to capture all purchases or just Talkable purchases?](#integration-standard-questions-post-purchase-capture)

2. [How does referral tracking work?](#integration-standard-questions-how-does-referral-tracking-work)

3. [What does the Talkable integration do?](#integration-standard-questions-what-does-the-talkable-integration-do)

4. [How does Talkable know where to display content?](#integration-standard-questions-talkable-know-where-to-display-content)

5. [What do I, as a developer, need to do to complete integration?](#integration-standard-questions-complete-integration)

6. [How does the rewarding process work?](#integration-standard-questions-rewarding-process-work)

7. [How do I verify success?](#integration-standard-questions-verify-success)

**1. Does the post purchase script need to capture all purchases or
just Talkable purchases?**

The post purchase script needs to capture all purchases. This not only
simplifies the integration by removing any logic you need to perform on
your end to determine if a purchase is referral related but is required
so that Talkable can perform referral tracking which happens after the
purchase is captured. Talkable also reports on referral related sales
metrics to display what % of total sales referrals is responsible for
along with other sales related metrics.

**2. How does referral tracking work?**

Talkable automatically handles all referral tracking, so there’s nothing
special you need to do as a developer. Talkable tracks referrals by at
least 1 of 3 possible tracking methods: {cookie, coupon code, and
email}. The most common tracking method is cookie, so if your ecommerce
platform is unable to surface coupon code as a parameter to pass at
checkout, then that’s fine as Talkable will still be able to track the
referral.

**3. What does the Talkable integration do?**

* Displays Refer-A-Friend content inside a Talkable generated iframe
either as an overlay or inline

* Handles all button click events, and mobile responsive resizing

* Tracks referral attribution automatically

* Blocks self-referral and gaming of the system

* Handles all other referral related logic and communications

  * Decides where to show content on your website based on rules
defined inside of the Talkable platform

  * Sends referral p2p and reward emails on your behalf

**4. How does Talkable know where to display content?**

* “Placements” refer to areas of your website where referral content
should display. These rules are defined inside of the Placements
section inside the Talkable platform.

  * You can modify default placements, add additional placements, or
create various inclusion or suppression rules in the Talkable
Placements section. This allows for future placement modification
with minimal to zero developer work required.

  * See Talkable Placements documentation for more details: [Campaign Placements](https://docs.talkable.com/campaigns/campaign_placements.md#campaigns-campaign-placements)

* Talkable looks at the URL to determine display as defined by rules in
the Placements section. Most integrations will be able to use default
placements where no modification is necessary inside the Talkable
platform.

* Default Placements:

  * Share Widget Campaign: All pages (inclusion and exclusion rules
can be defined)

  * Post Purchase Popup Campaign: Checkout confirmation page where the
post purchase integration script resides.

  * Advocate Landing Page Invite Campaign: URL ending in “/share”

  * Referral Dashboard Campaign: URL ending in “/referrals”

**5. What work do I, as a developer, need to do to complete
integration?**

* Surface variables, plug into integration script, and copy into the
appropriate locations.

* Create HTML pages for Advocate Landing Page and Referral Dashboard
and paste the Talkable Container DIV in the body

  * Create a link to the Referral Dashboard from your user accounts
section or drop down menu

* Validate your integration to verify success

* (optional) DNS configuration for referral link and email sending
subdomain white labeling (ask your Talkable contact to enable this)

**6. How does the rewarding process work?**

Referring Advocate Reward payout is configurable, it can be triggered
automatically based on any grace period delay, through API call when
considering returns, or through manual approval. Once a reward is
approved, Talkable sends an email that communicates/delivers the reward.
Most customers choose auto approval after a 24-48 delay, which requires
little to no attention.

Here’s how reward flow and logic works:

After Talkable tracks the referred purchase we run it through two sets
of filters: fraud filters, and then campaign qualifiers.

* Fraud filters will check for things such as self referral, cross
referral, similar email match, matching ip + device, matching
shipping address, etc.

* Campaign qualifiers are checked once fraud filters are passed. This
contains the campaign referral logic that determines when a reward is
due, such as: is the friend a new customer?, did the friend spend >
$X?, etc.

Reward approval

Once a referred purchase is qualified in passing through both of these
filters, the reward is now in a pending state and ready to be
approved/paid. Most companies turn on auto reward approval which will
auto approve the reward after some grace period. Approval can be
configured via API if return rate is abnormally high, but considering
that standard Advocate reward redemption rate is between 20-30% this is
typically not necessary.

API approval to account for returns

The way this works is that you would ping Talkable on all orders that
reach some final valid or failed state. This uses lazy logic so you
don’t need to know if a purchase is referral related or not, Talkable
will determine this. So any order# you ping us with that’s not related
to a pending referral, we’ll gracefully ignore, and any order# we
recognize as related to a pending referral, we’ll take the appropriate
action.

**7. How do I verify success?**

Refer to the section titled [Validating the Integration](https://docs.talkable.com/integration/standard/validating_integration.md#integration-standard-validating-integration).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/standard/validating_integration.md
===============================================================================

# Validating the Integration

## Visual Confirmation Note

In order to see visual confirmation you must create or have existing
Talkable campaigns. Campaigns must be enabled for visual display (see
examples below on how to enable campaigns). Note that enabling campaigns
on production will allow your customers to see referral content. If you
want to limit visual display, or want to validate on your production
site without customers seeing visual display, then see the [Test Mode Display](#integration-standard-validating-integration-test-mode-display) section below.

## Validation Checklist

1. Perform a test checkout.

    **Confirm Visual Result** You should see visual confirmation content
on the checkout confirmation page if the post purchase campaign is enabled.

    **Confirm Data Result** Navigate to Reports > Purchases tab inside
the Talkable platform to ensure all parameters that you’re using
in the post purchase script are being passed. Data populates in real time.

2. Visit your Home Page.

    **Confirm Visual Result** You should see the floating Talkable Widget button.

3. Visit your Advocate Landing Page.

    **Confirm Visual Result** You should see visual confirmation content
in the location where you placed the Talkable Container DIV.

4. Visit your Referral Dashboard Page.

    **Confirm Visual Result** You should see visual confirmation content
in the location where you placed the Talkable Container DIV.

## How to create or check for existing campaigns

You’ll need to have a campaign of each type in order to validate
display.

There are 5 types:

1. Post Purchase: displays as a pop up after checkout

2. Floating Widget: displays as a floating widget button on your home
page (and every page)

3. Invite Standalone: displays inline on your /share advocate landing
page

4. Advocate Dashboard Standalone: displays inline in your /referrals
page

5. Claim by Name displays as a floating widget button on your checkout page.
> **Note:**
>
> Claim by Name campaign has its own DIV container and can be shown along with the Floating Widget on the same page.
> The DIV id is talkable-claim-by-name.

* How to create campaigns: Here’s a video showing you how to quickly
create all campaigns in less than 1 minute [https://youtu.be/HDK-zFlCAkw](https://youtu.be/HDK-zFlCAkw)

* How to enable campaigns: Here’s a video showing you how to enable
campaigns (ignore any warnings for now and note the site display placement) [https://youtu.be/HgR6WQYeASg](https://youtu.be/HgR6WQYeASg)

## Test Mode Display

After creating campaigns, while still in test mode before activating,
you can append a URL query string parameter to page where you want to display
a campaign in test mode which prevents anyone else from seeing visual display.
Note that each campaign has campaign ID under the campaign name and you can reference
these in the URL using the following guidelines:

1. Floating widget on your homepage:

    www.your-site.com?tkbl_campaign_id=11111

2. Advocate Landing Page /share:

    www.your-site.com/share?tkbl_campaign_id=11112

3. Referral Dashboard:

    www.your-site.com/referrals?tkbl_campaign_id=11113

4. Claim by Name widget:

    www.your-site.com/cart?tkbl_campaign_id=11114 or www.your-site.com/checkouts?tkbl_campaign_id=11114

Note that campaigns must be newly created campaigns in test mode to be
eligible for test mode display. Use the following image as a visual
guideline:

[Image]

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/integration/verify.md
===============================================================================

# Verifying Integration

After installing Talkable, you should verify that the integration is working:

1. Open your homepage (assuming the Talkable init script is placed on every page,
otherwise visit the page where the initialization script was placed)
with a secret URL parameter like so:  
 https://www.site.com/?tkbl_verify_integration=true.
As a result you should see:

[Image]

2. Issue a test purchase. Order subtotal should be > 0,  
email should be integration@talkable.com. Preferably include a coupon code so we
can verify it gets passed as well. As a result you should see:

[Image]     Talkable verification dialog only appears to you, it will not be shown to anyone else.
All purchases with integration@talkable.com email will not be recorded inside Talkable.

## Verifying Integration in JS SPAs

In case you are unable to pass **?tkbl_verify_integration=true** URL parameter you can alternatively turn Talkable into “Verification mode” by setting:  
talkable.config.verify_integration = true;

All requests will now be coming with “Verification” flag turned on.

**Note:** do not use it in production, this mode is for debugging purpose only.

## Troubleshooting

In case you are not seeing the verification popup please make sure the [init script](https://docs.talkable.com/integration/standard/integration_components.md#integration-standard-integration-components-initialization-script) (non-platform integration only)
is installed on the page. You may do so by making right click  
(Chrome) → Inspect Element → Inside Elements tab press Cmd+F (Ctrl+F on Windows) and
search for d2jj → make sure the init script matches the one provided inside your
Integration tab inside Talkable Admin.

If you see the init script on the page, but the verification popup still does
not appear on the screen, make sure a request is was passed to Talkable.
To do that open  
Network tab (Chrome) → refresh the page → inside Search bar look
up for “create.html”. Make sure you see something like:

[Image]

If the request is coming through but you are still not seeing the verification
popup please contact Talkable support: [support@talkable.com](mailto:support%40talkable.com).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/ios_sdk.md
===============================================================================

# Talkable iOS SDK

Talkable has an iOS framework enabling you to use Talkable in iOS Apps. Once integrated you can use the following Talkable capabilities:

* Display Advocate Signup/Share Page (the page itself is built inside Talkable)

* Share Offer via:

  * Email

  * Facebook

  * Twitter

  * SMS

  * by copying a direct Offer link

* Track sales via the App and reward Advocate if a sale was driven thourgh someone’s claim link

## Contents:

* [Getting Started](https://docs.talkable.com/ios_sdk/getting_started.md)
  * [Requirements](https://docs.talkable.com/ios_sdk/getting_started.md#requirements)
  * [Step 1: Installation](https://docs.talkable.com/ios_sdk/getting_started.md#step-1-installation)
  * [Step 2: Configuration](https://docs.talkable.com/ios_sdk/getting_started.md#step-2-configuration)
* [Integration](https://docs.talkable.com/ios_sdk/integration.md)
  * [Standalone Campaign](https://docs.talkable.com/ios_sdk/integration/standalone.md)
  * [Post Purchase Campaign](https://docs.talkable.com/ios_sdk/integration/post_purchase.md)
  * [Custom Events](https://docs.talkable.com/ios_sdk/integration/event.md)
* [Social Sharing](https://docs.talkable.com/ios_sdk/social_sharing.md)
  * [Social Sharing from a web-based campaign](https://docs.talkable.com/ios_sdk/social_sharing.md#social-sharing-from-a-web-based-campaign)
  * [Legacy Sharing using Social.framework](https://docs.talkable.com/ios_sdk/social_sharing.md#legacy-sharing-using-social-framework)
  * [Social Sharing from a native campaign](https://docs.talkable.com/ios_sdk/social_sharing.md#social-sharing-from-a-native-campaign)
* [Native Integration via API](https://docs.talkable.com/ios_sdk/api_integration.md)
  * [1. Create an Origin](https://docs.talkable.com/ios_sdk/api_integration.md#create-an-origin)
  * [2. Create a Share](https://docs.talkable.com/ios_sdk/api_integration.md#create-a-share)
  * [3. Check for Reward](https://docs.talkable.com/ios_sdk/api_integration.md#check-for-reward)
  * [Extra Functionality](https://docs.talkable.com/ios_sdk/api_integration.md#extra-functionality)
* [React Native](https://docs.talkable.com/ios_sdk/react_native.md)
  * [How it works](https://docs.talkable.com/ios_sdk/react_native.md#how-it-works)
  * [What to expect](https://docs.talkable.com/ios_sdk/react_native.md#what-to-expect)
  * [Reusing the SDK’s API wrapper (optional)](https://docs.talkable.com/ios_sdk/react_native.md#reusing-the-sdk-s-api-wrapper-optional)

* [Advanced Usage](https://docs.talkable.com/ios_sdk/advanced.md)
  * [Specify a custom campaign tag](https://docs.talkable.com/ios_sdk/advanced.md#specify-a-custom-campaign-tag)
  * [Implement TalkableDelegate](https://docs.talkable.com/ios_sdk/advanced.md#implement-talkabledelegate)
  * [Notifications](https://docs.talkable.com/ios_sdk/advanced.md#notifications)
  * [Contacts Import](https://docs.talkable.com/ios_sdk/advanced.md#contacts-import)
  * [Debugging](https://docs.talkable.com/ios_sdk/advanced.md#debugging)
* [Integration with Third Party Deep Linking Services](https://docs.talkable.com/ios_sdk/custom_deep_linking.md)
  * [1. Configure your Talkable campaign](https://docs.talkable.com/ios_sdk/custom_deep_linking.md#configure-your-talkable-campaign)
  * [2. Pass deep linking params to the Talkable SDK](https://docs.talkable.com/ios_sdk/custom_deep_linking.md#pass-deep-linking-params-to-the-talkable-sdk)
* [Example](https://docs.talkable.com/ios_sdk/example.md)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/ios_sdk/advanced.md
===============================================================================

# Advanced Usage

## Specify a custom campaign tag

By default if no campaign tag was specified, SDK uses ios-invite and ios-post-purchase tags for [Standalone](https://docs.talkable.com/ios_sdk/integration/standalone.md#ios-sdk-integration-standalone) and [Post Purchase](https://docs.talkable.com/ios_sdk/integration/post_purchase.md#ios-sdk-integration-post-purchase) campaigns. But you can explicitly specify your own tag in this way:

```objc
#import <TalkableSDK/Talkable.h>
// ...
[[Talkable manager] registerOrigin:TKBLAffiliateMember params:@{TKBLCampaignTags: @"your-custom-tag"}];
```

## Implement TalkableDelegate

1. Assign your ViewController or other object as Talkable delegate by using the following code:

```objc
[[Talkable manager] setDelegate: yourObjectConformsToTalkableDelegateProtocol];
```

2. Take control of presenting offers to your users. Use the next two delegate methods to prevent
or give an instruction as to where you want that offer to be displayed:

```objc
- (BOOL)shouldPresentTalkableOfferViewController:(UIViewController*)controller;
- (UIViewController*)viewControllerForPresentingTalkableOfferViewController;
```

3. Customize ViewContoller title by implementing the method below. By default, title of offer page is used.

```objc
- (NSString*)titleForTalkableOfferViewController:(UIViewController*)controller;
```

> **Note:**
>
> You can modify page title on a Talkable Site during campaign development.

4. Present offers to your users by yourself by handling request url or webView after origin was created.

```objc
- (void)didRegisterOrigin:(TKBLOriginType)type withURL:(NSURL*)url;
- (void)didRegisterOrigin:(TKBLOriginType)type withWebView:(WKWebView*)webView;
```

> **Note:**
>
> Talkable SDK assigns itself to WKWebView navigation delegate. Changing WKWebView navigation delegate
> may break some functionality so we strictly recommend not doing this.

5. Manage cases where origin wasn’t created or offer hasn’t been presented.

```objc
- (void)registerOrigin:(TKBLOriginType)type didFailWithError:(NSError*)error;
```

> **Note:**
>
> userInfo may contain detailed information about the error.

6. Receive notification when the user taps Facebook or Twitter sharing button in the WebView and trigger
corresponding sharing view.

```objc
- (void)showFacebookShareDialogWithParams:(NSDictionary*)params delegate:(id)delegate;
- (void)showFacebookShareDialogWithParams:(NSDictionary*)params completion:(void (^)())completionHandler;
- (void)showTwitterShareDialogWithParams:(NSDictionary*)params completion:(void (^)())completionHandler;
```

> **Note:**
>
> See [Social Sharing](https://docs.talkable.com/ios_sdk/social_sharing.md#ios-sdk-social-sharing) for details.

## Notifications

Subscribe to notifications that Talkable SDK publish and be aware of everything that happens around your campaigns.

1. Receive the coupon given to your users:

```objc
#import <TalkableSDK/Talkable.h>
// ...
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(couponReceived:) name:TKBLDidReceiveCouponCode object:nil];
// ...
- (void)couponReceived:(NSNotification*)ntf {
  // Your logic here
}
```

2. Catch every message from presented offer:

```objc
#import <TalkableSDK/Talkable.h>
// ...
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(publishMessageNotification:) name:TKBLDidPublishMessageNotification object:nil];
// ...
- (void)publishMessageNotification:(NSNotification*)ntf {
  if ([[[ntf userInfo] objectForKey:TKBLMessageNameKey] isEqualToString:TKBLMessageOfferLoaded]) {
    // Your logic here
  }
}
```

Available messages:
* TKBLMessageOfferLoaded

* TKBLMessageOfferClose

* TKBLMessageCouponIssued

## Contacts Import

It is possible to import contacts from a device with the SDK, so they will be accessible at the Share page with JavaScript.
The button at the Share page for contacts importing should have `class="js-import-contacts"` property.

Also, contacts usage description is required on iOS 10+ devices. It should be described under the `NSContactsUsageDescription` key
in the `Info.plist` file of your app. This message will be shown when asking for contacts permissions.

```xml
<key>NSContactsUsageDescription</key>
  <string>Share the offer with your Friends from contacts</string>

.. note::

  Talkable SDK asks for the contacts permissions dynamically only when "contacts import" functionality is implemented
  in the campaign and Advocate presses the corresponding button at the Share page for the first time.
```

## Debugging

See all debugging information in your console which can help you to understand what is going wrong:

```objc
#import <TalkableSDK/Talkable.h>
// ...
[Talkable manager].debug = YES;
```

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/ios_sdk/api_integration.md
===============================================================================

# Native Integration via API

Talkable provides an API that can be utilized to implement a fully native referral program interface if you don’t want to use
included WKWebView-based functionality. Below are the methods necessary to integrate the Talkable referral loop into your iOS app.

## 1. Create an Origin

The Origin is a user event (e.g. a purchase or simply opening the app) that initiates the referral chain.
Create an Origin to retrieve an Offer and display it to an [Advocate](https://docs.talkable.com/campaigns.md#campaigns).

To create an Origin, make a request to [Origins API](https://www.talkable.com/api-docs/#/Origins/createOrigin) using the `createOrigin:withHandler:` method.
If the request is successful, the `handler` block will receive attributes of created Origin and [Offer](https://www.talkable.com/api-docs/#/Advocate%20Offers/findAdvocateOffer) entities.

```objc
NSDictionary* originParams = @{
    TKBLOriginTypeKey: TKBLOriginTypePurchase,
    TKBLOriginDataKey: @{
        TKBLPurchaseEmailKey: @"test@example.com",
        TKBLPurchaseSubtotalKey: @"17.43",
        TKBLPurchaseOrderNumberKey: @"100125",
        @"campaign_tags": @"your-campaign-tag"
    }
};

[[Talkable manager] createOrigin:originParams withHandler:^(NSDictionary* response, NSError* error) {
    NSDictionary* offerParams = [response objectForKey:TKBLOfferKey];
    NSDictionary* claimLinks = [offerParams objectForKey:@"claim_links"];
}];
```

## 2. Create a Share

Sharing an Offer is the next step in the referral chain. You will need the `short_url_code` of the Offer obtained from a previous request.

```objc
NSString* shortUrlCode = [offerParams objectForKey:TKBLOfferShortUrlCodeKey];
```


### Native sharing

The `nativeShare:` method will display a native iOS sharing dialog. When content is shared,
the share will be automatically registered with Talkable and reflected on your dashboard.

```objc
UIActivityViewController* sheet = [[Talkable manager] nativeShare:@{
    TKBLOfferShortUrlCodeKey: shortUrlCode,
    TKBLOfferClaimUrlKey: [claimLinks objectForKey:TKBLShareChannelOther]
}];

[self presentViewController:sheet animated:YES completion:^{}];
```

### Social sharing

Use frameworks provided by social networks to share your offer. Upon a successful share,
call the `createSocialShare:channel:withHandler:` method to register the share with Talkable
via [Shares API](https://www.talkable.com/api-docs/#/Shares/shareViaSocialChannel).

```objc
[[Talkable manager] createSocialShare:shortUrlCode channel:TKBLShareChannelOther withHandler:^(NSDictionary* response, NSError* error) {
    NSDictionary* rewardParams = [response objectForKey:@"reward"];
}];
```


#### Facebook example

```objc
MyFBSDKDelegateClass* delegate = [self myFBSDKDelegate];
delegate.shortUrlCode = shortUrlCode;
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:[params objectForKey:[claimLinks objectForKey:TKBLShareChannelFacebook]]];
[FBSDKShareDialog showFromViewController:self
                             withContent:content
                                delegate:delegate];

// ...

@implementation MyFBSDKDelegateClass

@synthesize shortUrlCode;

- (void)sharer:(id)sharer didCompleteWithResults:(NSDictionary<NSString *, id> *)results {
 if (_shortUrlCode != nil)
    [[Talkable manager] createSocialShare:_shortUrlCode
                                  channel:TKBLShareChannelFacebook
                              withHandler:^(NSDictionary* response, NSError* error) {...}];
}

@end
```


#### Twitter example

```objc
TWTRComposer *composer = [[TWTRComposer alloc] init];
[composer setText:[params objectForKey:TKBLShareMessage]];
[composer showFromViewController:self completion:^(TWTRComposerResult result) {
  if (result == TWTRComposerResultDone) {
    [[Talkable manager] createSocialShare:shortUrlCode
                                  channel:TKBLShareChannelTwitter
                              withHandler:^(NSDictionary* response, NSError* error) {...}];
  }
}];
```

> **Note:**
>
> This method will be called automatically when you use `socialShare:` or `nativeShare:` methods.

### Legacy social sharing

The legacy `socialShare:` method was used prior to v1.4.9 and is provided for backwards compatibility.
It will attempt to display a sharing dialog directly using the deprecated Social.framework.
Only the Facebook sharing channel is currently supported.

```objc
SLComposeViewController* sheet = [[Talkable manager] socialShare:@{
  TKBLShareChannel:TKBLShareChannelFacebook,
  TKBLOfferClaimUrlKey:[claimLinks objectForKey:TKBLShareChannelFacebook],
  TKBLShareMessage:@"Personalized message",
  TKBLOfferShortUrlCodeKey:shortUrlCode
}];

[self presentViewController:sheet animated:YES completion:^{}];
```

> **Warning:**
>
> Starting with v1.4.9, this method is deprecated and offers only limited Facebook sharing support.
> Native sharing or custom implementation based on Facebook/Twitter SDK should be used instead.
> See [Social Sharing](https://docs.talkable.com/ios_sdk/social_sharing.md#ios-sdk-social-sharing) for details.

### Email Share

To share an Offer via email, simply use the `createEmailShare:recipients:withParams:andHandler:` method to send an API request.
Talkable will send the emails for you. You will need to provide an interface for the user to specify recipients’ email addresses, a subject, and a personal message.

```objc
NSString* recipients = @"customer@example.com,elon@musk.com"; // comma separated email addresses
NSDictionary* emailShareParams = @{
    @"subject": @"Custom Email Subject",
    @"body": @"Personal message that will be added to the email body",
    @"reminder": NO // Whether Talkable should send a reminder email later
};

[[Talkable manager] createEmailShare:shortUrlCode recipients:recipients withParams:emailShareParams andHandler:^(NSDictionary* response, NSError* error) {
    // process delivery stats
}];
```

## 3. Check for Reward

If a Talkable campaign is configured to give a reward to the Advocate just for sharing, the call to [Shares API](https://www.talkable.com/api-docs/#/Shares/shareViaEmail) will return a [Reward](https://www.talkable.com/api-docs/#/Rewards) you can display immediately. In most cases, however, the Advocate will receive a reward after
a Friend responds to a shared link, e.g. makes a purchase.
To check whether the current user has any outstanding rewards, use the `retrieveRewardsWithHandler:` method.

```objc
[[Talkable manager] retrieveRewardsWithHandler:^(NSDictionary* response, NSError* error) {
    NSArray *rewards = (NSArray *)[response objectForKey:@"rewards"];
}];
```

## Extra Functionality

### Retrieve an Offer by Short Code

If you need to access an Offer for the Origin you’ve created earlier, store the offer’s `short_url_code` and then use `retrieveOffer:withHandler:` method
to fetch the Offer.

```objc
[[Talkable manager] retrieveOffer:shortUrlCode withHandler:^(NSDictionary* response, NSError* error) {
    NSDictionary* offerParams = [response objectForKey:TKBLOfferKey];
}];
```

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/ios_sdk/custom_deep_linking.md
===============================================================================

# Integration with Third Party Deep Linking Services

Talkable can work with third party deep linking providers such as GetSocial, Branch.io, and Firebase. Talkable is able to use deep linking functionality to track app installations and reward your Advocates and Friends for installing your mobile app on their phones.

Deep linking services provide a special referral link that can be given to Advocates to be shared with their Friends. Once opened on a Friend’s mobile device, this link will not only redirect them to the App Store to install the app, but also track that the app was installed using a referral link. Deep linking can also be used to send a Friend to a specific place in the app once it’s installed and opened for the first time, show them personalized messages, and more.

## 1. Configure your Talkable campaign

To use deep linking with Talkable campaigns, simply use your deep link URL as your Talkable Site URL.

[Image]

> **Note:**
>
> If you have configured a custom Friend Destination URL for your campaign, make sure the following GET parameters
> are present in the final URL: `?tkbl_cvuuid={{ visitor_uuid }}&talkable_visitor_offer_id={{ friend_offer.id }}`.
>
> All major deep linking providers support passing additional GET parameters with the deep link.
> This functionality is used to pass the Friend’s identifying information to the Talkable SDK in your iOS app.
> To use this functionality with Firebase, refer to this document: [Manually constructing a Dynamic Link URL](https://firebase.google.com/docs/dynamic-links/create-manually).

## 2. Pass deep linking params to the Talkable SDK

Retrieve deep linking params as described in your deep linking provider’s documentation
and pass these params to the Talkable SDK using `handleOpenURL:` or `handleURLParams:` method.

Use `handleURLParams:` method if you have a `NSDictionary` with params passed to the deep link handler block (Branch.io, GetSocial).

```objc
// For Branch.io

[[Branch getInstance] initSessionWithLaunchOptions:launchOptions andRegisterDeepLinkHandler:^(NSDictionary *params, NSError *error) {
    [[Talkable manager] handleURLParams:params];
}];
```

> **Note:**
>
> Most deep linking services provide additional parameters in the deep link handler to indicate whether the app was installed
> on this device for the first time, reinstalled or simply launched. You can use these params to register installs
> only when desired conditions are met.

```objc
// For GetSocial

[GetSocial referralDataWithSuccess:^(GetSocialReferralData * _Nullable referralData) {
    if ([referralData isFirstMatch]) {
        [[Talkable manager] handleURLParams:[referralData linkParams]];
    }
} failure:^(NSError * _Nonnull error) {}];
```
Use `handleOpenURL:` method if you handle deep link as `NSURL` using the standard `application:openURL:options:` method (Firebase).

```objc
// For Firebase

- (BOOL)application:(UIApplication *)app
            openURL:(NSURL *)url
            options:(NSDictionary<NSString *, id> *)options {
                [[Talkable manager] handleOpenURL:url];
            }
```
Calling either of these methods will register the app installation event in Talkable and complete the referral cycle.
You can then use the [retrieveRewardsWithHandler:](https://docs.talkable.com/ios_sdk/api_integration.md#ios-sdk-api-integration) method to check for rewards or subscribe
to a corresponding [notification](https://docs.talkable.com/ios_sdk/advanced.md#ios-sdk-advanced-notifications).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/ios_sdk/example.md
===============================================================================

# Example

In case you want to take a look at the actual code and see it in action we created a demo project that covers nearly all Talkable possibilities. To download Talkable Demo iOS project click [here](https://talkable-downloads.s3.amazonaws.com/ios-sdk/talkable_sdk_demo.zip). Once downloaded please proceed to [configuration](https://docs.talkable.com/ios_sdk/getting_started.md#ios-sdk-getting-started) step to set up your API Key and Talkable Site Slug.

If you have any questions, don’t hesitate to email us at [support@talkable.com](mailto:support%40talkable.com). Happy hacking!

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/ios_sdk/getting_started.md
===============================================================================

# Getting Started

The Getting Started guide shows you how to setup and launch Referral Campaign as quickly as possible with Talkable iOS SDK.

## Requirements

* Talkable SDK supports iOS *9.0* and later

* Add the -ObjC option to **Other Linker Flags** in the **Build Settings** tab

## Step 1: Installation

Talkable SDK could be integrated using [Swift Package Manager](#swift-package-manager), [CocoaPods](#cocoapods) or manually as a [Binary Framework](#binary-framework).

### Swift Package Manager

Installing from Xcode:

1. Add a package by selecting **File** → **Add Packages…** in Xcode’s menu bar.

2. Search for the Talkable SDK using the repo’s URL:

```bash
https://github.com/talkable/ios-sdk.git
```

3. Set the **Dependency Rule** to be Up to Next Major Version and specify 1.5.1 as the lower bound (default option).

4. Select **Add Package** and choose TakableSDK package.

Alternatively, you can add Talkable SDK directly to a Package.swift manifest:

```swift
dependencies: [
    .package(url: "https://github.com/talkable/ios-sdk.git", .upToNextMajor(from: "1.5.1"))
]
```

### CocoaPods

To integrate Talkable SDK into your Xcode project using CocoaPods, specify it in your [Podfile](https://guides.cocoapods.org/using/the-podfile.html):

```ruby
pod 'TalkableSDK', '~> 1.5.1'
```

### Binary Framework

To integrate the SDK manually as a Binary Framework, please follow next intructions:

1. Download the latest version of [Talkable SDK](https://talkable-downloads.s3.amazonaws.com/ios-sdk/talkable_ios_sdk.zip).

2. Navigate to your project settings by clicking on it in the project navigator.

3. Make sure that your target is selected and **General** tab is open.

4. Go to **Frameworks, Libraries, and Embedded Content** section and add the SDK by clicking **“+”** button → **Add Other…** → **Add Files…** and locate the downloaded SDK.

5. For **Embed** setting of the added framework select Do Not Embed option.

6. Make sure that Talkable SDK is linked with your project in **Link Binary With Libraries** section under **Build Phases** tab with Required Status.
It should already be included by default after following the steps above, however in case it’s not – click on the **“+”** button and add it.

## Step 2: Configuration

1. Initialize Talkable SDK in your application:didFinishLaunchingWithOptions: method, like so:

```objc
#import <TalkableSDK/Talkable.h>
// ...
[[Talkable manager] setApiKey:@"YOUR_TALKABLE_PUBLIC_API_KEY" andSiteId:@"YOUR_SITE_ID"];
```

> **Note:**
>
> You can locate your credentials inside Talkable site:
>
> * Select site and go to **Dashboard** → **Settings** → **Site Settings** → **Integrations**.
> Find **API integration** section and there you will see your API Keys and Site ID.
> Use only the *Public API Key* in your application submitted to the App Store.

2. Register URL scheme for Talkable:

  * Defines tkbl-YOUR-SITE-ID as URL Scheme in your Info.plist file:

```xml
<key>CFBundleURLTypes</key>
<array>
  <dict>
    <key>CFBundleURLSchemes</key>
    <array>
      <string>tkbl-YOUR-SITE-ID</string>
    </array>
  </dict>
</array>
```

  * Add tkbl-YOUR-SITE-ID scheme to the list of schemes that are queried within application. Also add fb-messenger, fbauth2, whatsapp schemes if you are going to utilize these sharing channels:

```xml
<key>LSApplicationQueriesSchemes</key>
<array>
  <string>tkbl-YOUR-SITE-ID</string>
  <string>fb-messenger</string>
  <string>fbauth2</string>
  <string>whatsapp</string>
</array>
```
> **Note:**
>
> Please replace YOUR-SITE-ID with your actual Site ID.
> Make sure to keep tkbl- prefix in the <string> value. For example,
> if your site ID is my-store, the correct <string> value is tkbl-my-store.

3. Add following lines to application:openURL:options:

```objc
#import <TalkableSDK/Talkable.h>
// ...
[[Talkable manager] handleOpenURL:url];
```

Your environment is all set up! Now you can [integrate](https://docs.talkable.com/ios_sdk/integration.md#ios-sdk-integration) the Talkable campaign piece.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/ios_sdk/integration.md
===============================================================================

# Integration
> **Important:**
>
> Before integrating SDK campaigns into your app, make sure you have campaigns properly configured
> in Talkable. See [SDK Campaign Setup](https://docs.talkable.com/campaigns/tutorials/sdk_campaign_setup.md#campaigns-tutorials-sdk-campaign-setup) for complete
> campaign setup guide including tags, native sharing, and mobile optimization.

The SDK is installed and configured. Now you can integrate Standalone and/or Post Purchase campaigns into your mobile app.

* [Standalone Campaign](https://docs.talkable.com/ios_sdk/integration/standalone.md#ios-sdk-integration-standalone)

* [Post Purchase Campaign](https://docs.talkable.com/ios_sdk/integration/post_purchase.md#ios-sdk-integration-post-purchase)

* [Custom Events](https://docs.talkable.com/ios_sdk/integration/event.md#ios-sdk-integration-event)

* [Standalone Campaign](https://docs.talkable.com/ios_sdk/integration/standalone.md)
* [Post Purchase Campaign](https://docs.talkable.com/ios_sdk/integration/post_purchase.md)
* [Custom Events](https://docs.talkable.com/ios_sdk/integration/event.md)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/ios_sdk/integration/event.md
===============================================================================

# Custom Events

In addition to Signup and Purchase incentives, Talkable campaigns can utilize [custom events](https://docs.talkable.com/advanced_features/events.md#advanced-features-events) to issue rewards based on other actions performed by Advocates and Friends, such as purchasing a subscription, completing a game level, or simply visiting a certain place in your app. Register an event every time the user performs the desired action in your app.

An Event has two required properties: event category and event number. Please refer to [available properties](https://docs.talkable.com/advanced_features/events.md#advanced-features-events-available-properties) for a complete list of optional properties.

```objc
#import <TalkableSDK/Talkable.h>
// ...
NSDictionary* params = @{
  TKBLCampaignTags: @"your-campaign-tag",
  TKBLEventKey: @{
    TKBLEventCategoryKey: @"subscription_purchased",
    TKBLEventNumberKey: [[NSUUID UUID] UUIDString] //must be unique for given category
  }
};
[[Talkable manager] registerOrigin:TKBLEvent params:params];
```
If you have a Talkable offer configured for this event, the Talkable campaign screen will be displayed as a result of calling the `registerOrigin` method.
> **Warning:**
>
> Unlike the default [Standalone](https://docs.talkable.com/ios_sdk/integration/standalone.md#ios-sdk-integration-standalone) and [Post Purchase](https://docs.talkable.com/ios_sdk/integration/post_purchase.md#ios-sdk-integration-post-purchase) integrations, the event-based integration will not automatically use the default campaign tag (`ios-invite` or `ios-post-purchase` respectively). To match your events to the desired Talkable campaign, you **must** specify the correct campaign tag when creating an event.

Customer data can be added to the registered event. Custom properties passed with the event will be added to the customer profile.

```objc
#import <TalkableSDK/Talkable.h>
// ...
NSDictionary* params = @{
  TKBLCampaignTags: @"your-campaign-tag",
  TKBLEventKey: @{
    TKBLEventEmailKey: @"customer@example.com",
    TKBLEventCategoryKey: @"subscription_purchased",
    TKBLEventNumberKey: self.orderNumberField.text,
    TKBLEventPersonCustomPropertiesKey: @{
        @"property_key": @"property_value"
      }
    }
  }
};
[[Talkable manager] registerOrigin:TKBLEvent params:params];
```
Please refer to the [Integrating Events](https://docs.talkable.com/advanced_features/events.md#advanced-features-events) page to learn more about event-based campaigns.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/ios_sdk/integration/post_purchase.md
===============================================================================

# Post Purchase Campaign

Now that we know what a Standalone campaign is, let’s take a look at one more type of Talkable campaign — Post Purchase. It is used to convert your existing customers into Advocates after they make a purchase. It has the same flow as a basic Standalone campaign except this is gated by a purchase and shown to a customer immediately after.

Post Purchase campaign usually looks like a pop up right after a user made a purchase. This campaign is initialized on the order confirmation page and captures order with its details. You need to pass order data to Talkable that includes your customer’s email address, order number, subtotal, coupon code used at checkout to allow Talkable detect and close a referral loop.

Here is an example of a Purchase capturing, this action should be triggered on the order confirmation page:

```objc
#import <TalkableSDK/Talkable.h>
// ...
NSDictionary* params = @{
  TKBLPurchaseKey: @{
    TKBLPurchaseOrderNumberKey: @"100130", // REQUIRED - Order number
    TKBLPurchaseEmailKey: @"customer@example.com", // REQUIRED - Customer Email
    TKBLPurchaseSubtotalKey: [NSNumber numberWithDouble:22.33], // REQUIRED - Purchase Subtotal
    TKBLPurchaseCouponCodeKey: @"TEST25", // REQUIRED - Coupon code used at checkout, pass multiple as an array: @[@"SAVE20", @"FREE-SHIPPING"]. Pass @"" if there is no coupon code.
    TKBLPurchaseOrderItemsKey:@[
      @{
        TKBLPurchaseOrderItemProductIDKey: @"sku3", // Item Product ID
        TKBLPurchaseOrderItemPriceKey: [NSNumber numberWithDouble:4.99], // Item Unit Price
        TKBLPurchaseOrderItemQuantityKey: [NSNumber numberWithUnsignedInt:5], // Item Quantity
        TKBLPurchaseOrderItemTitleKey: @"Amazing Product 3", // Name of the product
        TKBLPurchaseOrderItemUrlKey: @"http://www.store.com/product2", // URL of the product page
        TKBLPurchaseOrderItemImageUrlKey: @"http://www.store.com/product2/image.jpg" // URL of the product image
      }
    ]
  }
};
[[Talkable manager] registerOrigin:TKBLPurchase params:params];
```

> **Note:**
>
> If Post Purchase campaign does not show up when testing, make sure you have it
> Live on the Campaigns listing with a default tag (ios-post-purchase) or with
> a tag you specified in the registerOrigin call.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/ios_sdk/integration/standalone.md
===============================================================================

# Standalone Campaign
> **Note:**
>
> For information about setting up campaigns to work with iOS SDK, including campaign tags,
> native sharing, and mobile optimization, see [SDK Campaign Setup](https://docs.talkable.com/campaigns/tutorials/sdk_campaign_setup.md#campaigns-tutorials-sdk-campaign-setup).

Let’s take a look at how the Standalone campaign integration looks. The main purpose of this type of campaign is to drive your users to invite their friends (to become Advocates) without being gated by a purchase beforehand.

Usually Standalone campaign look like a separate widget that people can access by clicking on the “Invite friends” button inside app navigation.

Once you’ve got a Standalone campaign set up inside Talkable you can integrate the campaign with the following line of code:

```objc
#import <TalkableSDK/Talkable.h>
// ...
[[Talkable manager] registerOrigin:TKBLAffiliateMember params:nil];
```

> **Note:**
>
> Make sure you have at least one Live “SA” campaign inside Talkable Site with a default tag (ios-invite) or with a tag you specified in the registerOrigin call

Note that params are empty, in this case user will see Signup form on [Advocate Signup/Share Page](https://docs.talkable.com/campaigns/views/offers_show.md#campaigns-views-offers-show), which is used to collect the user’s email address. Your application may already know/have access to the user’s email, if so, you should pass this parameter which will automatically skip the Signup Form in the flow and show Share form immediately [Advocate Signup/Share Page](https://docs.talkable.com/campaigns/views/offers_show.md#campaigns-views-offers-show). You have the ability to pass any custom data you think might be useful by using “person custom properties” to define any number of custom key/value pairs. For example, below we are creating and passing a custom key value pair of *eye color* = *green*. Any data passed through here will be accessible on a campaign level for segmentation or other logic.

```objc
#import <TalkableSDK/Talkable.h>
// ...
NSDictionary* params = @{
  TKBLAffiliateMemberKey: @{
    TKBLAffiliateMemberEmailKey: @"advocate@example.com",
    TKBLAffiliateMemberFirstNameKey: @"John",
    TKBLAffiliateMemberLastNameKey: @"Smith",
    TKBLAffiliateMemberPersonCustomPropertiesKey: @{
      @"eye_color": @"green"
    }
  }
};
[[Talkable manager] registerOrigin:TKBLAffiliateMember params:params];
```

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/ios_sdk/react_native.md
===============================================================================

# React Native

Talkable supports React Native apps through the Talkable API. You build the referral program
interface in your React Native app and connect it to Talkable using the API. The Friend Claim
Page is hosted by Talkable.

The iOS SDK documented in this section is a framework for native iOS apps. If your app is
built with React Native, use the Talkable API instead of embedding the SDK. The steps below
describe how.

## How it works

The referral flow is the same as any Talkable API integration.
See [Referral Program via API](https://docs.talkable.com/api_v2/flow.md#api-v2-flow) for the full walkthrough.
In your React Native app you:

* Generate a Talkable Offer for the Advocate.

* Let the Advocate share the Offer via social network or email.

* Let the Friend claim the Offer on the Claim (Landing) page after following the share URL.

* Let Talkable know about a Purchase or Event so it can close the referral chain and trigger the reward.

Reference docs:

* [Referral Program via API](https://docs.talkable.com/api_v2/flow.md#api-v2-flow) — the end-to-end integration flow.

* [API Introduction](https://docs.talkable.com/api_v2/intro.md#api-v2-intro) — base URL, authentication, response and error formats.

* [Origins](https://docs.talkable.com/api_v2/origins.md#api-v2-origins) — the Purchase or Event reporting that triggers rewards.

## What to expect

* You build the referral UI in React Native, using your own components and branding.

* Talkable provides the referral functionality via the API: offers, shares, attribution, and rewards.

* There is no React Native package to install.
You integrate using the API, and the same integration works for both iOS and Android.

## Reusing the SDK’s API wrapper (optional)

The iOS SDK also provides helper methods that call the Talkable API for you — creating an
Origin, sharing an Offer, and retrieving offers and rewards. These are documented in [Native Integration via API](https://docs.talkable.com/ios_sdk/api_integration.md#ios-sdk-api-integration), with Objective-C examples for
each step.

You do not need the SDK to integrate React Native; calling the API directly requires no
native dependency. You can bridge these helper methods into React Native if you prefer. [Native Integration via API](https://docs.talkable.com/ios_sdk/api_integration.md#ios-sdk-api-integration) is also a useful reference for the
same Origin, Share, and Reward steps if you call the API directly.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/ios_sdk/social_sharing.md
===============================================================================

# Social Sharing

Talkable iOS SDK provides the functionality to facilitate sharing offers via social networks.
Older versions of the SDK prior to 1.4.9 used Apple-provided Social.framework to implement
sharing to Facebook and Twitter. Starting with version 1.4.9, usage of Social.framework is
officially deprecated following Apple’s decision to deprecate the framework.

We still provide limited support of Social.framework to ensure the stability of legacy implementations.
However, developers are encouraged to use Facebook and Twitter SDKs to enable sharing to these platforms.

This article describes how to use the Talkable SDK with social sharing in various scenarios.

## Social Sharing from a web-based campaign

The default Talkable iOS integration utilizes WebView to display web-based campaign views in your app.
If you have Facebook or Twitter available on your sharing page, the Talkable iOS SDK will automatically
detect when the user clicks on the share button and trigger one of the corresponding delegate methods
(see [Talkable Delegate](https://docs.talkable.com/ios_sdk/advanced.md#ios-sdk-advanced-delegate)).

### showFacebookShareDialogWithParams:delegate:

```objc
- (void)showFacebookShareDialogWithParams:(NSDictionary*)params delegate:(id)delegate;
```
This method is called when the user clicks on the ‘Facebook Share’ button.
The `params` dictionary contains information on the content being shared and will have the following keys:

* `TKBLOfferClaimUrlKey` - the link URL to share

* `TKBLShareMessage` - the message to share

The `delegate` param is a delegate object that conforms to Facebook iOS SDK `SharingDelegate` protocol.
Pass this object as a `delegate:` param when sharing the link using FBSDK to automatically notify the Talkable SDK
that sharing was completed successfully. Talkable SDK will then register the share with Talkable so that you can see it
in your Talkable Dashboard.

### Example

```objc
- (void)showFacebookShareDialogWithParams:(NSDictionary *)params delegate:(id)delegate {
     FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
     content.contentURL = [NSURL URLWithString:[params objectForKey:TKBLOfferClaimUrlKey]];
     [FBSDKShareDialog showFromViewController:self
                                  withContent:content
                                     delegate:delegate];
 }
```

### showFacebookShareDialogWithParams:completionHandler:

```objc
- (void)showFacebookShareDialogWithParams:(NSDictionary*)params completion:(void (^)())completionHandler;
```
This method is also called when the user clicks on the ‘Facebook Share’ button, but instead of `delegate` param it
provides the `completionHandler` block that should be called when sharing is completed successfully. Use
this method if you already have a delegate object that you use for Facebook sharing.
Pass the `completionHandler` block to the delegate object and call it in your `sharer:didCompleteWithResults:` method.

### Example

```objc
- (void)showFacebookShareDialogWithParams:(NSDictionary *)params completion:(void (^)())completionHandler {
    MyFBSDKDelegateClass* delegate = [self myFBSDKDelegate];
    delegate.talkableCompletionHandler = completionHandler;
    FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
    content.contentURL = [NSURL URLWithString:[params objectForKey:TKBLOfferClaimUrlKey]];
    [FBSDKShareDialog showFromViewController:self
                                 withContent:content
                                    delegate:delegate];
}

// ...

@implementation MyFBSDKDelegateClass

@synthesize talkableCompletionHandler;

- (void)sharer:(id)sharer didCompleteWithResults:(NSDictionary<NSString *, id> *)results {
 if ((_talkableCompletionHandler) != nil)
   _talkableCompletionHandler();
}

@end
```

### showTwitterShareDialogWithParams:completionHandler:

```objc
- (void)showTwitterShareDialogWithParams:(NSDictionary*)params completion:(void (^)())completionHandler;
```
This method is called when the user clicks on the Twitter Share button. The `params` and `completionHandler` attributes are analogous to the previous method.

### Example

```objc
- (void)showTwitterShareDialogWithParams:(NSDictionary *)params completion:(void (^)())completionHandler {
   TWTRComposer *composer = [[TWTRComposer alloc] init];

   [composer setText:[params objectForKey:TKBLShareMessage]];

   [composer showFromViewController:self completion:^(TWTRComposerResult result) {
       if (result == TWTRComposerResultDone) {
            completionHandler();
       }
   }];
}
```

## Legacy Sharing using Social.framework

Prior to v1.4.9, the TalkableSDK used Social.framework to automatically display Facebook and Twitter sharing dialog
when the user clicks on on a corresponding button. This type of sharing relied on functionality built into iOS, and did not
require the use of additional SDKs. Staring with iOS 11, Apple deprecated this way of sharing and now requires
developers to utilize frameworks provided by Facebook and Twitter.
While Social.framework is officially deprecated, Talkable SDK still supports a limited subset of its functionality
to ensure a seamless transition to new implementations.

* If Talkable Delegate <ios_sdk/advanced/delegate> doesn’t implement either of the two Facebook methods,
TalkableSDK will attempt to trigger Facebook share via Social.framework.

* Facebook sharing popup will only be displayed if Facebook app is installed on a customer’s phone, otherwise it will
silently fail.

* Twitter sharing is not supported by Social.framework anymore.
> **Note:**
>
> Talkable iOS SDK v1.4.9 features improved support of legacy Facebook sharing via Social.framework. If you are having trouble
> with your current implementation, please upgrade to the latest version. Note that we can only try to provide the best
> transitioning experience, and this fallback should not be regarded as a permanent solution. We encourage developers to switch
> to delegate methods for social sharing.

## Social Sharing from a native campaign

The methods documented above are designed to work with web-based campaigns only. If you have integrated using our API,
please refer to the [Sharing](https://docs.talkable.com/ios_sdk/api_integration.md#ios-sdk-api-integration-sharing) section of the Native Integration page.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/web_hooks.md
===============================================================================

# Webhooks

Webhooks are “user-defined HTTP callbacks” triggered by events on Talkable’s
site. Subscribing to Talkable Webhooks allows you to receive notifications about
various events from Talkable, for example, when a Reward should be given, or
when a Friend or Advocate opts in to an email newsletter subscription.

After subscribing to a Webhook, your app can execute code immediately after
specific events occur in Talkable.

[https://en.wikipedia.org/wiki/Webhook](https://en.wikipedia.org/wiki/Webhook)

Each Webhook in Talkable is defined with an HTTP URL to deliver Webhook data
(aka payload). This URL should be defined and implemented on the client’s site.
> **Note:**
>
> Talkable now provides a more flexible and powerful way to handle events with the Custom App.
> We strongly recommend [migrating your existing Webhooks to Custom App](https://docs.talkable.com/web_hooks/migration_to_custom_app.md#web-hooks-migration-to-custom-app) to take advantage of centralized configuration, customizable payloads, and greater overall flexibility.

## Available Webhooks

Below is a user experience flow showing when Talkable Webhooks are called.
For more details concerning specific Talkable Webhooks, click the appropriate
Webhook type in the left-hand menu.

[Image]

> **Note:**
>
> The Reward Webhooks will only send if there is an associated incentive
> configured. For example, for the ‘Reward Webhook’ (reason = signup) to send,
> there must be a signup incentive configured in the campaign rules.

## Set Up

[Image]

1. Set up and test Talkable Webhooks by navigating to **Menu** then **Webhooks**

2. Proceed to **Create New Webhook**

3. Choose a Webhook from the dropdown and provide your endpoint URL

4. From here, Send Sample, Edit, Delete or Create New

5. Take note of your Talkable security key. This key will be the same for all
Talkable Webhooks on a given site. Talkable includes a key parameter in
Webhooks which are unique to each site as a way to identify Talkable as
an authorized server. Your Talkable Webhook security key can be found in
the Webhook set up page.

Talkable Webhooks will trigger automatically based on associated events defined
by Webhook type.

## Testing

Testing webhooks can be accomplished with the help of Webhook Tester, an external
service that tests your post-receive messages.

1. Visit [Webhook Tester](https://webhook.site/) and click **Copy** to copy the URL you are given.

2. Open your site on Webhooks set up page.

3. Click **New**.

4. Select webhook type.

5. Paste your Webhook Tester URL and save.

6. Click **Deliver Sample** near the webhook you want to test.

7. After you finish the implementation on your site **change Webhook Tester URL
to the live URL** on your site.

8. Click **Deliver Sample** to test webhook with Live URL.

## Data

All Webhooks are delivered as an HTTP Post request with the main parameter
called payload. All data inside this parameter is encoded as JSON. Below is
a PHP parameter decode example:

```php
json_decode($_POST["payload"])
```


## Parsing Timestamps

**Timestamp data type** is not a part of JSON standard. Timestamps
are passed as strings in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) compatible format. To function properly, ensure
your date parser is compatible to this standard. Java users go here:  
[https://stackoverflow.com/questions/2201925/converting-iso-8601-compliant-string-to-java-util-date](https://stackoverflow.com/questions/2201925/converting-iso-8601-compliant-string-to-java-util-date)

## Response Codes

Talkable considers a Webhook as “delivered successfully” when a site
server returns a **2xx response status**. Otherwise Talkable will continually
retry to deliver a Webhook after a set interval of time.

## HTTP Responses and Their Meanings

* 2xx: Success

* 200: OK

* 201: Created

* 202: Accepted

* 203: Non Authoritative Information

* 204: No Content

* 205: Reset Content

* 206: Partial Content

If you have a problem on your server, you can answer with code 500. If there is
some problem in our request (problem on Talkable’s side), you can answer
“400 Bad Request”.

Talkable will retry delivery of Webhook if any other error code is received.

## Security Key

Talkable includes a `key` parameter in Webhooks which are unique to each site
as a way to identify Talkable as an authorized server. Your Talkable Webhook
security key can be found in the Webhook set up page.

## Type

The `type` parameter of a Webhook request can be used to identify which Webhook
is received without looking at the payload. This will be useful if you point multiple
Webhooks to the same URL; for instance, for data collection purposes.

Possible types are:

* `referral_web_hook`

* `create_coupon_web_hook`

* `post_share_web_hook`

* `offer_signup_web_hook`

* `claim_signup_web_hook`

* `reward_web_hook`

* `unsubscribe_web_hook`

* `check_unsubscribe_web_hook`

* `event_web_hook`

## Site

Every Webhook has a `site` parameter that identifies which Talkable site sent
this request. This is useful if you have a multi-site setup or use a staging site.

## Whitelisting Talkable IPs

In case your servers are behind firewall, you may need to whitelist Talkable IP
addresses so webhooks can be delivered. Pass list of these addresses to your network administrator:

| 100.26.94.244<br>18.207.91.200<br>18.210.165.17<br>18.232.203.127<br>18.233.48.151<br>184.73.206.68<br>23.21.155.129 | 3.222.226.72<br>34.197.54.191<br>34.226.253.236<br>34.231.104.179<br>34.232.247.192<br>35.169.186.170<br>35.171.77.58 | 35.173.87.187<br>44.217.136.252<br>44.219.211.174<br>50.16.143.102<br>50.17.244.178<br>52.204.148.18<br>52.22.0.55 | 52.6.41.1<br>52.7.94.243<br>54.164.128.44<br>54.208.14.192<br>54.86.208.153<br>54.86.241.218<br>54.91.51.228 |
| -------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |


## Compatibility and Versioning

Talkable Webhooks do not currently incorporate versioning. Current spec will not
be changed for all existing hooks. Note that Talkable may add additional data
elements to existing Webhooks, but should not remove or change existing data
elements.

---
See available Webhooks on the navigation sidebar.



* [Create Coupons](https://docs.talkable.com/web_hooks/create_coupon.md)
* [Referral](https://docs.talkable.com/web_hooks/referral.md)
* [Reward](https://docs.talkable.com/web_hooks/reward.md)
* [Post Share](https://docs.talkable.com/web_hooks/post_share.md)
* [Advocate Signup](https://docs.talkable.com/web_hooks/offer_signup.md)
* [Friend Email Gating](https://docs.talkable.com/web_hooks/claim_signup.md)
* [Unsubscribe](https://docs.talkable.com/web_hooks/unsubscribe.md)
* [Check Unsubscribe](https://docs.talkable.com/web_hooks/check_unsubscribe.md)
* [Event](https://docs.talkable.com/web_hooks/event.md)
* [Migration from Webhooks to Custom App](https://docs.talkable.com/web_hooks/migration_to_custom_app.md)
  * [How Custom App enhances or replaces Webhooks](https://docs.talkable.com/web_hooks/migration_to_custom_app.md#how-custom-app-enhances-or-replaces-webhooks)
  * [Webhooks vs Custom App](https://docs.talkable.com/web_hooks/migration_to_custom_app.md#webhooks-vs-custom-app)
    * [Transition from Webhooks to Custom App](https://docs.talkable.com/web_hooks/migration_to_custom_app.md#transition-from-webhooks-to-custom-app)

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/web_hooks/check_unsubscribe.md
===============================================================================

# Check Unsubscribe Webhook

Talkable Check Unsubscribe Webhook is used to ensure emails are not sent from
Talkable to user email addresses who have unsubscribed from the client side.
This is an optional functionality. Note: users do have the ability to unsubscribe
from Talkable referral related emails at any time from those emails directly.

## When does Talkable call the Check Unsubscribe Webhook?

Talkable Check Unsubscribe Webhook is triggered on every attempt to send an
otherwise valid customer email, aimed at checking if the email is also valid on
merchant side.
> **Important:**
>
> The ‘unsubscribed’ field should have a boolean value,
> representing unsubscribed status according to the merchant info.

## Payload parameters provided

The sample payload with parameters for Check Unsubscribe Webhook is available here: [Check Unsubscribe Webhook Payload](https://www.talkable.com/api-docs/index.html?urls.primaryname=webhooks%20api&urls.primaryName=Webhooks#/Check%20Unsubscribe/post_your_api_check_unsubscribe_web_hook_path).

### View categories

View category can be one of the following:

* notifier_offers_email

* notifier_offers_share_via_email

* notifier_offers_share_via_email_reminder

* advocate_rewards_confirmation

* advocate_rewards_paid

* friend_rewards_paid

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/web_hooks/claim_signup.md
===============================================================================

# Friend Email Gating Webhook

The Talkable Friend Email Gating Webhook notifies your endpoint that a Friend
Email Gating form was submitted (on Friend Claim Page).

Use cases for the Friend Email Gating Webhook include:

* Tracking when users select the checkbox to opt into your email newsletter

* Collection of data for Business Intelligence and analytics systems to track
users who become Friends

* Sending automated ‘Thank You’ or ‘Don’t forget to shop’ emails after a Friend
passes the email gating form

## When does Talkable call the Friend Email Gating Webhook?

Talkable Friend Email Gating Webhook is triggered any time an Friend Email
Gating form is submitted. This is the form a Friend completes after receiving
a share from an Advocate, and before receiving their discount code.

Friend Email Gating form example:

[Image]

## Payload parameters provided

The sample payload with parameters for Friend Email Gating Webhook is available here: [Friend Email Gating Webhook Payload](https://www.talkable.com/api-docs/index.html?urls.primaryname=webhooks%20api&urls.primaryName=Webhooks#/Friend%20Email%20Gating/post_your_api_claim_signup_web_hook_path).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/web_hooks/create_coupon.md
===============================================================================

# Create Coupon Webhook

Talkable Create Coupon Webhook enables automatic coupon creation, which
eliminates the need to upload coupon lists into the Talkable platform manually.
Talkable creates unique coupon codes then passes those codes via the Create
Coupon Webhook to the client; it is then up to the client to enable these coupons
on their platform.
> **Note:**
>
> Create Coupon Webhook and [Shopify Coupon auto-sync](https://docs.talkable.com/advanced_features/shopify_coupons_auto_sync.md#advanced-features-shopify-coupons-auto-sync) can be enabled simultaneously.
> In that case, coupons will be passed via the webhook only after successful Shopify sync.

## When does Talkable call the Create Coupon Webhook?

Create Coupon Webhook is called when the quantity of available coupons drops
below a Talkable threshold.

This threshold is dynamically calculated based on the number of coupon codes
used by the client site in the last 21 days. The threshold ensures the Talkable
coupon lists will always hold enough available coupons to serve the site for 21
days, even if the integration were to break. The minimum threshold is 20 coupons.

When the number of coupons available to Talkable drops below the threshold,
Talkable will call the Create Coupon Webhook with a payload of 15 new coupons in
the background. If a user needs a coupon code, but there are no coupon codes
available, Talkable will generate one in the foreground and give it to the user
that requested it. In both cases, coupons are sent to the client endpoint as a
webhook and then inserted into the Talkable database only when a webhook returns
a successful response.

## Set Up

The Create Coupon Webhook will add coupons to a specific coupon list on Talkable’s
backend. These coupon lists must be set up in the Talkable campaign editor before
utilizing the Create Coupon Webhook. Follow the below instructions to set up a
coupon list for a campaign:

1. Navigate to **Campaigns** then select the campaign you would like to set up
coupon list(s) for

2. Proceed to **Rules** then scroll down to **Incentives** section where
incentives for both Advocate and Friend can be configured

[Image]

3. Inside the Referral Incentive Editor choose the **Coupon code type: Single-use** then select an existing Coupon list or create a new coupon list by clicking **Manage Coupon Lists**.

4. Here you’ll be able to **Create New** and configure a Name, Expiration Date
(optional), and Amount ($ or %)

5. Now go back to **Rules** → **Incentives** → **Edit** and select the **Reward Amount** associated with the list created in step 4 and select the
newly created list

6. Optionally, select **Advanced Settings** for additional configuration parameters
> **Note:**
>
> Coupons created by the **Create Coupon Webhook** will be added to the coupon
> list associated with the referral campaign. Multiple referral campaigns can
> use the same or unique coupon lists. **Advocate** and **Friend** referral
> incentives can also use the same or unique coupon lists.

Once a single-use coupon code list is associated with a campaign, then the
Create Coupon Webhook can now be set up. [Learn more about General Webhook Set Up Steps](https://docs.talkable.com/web_hooks.md#web-hooks)

## Payload parameters provided by Create Coupon Webhook

The sample payload with parameters for Create Coupon Webhook is available here: [Create Coupon Webhook Payload](https://www.talkable.com/api-docs/index.html?urls.primaryname=webhooks%20api&urls.primaryName=Webhooks#/Create%20Coupon/post_your_api_create_coupon_web_hook_path).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/web_hooks/event.md
===============================================================================

# Event Webhook

The Talkable Event Webhook notifies your endpoint that an [Event](https://docs.talkable.com/advanced_features/events.md#advanced-features-events) or a [Purchase](https://docs.talkable.com/integration/standard/integration_components.md#integration-standard-integration-components-post-purchase-script) has been
registered with Talkable.

Use cases for the Event Webhook include:

* Capturing purchases and custom referral events generated by the customer (e.g. added data to profile or renewed a subscription)

* Tracking coupon codes used for purchases

* Using Talkable events to trigger custom workflows (e.g. add a custom property to a customer who just cancelled a subscription)

## When does Talkable call the Event Webhook?

Talkable calls the Event Webhook any time an Event or a Purchase
is registered either via [the front-end Talkable integration](https://docs.talkable.com/advanced_features/events.md#advanced-features-events) or using the [Talkable backend API](https://docs.talkable.com/api_v2/origins.md#api-v2-origins).

## Payload parameters provided

The sample payload with parameters for Event Webhook is available here: [Event Webhook Payload](https://www.talkable.com/api-docs/index.html?urls.primaryname=webhooks%20api&urls.primaryName=Webhooks#/Event/post_your_api_event_web_hook_path).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/web_hooks/migration_to_custom_app.md
===============================================================================

# Migration from Webhooks to Custom App

The transition from Webhooks to [Custom App](https://docs.talkable.com/email_marketing_and_automation/custom_app.md#email-marketing-and-automation-custom-app) provides a more flexible approach to integrate Talkable events with your systems. This guide outlines the key improvements, differences, and step-by-step instructions to help you successfully migrate to the new Custom App architecture.

## How Custom App enhances or replaces Webhooks

Webhooks are useful for triggering HTTP requests based on specific Talkable events, but they have limitations, such as:

* Each event type requires a separate webhook configuration.

* Only one webhook can be set per event.

* Payload customization is not supported.

Custom App overcomes these limitations by providing:

* A single endpoint to manage multiple events, reducing setup complexity.

* Built-in testing tools for verifying event payloads before production use.

* Customizable payload with a wide range of data variables.

* Conditional execution with Liquid criteria for each event.

By migrating from webhooks to [Custom App](https://docs.talkable.com/email_marketing_and_automation/custom_app.md#email-marketing-and-automation-custom-app), businesses can streamline their data integration processes and reduce maintenance overhead.

## Webhooks vs Custom App

| Feature                   | Webhooks                                 | Custom App                                                 |
| ------------------------- | ---------------------------------------- | ---------------------------------------------------------- |
| **Flexibility**           | Fixed event-based triggers               | Supports custom event handling                             |
| **Configuration**         | Requires manual endpoint setup per event | Centralized configuration in Talkable UI                   |
| **Customizable Payload**  | Limited or manual payload manipulation   | Flexible payload configuration via UI                      |
| **Conditional Execution** | Not supported out of the box             | Allows event triggers based on custom rules and conditions |

### Transition from Webhooks to Custom App

To transition from webhooks to the [Custom App](https://docs.talkable.com/email_marketing_and_automation/custom_app.md#email-marketing-and-automation-custom-app), follow these steps:

1. Review Current Webhooks

  * Identify the webhooks currently used in your system (e.g., Sync signups, Send reward, Referral status change).

  * Note the payload structure and data sent to each endpoint.

2. Install and Configure Custom App

  * Follow the Set Up instructions below to install and enable the Custom App.

  * Configure the same actions as your existing webhooks.

3. Test Custom App Actions

  * Use the Webhook Tester to confirm that data is sent correctly.

  * Compare payloads from the Custom App to ensure they match what was previously received via webhooks.

4. Disable Legacy Webhooks

  * Once the Custom App is fully functional, deactivate the old webhooks in the Talkable settings.

  * Ensure all integrations are working smoothly before making the final switch.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/web_hooks/offer_signup.md
===============================================================================

# Advocate Signup Webhook

The Talkable Advocate Signup Webhook notifies your endpoint of an Advocate
Signup forms submission.

Use cases for the Advocate Signup Webhook include:

* Tracking when users select the checkbox to opt into your email newsletter

* Collection of data for Business Intelligence and analytics systems to track
users who become Advocates

* Sending automated ‘Thank You’ emails after a user becomes an Advocate

## When does Talkable call the Advocate Signup Webhook?

Talkable Signup Webhook is triggered any time an Advocate Signup Form is
submitted. The Advocate Signup Form is the standard Name & Email (with optional
email subscription checkbox) fields a user submits before becoming an Advocate
and sharing an offer with Friends.

Advocate Signup Form example:

[Image]

## Payload parameters provided for Advocate Signup Webhook

The sample payload with parameters for Advocate Signup Webhook is available here: [Advocate Signup Webhook Payload](https://www.talkable.com/api-docs/index.html?urls.primaryname=webhooks%20api&urls.primaryName=Webhooks#/Advocate%20Signup/post_your_api_advocate_signup_web_hook_path).

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/web_hooks/post_share.md
===============================================================================

# Post Share Webhook

Talkable Post Share Webhook provides notification of a share event performed within a referral campaign workflow. Use cases for the Post Share Webhook include:

* Sending automated ‘Thank You’ email to an Advocate for performing a share

* Any event that should be triggered when a user shares

* Data for Business Intelligence and analytics systems

## When does Talkable call the Post Share Webhook?

Talkable Post Share Webhook is triggered any time an Advocate (referrer) shares offer details with a Friend (referee) via the corresponding form provided by campaign workflow. Which includes any time:

* An advocate shares with a Friend via Email or any other channel from inside a referral campaign workflow

* An Advocate copies a share link from a referral campaign workflow share screen
> **Note:**
>
> The Post Share Webhook triggers every time a share occurs. For example, if an Advocate shares with a Friend via email (or any channel), then shares with a second Friend via email (or any channel), the Post Share Webhook will be triggered twice.

## Payload parameters provided for Post Share Webhook

The sample payload with parameters for Post Share Webhook is available here: [Post Share Webhook Payload](https://www.talkable.com/api-docs/index.html?urls.primaryname=webhooks%20api&urls.primaryName=Webhooks#/Post%20Share/post_your_api_post_share_web_hook_path).
> **Note:**
>
> `origin.email` contains the email saved at the moment when the campaign is
> first shown to the Advocate. It could be `null`. For the most up-to-date
> information about the Advocate, use `sharer_info` property which is updated
> with the email address the Advocate has entered on the Advocate Signup/Share Page.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/web_hooks/referral.md
===============================================================================

# Referral Webhook

The Talkable Referral Webhook notifies your endpoint that an Advocate referral
status has become “Approved” specifically for a Friend purchase
or event.

“Approved” referral status signifies the following:

* Neither Advocate nor Friend are blocked by email or IP

* Advocate passed enabled fraud checks and is considered non-fraudulent

Use cases for the Referral Webhook include:

* Providing account credit or account upgrades to an Advocate as a reward

* Giving non-monetary rewards such as physical gifts to an Advocate

* Sending automated ‘Thank You’ emails after a reward is given to an Advocate

* Data for business intelligence or analytics systems to track when Advocates receive rewards
> **Note:**
>
> “Approved” referral status does not guarantee that Advocate will receive a reward.

Things that can prevent Advocate or Friend from being rewarded:

* Share wasn’t active at the moment of referral event creation

* Advocate Referral Incentive rewards limit (per month or in total) has been reached

* Coupon cycling has been detected (when Friend uses Advocate’s coupon in referred event)

* Incentive criteria does not match

* Rewards issuing is not allowed for auto-approved referrals
> **Important:**
>
> Referral Webhook keeps retrying until it gets 2xx HTTP status in response.
> Only after that rewards associated with the referral can be paid.

## When does Talkable call the Referral Webhook?

Talkable Referral Webhook is triggered any time an Advocate referral status has become
“Approved” specifically for a Friend purchase or event.
> **Note:**
>
> Referral Webhook triggers only for Advocate rewards specifically from a Friend
> Purchase or Friend Event (such as signup event or subscription purchase event).
> To receive notification of both Advocate and Friend rewards use the Rewards Webhook.

## Payload parameters provided for Referral Webhook

The sample payload with parameters for Referral Webhook is available here: [Referral Webhook Payload](https://www.talkable.com/api-docs/index.html?urls.primaryname=webhooks%20api&urls.primaryName=Webhooks#/Referral/post_your_api_referral_web_hook_path).

## Coupon codes as a reward
> **Important:**
>
> If referral campaigns are set-up to reward either Friends or Advocates with
> Talkable provided coupon codes, then the Reward Webhook is called for
> informational purposes only. It is a notification that the reward has been
> provided. Note, Talkable gets these coupons either by manual upload from the
> Dashboard, or if configured, Talkable will call the [Create Coupon Webhook](https://docs.talkable.com/web_hooks/create_coupon.md#web-hooks-create-coupon) to generate additional coupons
> automatically.

## Incentive types

Incentives can be of 3 following general types.

* **Rebate** (rebate) — monetary reward, certain amount of money that should
be paid out to a customer with a given email. The merchants’ payment system
should handle the payment.

* **Coupon code** (discount_coupon) — a discount coupon is issued to user.
Talkable handles distributing this type of incentives.

* **Non-monetary** (other) — used when a campaign has a non-monetary rebate
like *“Free T-shirt”* or *“One Month Free”*. This should be handled on the
merchant’s side. More information on the reward is specified in incentive_description.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/web_hooks/reward.md
===============================================================================

# Reward Webhook

The Talkable Reward Webhook notifies your endpoint that a reward is ready to be,
or has been given. A reward can be for either an Advocate or for a Friend.
Talkable Reward Webhook notifications allow your application to know when to
reward users by means other than the standard ‘give them a coupon code’ method.

Use cases for the Reward Webhook include:

* Providing account credit or account upgrades to a user as a reward

* Giving non-monetary rewards such as physical gifts

* Sending automated ‘Thank You’ emails after a reward is given to a user

* Any event that should trigger at the moment a user has earned a reward

## When does Talkable call the Reward Webhook?

Talkable calls the Reward Webhook any time a reward is ready to be, or has been
given to either an Advocate or a Friend according to the logic set-up in a
Talkable referral campaign.

Possible events which will trigger the Reward Webhook are:

* Advocate Signup Form submitted (Reason = **signup**)

* Advocate shares an offer with Friend(s) (Reason = **shared**)

* Friend passes email gating form (Reason = **click**)
> **Note:**
>
> If campaign is setup without email gating form, Reward Webhook with
> Reason = click will trigger when Friend clicks through to site.

* Friend makes eligible purchase (Reason = **referrer**)

* Friend makes eligible purchase (Reason = **referred**)
> **Note:**
>
> Reason = referrer indicates a reward should be given to an Advocate.
> Reason = referred indicates a reward should be given to a Friend.

## Set-Up

Because the Reward Webhook will trigger at various events depending on the
Incentive configuration for each referral campaign, to trigger the Reward
Webhook we first must ensure Incentives are correctly configured.
To configure incentives:

1. Navigate to **Campaigns** then select the campaign you would like to
configure incentives for

2. Proceed to **Rules** then scroll down to **Incentives** section where
incentives for both Advocates and Friends can be set-up

[Image]

3. Configure the incentives as desired inside the Referral Incentive Editor.
To configure Incentive types other than Coupon Codes, please contact your
Talkable Customer Success Manager; they will be able to set up “Rebate (store
credit)” type incentives and “Non-Monetary” type incentives.
> **Note:**
>
> If there is a delay configured into when the Advocate reward is approved then
> the Reward Webhook trigger when the Advocate reward is ready to be, or has
> been given. For example, if campaigns are set to send an Advocate their reward
> three days after a Friend makes an eligible purchase, then the Reward Webhook
> will be called three days after the Friend makes the eligible purchase. You
> can select these delays under **Fraud Settings**, which is found under **Menu**.

Once incentives are configured for a referral campaign, Talkable will then call
the Reward Webhook any time either an Advocate or a Friend should receive a
reward. Now, the Reward Webhook can be set-up. [Learn more about General Webhook Set Up Steps](https://docs.talkable.com/web_hooks.md#web-hooks)

## Payload parameters provided by Reward Webhook

The sample payload with parameters for Reward Webhook is available here: [Reward Webhook Payload](https://www.talkable.com/api-docs/index.html?urls.primaryname=webhooks%20api&urls.primaryName=Webhooks#/Reward/post_your_api_reward_web_hook_path).

## Reasons

Reward reason can be of 5 following general types.

* **signup** — Advocate reward for sign-up (Advocate Signup Form submitted)

* **shared** — Advocate reward for sharing an offer with Friend(s)

* **click** — Friend reward for visiting claim page (and optionally passing gating)

* **referrer** — Advocate reward for eligible referral purchase by Friend

* **referred** — Friend reward for eligible referral purchase by themselves

## Incentive types

Incentives can be of 3 following general types.

* **Rebate** (rebate) — monetary reward, certain amount of money that should
be paid out to a customer with a given email. The merchants’ payment system
should handle the payment.

* **Coupon code** (discount_coupon) — a discount coupon is issued to user.
Talkable handles distributing this type of incentives.

* **Non-monetary** (other) — used when a campaign has a non-monetary rebate
like *“Free T-shirt”* or *“One Month Free”*. This should be handled on the
merchant’s side. More information on the reward is specified in incentive_description.

## Coupon codes as a reward
> **Important:**
>
> If referral campaigns are set-up to reward either Friends or Advocates with
> Talkable provided coupon codes, then the Reward Webhook is called for
> informational purposes only. It is a notification that the reward has been
> provided. Note, Talkable gets these coupons either by manual upload from the
> Dashboard, or if configured, Talkable will call the [Create Coupon Webhook](https://docs.talkable.com/web_hooks/create_coupon.md#web-hooks-create-coupon) to generate additional coupons
> automatically.

<!-- DOCUMENT_END -->

<!-- DOCUMENT_START -->
Source: https://docs.talkable.com/web_hooks/unsubscribe.md
===============================================================================

# Unsubscribe Webhook

Talkable Unsubscribe Webhook provides notification of a user unsubscribing from
Talkable sent referral email.

Use cases for the Unsubscribe Webhook include:

* Unsubscribing users from in-house marketing newsletters when user unsubscribes
from Talkable referral emails

* Any event that should be triggered when a user unsubscribes from Talkable
referral emails

## When does Talkable call the Unsubscribe Webhook?

Talkable Unsubscribe Webhook is called any time a user unsubscribes from a
Talkable sent email.

## Payload parameters provided

The sample payload with parameters for Unsubscribe Webhook is available here: [Unsubscribe Webhook Payload](https://www.talkable.com/api-docs/index.html?urls.primaryname=webhooks%20api&urls.primaryName=Webhooks#/Unsubscribe/post_your_api_unsubscribe_web_hook_path).

<!-- DOCUMENT_END -->

---

## Summary

Total documents aggregated: 175
Generated by talkable-llm-txt

