# Get token Source: https://docs.cello.so/api-reference/authentication/get-token POST /token Obtain accessToken & refreshToken using your accessKeyId and secretAccessKey, or obtain a new accessToken using a refreshToken. # Send demo-attended Source: https://docs.cello.so/api-reference/generic-events/demo-attended-v2 api-reference/openapi-v2.json POST /v2/events/demo-attended Reports that a referred user attended a demo call. Carries the common subject block and nothing else, on the same reasoning as `signup-created`. Part of the [v2 events contract](/api-reference/generic-events/send-event). See also: [signup created](/api-reference/generic-events/signup-created-v2), [purchase created](/api-reference/generic-events/purchase-created-v2), [purchase refunded](/api-reference/generic-events/purchase-refunded-v2). # Send purchase-created Source: https://docs.cello.so/api-reference/generic-events/purchase-created-v2 api-reference/openapi-v2.json POST /v2/events/purchase-created Reports that a referred user paid for something. Requires `amount`, `currency`, `invoiceId` and `subscription` on top of the common subject block. `subscription.interval` is required. `amount` is an integer in the minor unit of `currency`, so 49.00 EUR is `4900`. A zero amount is permitted here, because a trial conversion or a fully discounted first invoice is a real purchase event. Part of the [v2 events contract](/api-reference/generic-events/send-event). See also: [signup created](/api-reference/generic-events/signup-created-v2), [purchase refunded](/api-reference/generic-events/purchase-refunded-v2), [demo attended](/api-reference/generic-events/demo-attended-v2). # Send purchase-refunded Source: https://docs.cello.so/api-reference/generic-events/purchase-refunded-v2 api-reference/openapi-v2.json POST /v2/events/purchase-refunded Reports that a previously reported purchase was refunded. `amount` is the positive magnitude of the refund in the minor unit of `currency`. The direction is carried by the event type, so a negative amount is a validation failure rather than an encoding. `invoiceId` identifies the payment being reversed. Part of the [v2 events contract](/api-reference/generic-events/send-event). See also: [signup created](/api-reference/generic-events/signup-created-v2), [purchase created](/api-reference/generic-events/purchase-created-v2), [demo attended](/api-reference/generic-events/demo-attended-v2). # Send new event Source: https://docs.cello.so/api-reference/generic-events/send-event > [!NOTE] > > If you implemented Cello before 1 September 2026, you're probably using our Version 1 endpoint for sending events. That endpoint is still supported, and you can find its documentation [here](/api-reference/generic-events/send-event-v1). The version 2 replaces the single `POST /events` endpoint with one endpoint per business event, each with a closed schema and strict validation: undeclared fields are refused, enums are closed, timestamps require an explicit UTC offset, and monetary amounts are integers in the currency's minor unit. Every violation in a request is reported at once, each with a JSON Pointer to the offending field. > [card] [Signup created](/api-reference/generic-events/signup-created-v2) > > Report a referred user creating an account > [card] [Purchase created](/api-reference/generic-events/purchase-created-v2) > > Report a new purchase or subscription > [card] [Purchase refunded](/api-reference/generic-events/purchase-refunded-v2) > > Report a previously reported purchase being refunded > [card] [Demo attended](/api-reference/generic-events/demo-attended-v2) > > Report a referred user attending a demo call # Send signup-created Source: https://docs.cello.so/api-reference/generic-events/signup-created-v2 api-reference/openapi-v2.json POST /v2/events/signup-created Reports that a referred user created an account. Carries the common subject block and nothing else: a signup has no monetary value, so `amount`, `currency`, `invoiceId` and `subscription` are not declared on this endpoint and sending any of them is a validation failure. Part of the [v2 events contract](/api-reference/generic-events/send-event). See also: [purchase created](/api-reference/generic-events/purchase-created-v2), [purchase refunded](/api-reference/generic-events/purchase-refunded-v2), [demo attended](/api-reference/generic-events/demo-attended-v2). # Introduction Source: https://docs.cello.so/api-reference/introduction Overview of Cello API for referral codes, authentication, and quickstart. ## Cello API The Cello API provides endpoints to: * Validate referral codes (`ucc`) * Retrieve active referral links * Send referral events for signups and purchases *** ## Base URLs Use the URL that matches your environment: | Environment | Base URL | | - | - | | Sandbox | `https://api.sandbox.cello.so/` | | Production | `https://api.cello.so/` | *** ## Authentication Authenticate API requests using an `accessToken` in the Authorization header. Obtain your `accessKeyId` and `secretAccessKey` from [Developers → Access keys](https://app.cello.so/developers/access-keys) in your dashboard. # Get new user reward info Source: https://docs.cello.so/api-reference/new-users/get-reward GET /new-users/{productUserId}/reward Retrieve details on eligibility for the new user reward (discount) and referral information. ## Common reasons for `eligible: false` If the response is `{ "eligible": false }` even though the user has a `cello_ucc`, the most common causes are: * **No active new-user reward on the campaign** - the campaign tied to the UCC has no new-user discount configured, or the reward is inactive/expired. * **`productUserId` mismatch** - the `productUserId` you passed isn't the user who actually signed up through the referral. * **Attribution arrived after the first invoice** - `cello_ucc` was added to the customer after the first `invoice.paid`; attribution can be retroactive, but reward eligibility is still evaluated against the reward rules. * **Self-referral** - the new user signed up using their own UCC, or the signup was flagged as a [self-referral](/guides/fraud-detection) by Cello's fraud detection. Self-referrals are not eligible for new-user discounts. To verify, compare `referralUcc`, `campaignId`, and `campaignRevision` from the response (when `eligible: true`) against what you expect, and check the [Referrals → Review](https://app.cello.so/referrals/review) section in the portal for self-referral flags. # Fetch active link Source: https://docs.cello.so/api-reference/referral-codes/fetch-active-link GET /referral-codes/active-link/{productUserId} Retrieve an active UCC and invite link for a given user to support contextual sharing. # Fetch referral code info Source: https://docs.cello.so/api-reference/referral-codes/fetch-referral-code-info GET /referral-codes/{code} Validate a referral code (UCC) and discover associated user/campaign. # Apply Discounts Source: https://docs.cello.so/attribution/apply-discounts Learn how to apply discounts to referred users when the purchase a subscription ## Implementation steps Implementing automated discounts for referred users follows a consistent pattern across all subscription platforms. Here's the complete workflow: **1. Configure discounts in your subscription platform** Create discount coupons in your subscription platform (Stripe, Chargebee, Paddle, Recurly, etc.): **Platform Setup:** * Configure discounts at the plan/price level * Create multiple variations for different subscription plans: * Monthly plans: e.g., 25% off for 3 months * Annual plans: e.g., 50% off first year * Store provider coupon IDs in application configuration. You will need them later to apply the correct coupon at subscription time based on plan/price and referral status. > [!NOTE] > > Once you’ve set up discounts in your subscription platform, a potential next step would be to [display the discount information on your pricing or landing page](/guides/user-experience/new-user-discounts). **2. Subscription step: Check if new user is a Cello referral** During subscription creation, check if the new user is a Cello referral and discount needs to be assigned: * New ⭐: Use our [New User Reward API](/api-reference/new-users/get-reward) to validate the eligibility for a new user reward (discount) or * **Using Stripe or Chargebee only:** Check your Stripe/Chargebee Customer if a `cello_ucc` is present in the [**Customer Object**](https://apidocs.chargebee.com/docs/api/customers)**.** * **Using CelloAPI to track signups and Stripe/Chargebee to track purchases:** Check your Stripe/Chargebee customer if a `cello_ucc` is present in the [**Customer Object**](https://apidocs.chargebee.com/docs/api/customers) * **Cello API to track all conversion events:** Check if the new user with this id has a `cello_ucc` in your profile you stored during [signup tracking](/attribution/tracking-signups). **3. Subscription step: Apply discount** During subscription creation, pass the determined coupon code to your subscription platform: **Required Data for Subscription:** * Plan/Price information * Coupon/discount code **Platform-Specific Application:** * **Stripe**: Use `discounts` array or `coupon` parameter on Checkout Session * **Chargebee**: Apply `coupon_ids` on Subscription or via Hosted Pages (not at customer creation) ### Key Implementation Notes * **Timing**: Discounts must be applied during initial subscription creation, not afterward * **Validation**: Always verify the user is eligible for referral discounts * **Fallback**: Handle cases where discount codes are invalid or expired * **Configuration**: Maintain an application-level mapping of coupon IDs to plan type and referral status so the correct coupon can be applied at subscription time ## Stripe implementation Stripe offers flexible discount mechanisms through **coupons**. For referral discounts, apply coupons during Subscription creation or Checkout. You cannot attach discounts at customer creation. ### Overview There are two ways to apply coupons in Stripe, depending on your integration style: * Server-side Subscription API (apply during `subscriptions.create`) - best for custom UIs. See [Stripe documentation](https://stripe.com/docs/billing/subscriptions/discounts). * Prebuilt Checkout Session (apply during `checkout.sessions.create`) - best for hosted checkout. See [Stripe documentation](https://stripe.com/docs/payments/checkout/discounts). Stripe's discount system works through: * **Coupons**: Define the discount structure (percentage, duration, limits) * **Application methods**: Apply coupons to Subscriptions or Checkout Sessions **1. Create referral coupons in Stripe** Set up discount coupons for your referral program: **Via Stripe Dashboard:** 1. Go to [Stripe Dashboard > Coupons](https://dashboard.stripe.com/coupons) 2. Click "Create coupon" 3. Configure discount parameters: * **Name**: e.g., `Referral Discount - Monthly 25%` * **Type**: Percentage * **Percent off**: 25% * **Duration**: Repeating (3 months) * After creation, store the returned coupon ID in your config **Via Stripe API:** ```javascript theme={null} const stripe = require('stripe')('sk_live_...'); const coupon = await stripe.coupons.create({ name: 'Referral Discount - Monthly 25%', percent_off: 25, duration: 'repeating', duration_in_months: 3, metadata: { campaign_type: 'user-referrals', plan_type: 'monthly' } }); // Save coupon.id to your configuration ``` **2. Apply coupon during subscription creation** ```javascript theme={null} const subscription = await stripe.subscriptions.create({ customer: user.customerId, items: [{ price: 'price_monthly_plan' }], discounts: [{ coupon: couponId }] }); ``` ### Handle checkout sessions with discounts For Stripe Checkout, include discounts in session creation: ```javascript theme={null} const session = await stripe.checkout.sessions.create({ mode: 'subscription', line_items: [{ price: 'price_monthly_plan', quantity: 1 }], customer: user.customerId, discounts: [{ coupon: couponId }], success_url: 'https://yoursite.com/success', cancel_url: 'https://yoursite.com/cancel' }); ``` The Stripe UI automatically displays the discount during checkout: ![Stripe checkout with discount visualization](https://uploads.developerhub.io/prod/d316/daczbjcm0yz4eegxj4jewsjgh5rxu5e301ene35zmtdx9ds9tcna8zv9g4e447i7.png) ### Manual discount application (not recommended) For testing or special cases, you can manually attach coupons on a Subscription in the Stripe Dashboard: 1. Navigate to the subscription in [Stripe Dashboard](https://dashboard.stripe.com/subscriptions) 2. Click **Update subscription** → **Add coupon** 3. Select the appropriate referral coupon ![Stripe Console apply coupon action](https://uploads.developerhub.io/prod/d316/j4xfvr2jdxctb929xv4h4kqy5mf4hf5ecx6az5pjhc4tptm5qrnh2pm5bake2okl.png) > [!WARNING] > > Manual application is not scalable for automated referral programs. Use the API methods above for production implementations. ## Chargebee implementation Chargebee uses **coupons** to apply discounts on subscriptions. For referral discounts, apply coupons during subscription creation or via Hosted Pages. ### Overview There are two ways to apply coupons in Chargebee: * Subscription API (apply during `subscription.create`) - for server-side subscription creation. See [Chargebee documentation](https://apidocs.chargebee.com/docs/api/subscriptions?prod_cat_ver=2#create_a_subscription). * Hosted Pages (apply via `coupon_ids` during checkout) - for provider-hosted checkout. See [Chargebee documentation](https://apidocs.chargebee.com/docs/api/hosted_pages?prod_cat_ver=2#checkout_new_subscription). Chargebee's discount system works through: * **Coupons**: Define discount rules (percentage, amount, duration) * **Application methods**: Apply to subscriptions or via Hosted Pages **1. Create referral coupons in Chargebee** Set up discount coupons for your referral program: **Via Chargebee Dashboard:** 1. Go to [Chargebee Dashboard > Coupons](https://www.chargebee.com/docs/2.0/coupons.html#creating-coupons) 2. Click "Create Coupon" 3. Configure discount parameters: * **Coupon Name**: e.g., `Referral Discount - Monthly 25%` * **Discount Type**: Percentage * **Discount**: 25% * **Duration Type**: Limited Period (3 months) * After creation, store the coupon ID in your config **Via Chargebee API:** ```javascript theme={null} const chargebee = require('chargebee'); chargebee.configure({ site: 'your-site', api_key: 'your-api-key' }); const coupon = await chargebee.coupon.create({ id: 'YOUR_COUPON_ID', name: 'Referral Discount - Monthly 25%', discount_type: 'percentage', discount_percentage: 25, duration_type: 'limited_period', period: 3, period_unit: 'month' }); ``` **2. Apply coupons during subscription creation** ```javascript theme={null} const subscription = await chargebee.subscription.create({ customer_id: user.id, plan_id: 'monthly_plan', coupon_ids: [couponId] }); ``` ### Handle Hosted Pages with discounts For Chargebee Hosted Pages, include coupons in checkout URLs: ```javascript theme={null} const hostedPage = await chargebee.hosted_page.checkout_new({ subscription: { plan_id: 'monthly_plan', coupon_ids: [couponId] }, customer: { id: user.id, email: user.email } }); // Redirect user to hostedPage.url ``` ## Cello API integration (for other platforms) If you use another billing platform (for example, Paddle, Recurly, Braintree) or a home-grown system, follow the same general approach described above: 1. Create and manage coupons/discounts in your billing system. 2. Keep an application-level mapping of coupon IDs by plan and referral status. 3. Apply the correct coupon at subscription/checkout creation time. # Mobile Signup Flow Source: https://docs.cello.so/attribution/for-mobile Learn how to set up mobile app referral attribution This guide explains how to add referral tracking capabilities to your existing attribution links without creating new ones. In this guide, we'll use Branch.io as an example. The implementation is similar if you use other attribution libraries like [AppsFlyer](https://www.appsflyer.com/), [Singular](https://www.singular.net/) or [Adjust](https://www.adjust.com/). > [!NOTE] > > Mobile attribution builds on top of [web attribution](/attribution/for-web) since users typically click referral links on web before downloading your app. The web setup captures the initial referral code that will later be attributed to the mobile app installation and signup. ## Overview The referral flow works as follows: * Existing user shares their unique referral link * New user clicks the link and is directed to your landing page * User then clicks on AppStore or Google Play app download * New user installs and opens the app * App receives referral data and attributes the installation * Backend records the referral during signup ## Basic Concept Instead of creating new links for each referrer, you'll append referral data to your existing Branch.io (or other attribution library) app install link: ```html theme={null} Original: https://yourbrand.app.link/abc123 With Referral: https://yourbrand.app.link/abc123?referral_ucc=A1B2C ``` ## Data Persists Through Installation When a user clicks the referral link, Branch.io stores the referral data (including the referral_ucc) in their servers and associates it with the user's device fingerprint. This allows the data to persist through: * App Store redirect * App download * First app launch ## Data Flow Sequence #### Link Click ```html theme={null} https://yourbrand.app.link/abc123?referral_ucc=A1B2C ↓ Branch.io captures and stores: - referral_ucc: A1B2C - Device fingerprint - Click timestamp ``` #### App Installation ```html theme={null} User installs app from store ↓ Branch SDK initializes on first launch ↓ Branch matches device to stored click data ↓ Delivers referral data to app ``` ## Accessing Referral Data in Your App #### iOS Implementation ```swift theme={null} import Branch class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { Branch.getInstance().initSession(launchOptions: launchOptions) { (params, error) in // Check if the user came from a Branch link if let clickedBranchLink = params?["+clicked_branch_link"] as? Bool, clickedBranchLink { // Extract referral code if let referralCode = params?["referral_ucc"] as? String { print("Referral Code: \(referralCode)") // Store for use during signup UserDefaults.standard.set(referralCode, forKey: "pending_referral_code") } } } return true } } ``` #### Android Implementation ```kotlin theme={null} class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) Branch.getAutoInstance(this).initSession({ branchUniversalObject, linkProperties, error -> if (error == null) { // Check if user came from Branch link if (linkProperties?.has("+clicked_branch_link") == true) { // Get referral code val referralCode = linkProperties.get("referral_ucc") referralCode?.let { Log.d("Branch", "Referral Code: $it") // Store for signup getSharedPreferences("app_prefs", Context.MODE_PRIVATE) .edit() .putString("pending_referral_code", it) .apply() } } } }, this.intent.data, this) } } ``` #### React Native Implementation ```javascript theme={null} import branch from 'react-native-branch'; function DeepLinkHandler() { useEffect(() => { // Handle deep link when app is already running const subscription = branch.subscribe({ onNewIntent: ({ error, params, uri }) => { if (error) { console.error('Branch link error:', error); return; } if (params['+clicked_branch_link']) { handleDeepLink(params); } } }); return () => subscription(); }, []); const handleDeepLink = async (params) => { const referralCode = params.referral_ucc; if (referralCode) { await AsyncStorage.setItem('pending_referral_code', referralCode); // Handle navigation or other logic based on deep link } }; return null; } ``` ## Using the Referral Data During Signup When the user completes signup, retrieve the stored referral code and include it in your signup API call: #### iOS Implementation ```swift theme={null} // iOS Example class SignupViewController: UIViewController { func completeSignup(email: String, password: String) { // Get stored referral code let referralCode = UserDefaults.standard.string(forKey: "pending_referral_code") // Include in signup API call let signupData = [ "email": email, "password": password, "referral_code": referralCode ] api.signup(signupData) { result in if result.success { // Clear stored referral data after successful signup UserDefaults.standard.removeObject(forKey: "pending_referral_code") } } } } ``` #### Android Implementation ```kotlin theme={null} // Android Example class SignupActivity : AppCompatActivity() { private fun completeSignup(email: String, password: String) { val prefs = getSharedPreferences("app_prefs", Context.MODE_PRIVATE) val referralCode = prefs.getString("pending_referral_code", null) val signupData = HashMap().apply { put("email", email) put("password", password) referralCode?.let { put("referral_code", it) } } api.signup(signupData) { success -> if (success) { // Clear stored referral data prefs.edit().remove("pending_referral_code").apply() } } } } ``` #### React Native Implementation ```javascript theme={null} function SignupScreen({ navigation }) { const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const handleSignup = async () => { try { const referralCode = await AsyncStorage.getItem('pending_referral_code'); const response = await api.signup({ email, password, referral_code: referralCode }); if (response.success) { await AsyncStorage.removeItem('pending_referral_code'); navigation.navigate('Home'); } } catch (error) { console.error('Signup error:', error); } }; return ( // Your signup form JSX ); } ``` # Web Signup Flow Source: https://docs.cello.so/attribution/for-web Learn how to capture referral codes on your website When users click referral links, they land on your website first. Capture the referral code (`ucc`) on this landing page to properly attribute future conversions. Follow these steps to set up referral code capture: ## Step 1: Set up your landing page Create a landing page for referral traffic. Choose one approach: * Dedicated referral landing page * Home page with Cello New User Banner See the [landing page optimization guide](/guides/user-experience/optimizing-landing-pages) for best practices. ## Step 2: Install attribution script The attribution script detects the `ucc` query parameter and stores it as a first-party cookie for later attribution of conversion events. Install the Cello attribution script - [Attribution JS](/sdk/client-side/attribution-js-introduction) - using one of these methods: > [card] [Embedded Script Tag](/sdk/client-side/embedded-script-tag) > [card] [Google Tag Manager](/sdk/client-side/google-tag-manager) The attribution script also enables you to: * Fetch referrer names for [landing page personalization](/guides/user-experience/personalizing-referrals) * Get campaign parameters to [display discounts](/guides/user-experience/new-user-discounts) * Attach `ucc` to signup forms See the [Attribution JS reference](/sdk/client-side/attribution-js-introduction) for complete details. ## Step 3: Verify installation Verify that the `ucc` is available on your signup page: 1. Test your website with these query parameters: ```html theme={null} https://yourwebsite.com/?productId=test&ucc=test ``` 2. Verify these values are saved as cookies: `cello-product-id` and `cello-referral` 3. On your signup page, test `ucc` access from the browser console: ```javascript theme={null} window.CelloAttribution('getUcc') ``` Expected response: ```javascript theme={null} Promise {: 'test'} ``` If this test passes, the script is installed correctly. > [!TIP] > > **Using referral codes at signup** > > Use `getUcc()` during user signup to retrieve the referral code, then pass it in the [signup event](/attribution/tracking-signups) to Cello. > > For complex flows, save the `ucc` with your user record so it's available when sending [signup events](/attribution/tracking-signups). # HubSpot Forms Source: https://docs.cello.so/attribution/hubspot Integrate the Cello attribution library with HubSpot forms to track referral conversions ## Overview This guide shows you how to capture referral codes (`ucc`) from visitors and automatically populate them into HubSpot forms when users submit lead generation or contact forms. This enables you to track which referrals lead to qualified leads and conversions. ## Considerations when creating the `ucc` property in HubSpot When creating a custom property in HubSpot, it is important that the internal name of the property is `ucc`. This sets up the property in either company or deal. The one to choose depends on your specific sales process and the corresponding HubSpot setup. These instructions describe creating the `ucc` property in the object type **Company**, group **Company information**. Often, it can make sense to create the `ucc` property in the **Deal** object type. A custom property can be created following the instructions of HubSpot [here](https://knowledge.hubspot.com/properties/create-and-edit-properties). ## Step 1: Create a form with a hidden `ucc` field in HubSpot To properly capture referral data, you need to add a `ucc` field to your HubSpot form: 1. Create a customized form in HubSpot by following the instructions [here](https://knowledge.hubspot.com/forms/create-forms). 2. In your form, create a hidden field called `ucc`. This field automatically picks up the `ucc` from the link and feeds it into the create `ucc` property in HubSpot. The result should look like this: ![Cello Attribution Capture UCC HubSpot deal with Hubspot Form](https://mintcdn.com/cello/D7nCTSBgsY2VCpmV/attribution/cello-attribution-capture-referral-code-ucc-hubspot-forms-1.png?fit=max\&auto=format\&n=D7nCTSBgsY2VCpmV\&q=85\&s=146bf5c9ee98b90ae500c78ebca813cc) ## Step 2: Include the Cello Attribution Library Add the Cello attribution script to your website's `` section or before the closing `` tag: ```html theme={null} ``` ## Step 3: Add the Attribution Command Queue Since HubSpot forms are loaded dynamically, include this script to handle race conditions between your code and the Cello library loading: ```html theme={null} ``` > [!WARNING] > > **Important:** This script must be added before any calls to `window.CelloAttribution()` to prevent race conditions. ## Step 3: Integrate with HubSpot Form Creation When creating your HubSpot form, use the `onFormReady` callback to populate the referral code. Replace the placeholder values with your actual HubSpot configuration: ```javascript theme={null} hbspt.forms.create({ region: "AAA", // Replace with your HubSpot region (e.g., "na1") portalId: "BBB", // Replace with your HubSpot Portal ID formId: "CCC", // Replace with your HubSpot Form ID onFormReady(form, ctx) { window.CelloAttribution('getUcc').then((celloUcc) => { console.log('Incoming Referral:', celloUcc); // Find all ucc fields and populate them document.querySelectorAll('input[name="ucc"]').forEach( el => { el.value = celloUcc; } ); }).catch((error) => { console.log('No referral code found or error occurred:', error); }); } }); ``` ## Test Your Implementation ### 1. Test Referral Code Capture 1. Visit your page with a referral parameter: ``` https://yoursite.com/landing-page?ucc=test123&productId=yourproduct ``` 2. Open browser developer tools and check: ```javascript theme={null} // Test if ucc is available window.CelloAttribution('getUcc') ``` Expected response: `Promise {: 'test123'}` ### 2. Test Form Integration 1. Open the page with the created form 2. Add `?ucc=demo12345687` to the link and reload the page. After the initialization of the config, this will be added automatically to the link by Cello 3. Enter some test data into the form. The result should look similar to the following ![Cello Attribution Capture UCC HubSpot deal with Hubspot Form](https://mintcdn.com/cello/D7nCTSBgsY2VCpmV/attribution/cello-attribution-capture-referral-code-ucc-hubspot-forms-2.png?fit=max\&auto=format\&n=D7nCTSBgsY2VCpmV\&q=85\&s=06457c4ed3e097b01cb2764cdf152424) 4. Submit your HubSpot form 5. HubSpot should now have created a new contact and a new company. In the new company, you should find the `ucc` property filled with the entered value `demo12345687` 6. The test was successful. You can now move ahead to the section on providing the required data to Cello. ![Cello Attribution Capture UCC HubSpot deal with Hubspot Form](https://mintcdn.com/cello/D7nCTSBgsY2VCpmV/attribution/cello-attribution-capture-referral-code-ucc-hubspot-forms-3.png?fit=max\&auto=format\&n=D7nCTSBgsY2VCpmV\&q=85\&s=b5111b48189f3cf774896d699a9de59b) ## Troubleshooting ### Common Issues and Solutions **1. "getReferral is not supported" error** * Make sure you're using `getUcc()` instead of `getReferral()` * This is the correct method for the latest attribution library **2. Form fields not getting populated** * Verify your form has a field with `name="ucc"` * Check that the field selector in `querySelectorAll()` matches your form * Ensure the `onFormReady` callback is executing **3. Referral code is undefined** * Test with a URL containing the `ucc` parameter: `?ucc=test123` * Check browser cookies for `cello-referral` * Verify the attribution script loaded properly **4. Script loading order issues** * Always include the command queue script before any attribution calls * Use the `async` attribute on the attribution library script ## HubSpot Scheduling Pages Integration You can also use the Cello attribution library with HubSpot scheduling pages to capture referral codes when prospects book meetings or demos. This is particularly useful for sales-led referral programs where referrals often lead to booked consultations or product demos. ### How it works HubSpot scheduling pages include built-in forms that collect contact information before allowing visitors to book meetings. You can integrate Cello attribution with these forms using the same approach as regular HubSpot forms. ### Setup Steps The integration process for scheduling pages is identical to regular forms: 1. Include the Cello Attribution Library (Steps 2-3 above remain the same) 2. Set up the `ucc` property in your HubSpot contacts/companies 3. Add a hidden `ucc` field to your scheduling page form 4. Configure the scheduling page to populate the referral code ### Adding `ucc` Field to Scheduling Pages 1. Create or edit a scheduling page ([HubSpot's scheduling page guide](https://knowledge.hubspot.com/meetings-tool/create-and-edit-scheduling-pages)) 2. In the "Form" section, add the created `ucc` parameter to the form. You can't hide this field on a scheduling page. This field automatically picks up the `ucc` parameter from the link and feeds it into the created `ucc` property in HubSpot. The result should look like this: ![Cello Attribution Capture UCC HubSpot deal with Hubspot Form](https://mintcdn.com/cello/D7nCTSBgsY2VCpmV/attribution/cello-attribution-capture-referral-code-ucc-hubspot-forms-scheduling-1.png?fit=max\&auto=format\&n=D7nCTSBgsY2VCpmV\&q=85\&s=0ed01969189bb3830b6837974b5a6afd) ### JavaScript Integration for Scheduling Pages Since scheduling pages are embedded HubSpot components, you'll add the same integration code to the page where your scheduling page is embedded: ```html theme={null} ``` ### Testing Your Scheduling Page Integration 1. Visit your scheduling page with a referral parameter: ``` https://yoursite.com/book-demo?ucc=demo12345687 ``` 2. Start the booking process and fill out the form 3. Complete the booking 4. Check the created contact in HubSpot - the `ucc` field should contain `demo12345687` ### Key Differences from Regular Forms * **Timing**: Scheduling pages load asynchronously, so we use MutationObserver to detect when the form is ready * **Form structure**: Scheduling page forms are embedded HubSpot components with specific styling * **Optional field**: Make the `ucc` field optional since not all meeting bookings will come from referrals * **Meeting context**: The referral code will be associated with the contact and any resulting deals from the meeting > [!TIP] > > **For sales-led businesses**: Integrating referral tracking with scheduling pages is crucial for tracking which referrals lead to qualified sales conversations and ultimately closed deals. # Introduction Source: https://docs.cello.so/attribution/introduction Learn how to implement referral attribution to track signups and purchases back to their original referrers Referral conversion enables you to track and attribute user signups and purchases back to their original referrers and reward them for conversions. Cello helps you capture referral codes `ucc` from landing pages and maintains attribution throughout the entire user journey, from initial visit to final purchase. # How it works The referral conversion process follows a four-step attribution flow: ![Cello Referral conversion process four-step attribution flow overview diagram](https://mintcdn.com/cello/6Zr08teY9AER0ncF/attribution/referral-conversion-tracking-overview-diagram.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=8d2c7e1350fd617e8bab166e32948994) 1. **Referral Link Sharing** - Referrers share links containing unique codes (`ucc` parameters) 2. **Landing Page Capture** - Your website captures and stores referral codes `ucc` as first-party cookies 3. **Signup Tracking** - New user registrations are linked to their referrer 4. **Purchase Tracking** - Revenue events are attributed back to the original referrers > [!TIP] > > Accurate referral conversion tracking depends on properly passing the referral code `ucc` through each step of the referral journey. > [!WARNING] > > **Attribution based on organization level** > > If the buying persona is the organization and you want to attribute purchases on the organization level always provide the **ID of the organization** in the parameter `payload.newUserId` # Getting started with referral conversion tracking Learn how to track conversions with Cello in the following resources: > [card] [Web signup flow](/attribution/for-web) > > Capture referral code during web signup flow > [card] [Mobile signup flow](/attribution/for-mobile) > > Capture referral code during mobile signup > [card] [Track signups](/sdk/client-side/embedded-script-tag) > > A full guide on tracking signup events > [card] [Track purchases](/sdk/client-side/embedded-script-tag) > > A full guide on tracking purchase events or choose a step-by-step quickstart guide for your integration scenario: > [card] [Stripe Webhook Quickstart](/attribution/use-cases/stripe) > [card] [Chargebee Webhook Quickstart](/attribution/use-cases/chargebee) # Track Purchases Source: https://docs.cello.so/attribution/tracking-purchase Learn how to track purchase events with Cello To complete the conversion tracking and reward referrers, you will need to send Cello purchase events. A purchase event is sent when a user pays for a subscription or a product. > [!TIP] > > After sending purchase events, ask your coding tool for a Cello [integration health check](/mcp/developers/integration-status) to confirm Purchases tracking is **Connected**. For per-event detail and to troubleshoot any field validation errors, open [Developers → Events](https://app.cello.so/developers/events) in the Cello Portal. # Prerequisites Before you can send Cello purchase events, make sure you are already: * [Capturing referral code on your landing page](https://docs.cello.so/attribution/for-web) * [Tracking signups](https://docs.cello.so/attribution/tracking-signups) > [!WARNING] > > **Attribution based on organization level** > > If the buying persona is the organization and you want to attribute purchases at the organization level, always provide the **ID of the organization** in the parameter `payload.newUserId` > [!NOTE] > > If you are providing discounts to new users, they need to be [applied at the point of creating a subscription](/attribution/apply-discounts) in your subscription platform # Track purchase events with Webhooks Depending on which payment gateway you’re using, we offer webhooks for the following: > [card] [Stripe Webhook](/integrations/webhooks/stripe-webhook) > > Send events using Stripe Webhook > [card] [Chargebee Webhook](/integrations/webhooks/chargebee-webhook) > > Send events using Chargebee Webhook # Track purchase events with Cello API If you’re not using any of the gateways listed above, you can also send purchase events using Cello API `POST /events` API endpoint. Here are the 2 events you will need to send: ## `invoice-paid` This event is sent every time a transaction based on the provided subscription is successful or a new user buys a one-time plan, a license or something similar. ```bash theme={null} POST https://api.cello.so/events { "eventName": "ReferralUpdated", "payload": { "ucc": "cello-ucc", "newUserId": "new-user-product-user-id", // or 'new-user-organization-id' "price": 100, "currency": "EUR" }, "context": { "newUser": { "id": "new-user-product-user-id", "email": "new-user@gmail.com", "organizationId": "new-user-organization-id" }, "event": { "trigger": "invoice-paid", "timestamp": "2022-10-05 14:14:34" }, "subscription": { "invoiceId": "34hsjdh34jfksd", "interval": "one-time", "productKey": "Pro License" } } } ``` Here are the properties you can include when sending a `invoice-paid` event: | Property | Required | Description | | - | - | - | | `ucc` | yes | A referral code (`ucc`) identifying the referrer. You can retrieve this code using [attribution script](/sdk/client-side/attribution-js-introduction) `getUcc ()` method, you have installed as a prerequisite to this guide | | `newUserId` | yes | A unique ID in your system, identifying the **new user** who just signed up. Can also be **organization ID**, if your referrers can refer organizations and you want to **reward them for organization account expansion** | | `price` | yes | Amount on the invoice | | `currency` | yes | Currency of the amount | | `newUser.id` | yes | A unique ID of the new user (not the organization, if you are rewarding on organization level). This should be the same ID (`productUserId`) you will use to boot the [Referral component](/referral-component/introduction), when this user logs into your app | | `newUser.email` | yes | New user email | | `newUser.organizationId` | no | Organization ID. Add this field if your referrers can **refer an organization** and you want to reward them for **organization account expansion** | | `event.trigger` | yes | `invoice-paid` | | `event.timestamp` | yes | Event timestamp in **ISO8601 format** | | `subscription.invoiceId` | yes | ID of the invoice that was paid or refunded | | `subscription.interval` | yes | Interval of the payment. Available options: `one-time`, `weekly`, `bi-weekly`, `monthly`, `quarterly`, `semi-annual`, `yearly`, `biennial`, `triennial`, `lifetime` | | `subscription.productKey` | yes | Name of the product or plan purchased | Full API referrence for `POST /events` API endpoint can be found [here](/api-reference/generic-events/send-event). ## `charge-refunded` This event is sent if the payment of the new user was refunded. When Cello receives this event, it automatically cancels any pending reward for that transaction. ```bash theme={null} POST https://api.cello.so/events { "eventName": "ReferralUpdated", "payload": { "ucc": "cello-ucc", "newUserId": "new-user-product-user-id", // or 'new-user-organization-id' "price": 1000, "currency": "EUR" }, "context": { "newUser": { "id": "new-user-product-user-id", "email": "new-user@gmail.com", "organizationId": "new-user-organization-id" }, "event": { "trigger": "charge-refunded", "timestamp": "2022-10-05 14:14:34" }, "subscription": { "invoiceId": "34hsjdh34jfksd" } } } ``` Here are the properties you can include when sending a `charge-refunded` event: | Property | Required | Description | | - | - | - | | `ucc` | yes | A referral code (`ucc`) identifying the referrer. You can retrieve this code using [attribution script](/sdk/client-side/attribution-js-introduction) `getUcc ()` method, you have installed as a prerequisite to this guide | | `newUserId` | yes | A unique ID in your system, identifying the **new user** who just signed up. Can also be **organization ID**, if your referrers can refer organizations and you want to **reward them for organization account expansion** | | `price` | yes | Amount refunded | | `currency` | yes | Currency of the amount | | `newUser.id` | yes | A unique ID of the new user (not the organization, if you are rewarding on organization level). This should be the same ID (`productUserId`) you will use to boot the [Referral component](/referral-component/introduction), when this user logs into your app | | `newUser.email` | yes | New user email | | `newUser.organizationId` | no | Organization ID. Add this field if your referrers can **refer an organization** and you want to reward them for **organization account expansion** | | `event.trigger` | yes | `charge-refunded` | | `event.timestamp` | yes | Event timestamp in **ISO8601 format** | | `subscription.invoiceId` | yes | ID of the invoice that was paid or refunded | Full API referrence for `POST /events` API endpoint can be found [here](/api-reference/generic-events/send-event). # Track Signups Source: https://docs.cello.so/attribution/tracking-signups Learn how to track signup events with Cello When a referee signs up or otherwise shows interest in your product - like booking or attending a demo - you need to send this event to Cello. This allows Cello to attribute this conversion to the referrer, so they can be rewarded if a purchase happens later. You can also choose to reward users for actions like signups or demos by configuring this in your [Campaign settings](/guides/campaigns/setting-up-campaigns). > [!TIP] > > After sending signup events, ask your coding tool for a Cello [integration health check](/mcp/developers/integration-status) to confirm Signups tracking is **Connected**. For per-event detail and to troubleshoot any field validation errors, open [Developers → Events](https://app.cello.so/developers/events) in the Cello Portal. # Prerequisites Before you can send Cello signup events, you need to make sure that you are able to **capture the referral code** `ucc`**during signup or demo booking**: * [When users sign up in your web app](/attribution/for-web) * [When users sign up in your mobile app](/attribution/for-mobile) * When users book a demo using [Hubspot](/attribution/hubspot) or [Typeform](/attribution/typeform) forms or scheduling > [!WARNING] > > **Attribution based on organization level** > > If the buying persona is the organization and you want to attribute purchases at the organization level, always provide the **ID of the organization** in the parameter `payload.newUserId` # Tracking signup events For a SaaS application signup flow, you will track a signup event or equivalent. Depending on how you create a new user and which payment gateway you are using, you can choose from the following options to send Cello signup events. ## Option 1: Using Stripe - I create Stripe Customer at Signup > [!TIP] > > Use this option if your payment gateway is Stripe and you **create a Stripe customer at signup** To track a signup, you can pass the following `metadata` to Stripe [Customer Object](https://docs.stripe.com/api/customers/object?api-version=2024-09-30.acacia#customer_object-metadata) on customer creation. * `cello_ucc` - ucc, a referral code identifying the referrer. You can retrieve this code using [attribution script](https://docs.cello.so/sdk/client-side/attribution-lib) `getUcc ()` method, you have installed as a prerequisite to this guide. * `new_user_id` - a unique user ID in your system, identifying the new user who just signed up. This should be the same ID (`productUserId`) you will use to boot the [Referral component](https://docs.cello.so/sdk/client-side/cello-js), when this user logs into your app * `new_user_organization_id` (optional) - add this, if your referrers can refer an organization rather then a single user and you want to reward based on that. Modify customer fields you send upon customer creation. Here is an example for a NodeJS App that does that: ```javascript theme={null} const stripe = require('stripe')('sk_test_51KiCYYCSMQAUBF...'); const customer = await stripe.customers.create({ description: 'New Stripe Customer', metadata: { cello_ucc: "hdz7afhs7", new_user_id: "xcsdad", // product user id of the new user new_user_organization_id: "123456" // organization id of the new user } }); ``` > [!TIP] > > Now that the customer is created in Stripe with Cello metadata, a `customer.created` event will be sent with [Stripe Webhook](/integrations/webhooks/stripe-webhook), which we will count as a signup event in Cello. ## Option 2: Using Chargebee - I create Chargebee customer at signup > [!TIP] > > Use this option if your payment gateway is Chargebee and you **create a Chargebee customer at signup** You can pass the following metadata to Chargebee on customer creation. > [!NOTE] > > You can also choose to use **Chargebee custom fields (CF\_)** to add referral data to the event. Learn more about custom fields in the [**Chargebee documentation**](https://www.chargebee.com/docs/billing/2.0/site-configuration/custom_fields) * `cello_ucc` - ucc, a referral code identifying the referrer. You can retrieve this code using [attribution script](/sdk/client-side/attribution-js-introduction) `getUcc ()` method, you have installed as a prerequisite to this guide. * `new_user_id` - a unique user ID in your system, identifying the new user who just signed up. This should be the same ID (`productUserId`) you will use to boot the [Referral component](/referral-component/introduction), when this user logs into your app * `new_user_organization_id` (optional) - add organization ID, if your referrers can **refer an organization** and you want to reward them for **organization account expansion**. Modify customer fields you send upon customer creation. Here is an example for a NodeJS App that does that: ```javascript theme={null} var chargebee = require("chargebee"); chargebee.configure({site : "getmoonly-v3-test", api_key : "test_jqXGuQLkBHUSR2PM0qgUV21W1VqSFJIU"}); chargebee.customer.create({ first_name : "Bob", last_name : "Bobsky", //... // other customer fields //... meta_data: { cello_ucc: "hdz7afhs7", new_user_id: "xcsdad", // product user id of the new user new_user_organization_id: "123456" // organization id of the new user } // .. // }) ``` > [!TIP] > > Now that the customer is created in Chargebee with Cello metadata, a `Customer Created` event will be sent with [Chargebee Webhook](/integrations/webhooks/chargebee-webhook), which we will count as a signup event in Cello. ## Option 3: Using Cello API POST /events API endpoint > [!TIP] > > Use this option for all other use cases. For example: > > * You use Stripe or Chargebee, but customer is created in the payment gateway **at purchase**. > * Your payment gateway is Paddle, Recurly or other, including in-house built payment gateways Send a `new-signup` event to the Cello API with the following values in the payload: * `ucc` - ucc, a referral code identifying the referrer. You can retrieve this code using [attribution script](/sdk/client-side/attribution-js-introduction) `getUcc ()` method, you have installed as a prerequisite to this guide. * `newUserId` - a unique ID in your system, identifying the **new user** who just signed up. Can also be **organization ID**, if your referrers can refer organizations and you want to **reward them for organization account expansion**. * `newUser.id` - unique ID of the new user (not the organization, if you are rewarding on organization level). This should be the same ID (`productUserId`) you will use to boot the [Referral component](/referral-component/introduction), when this user logs into your app * `newUser.email` - new user email * `newUser.name` - new user name * `newUser.organizationId`(optional) - add organization ID, if your referrers can **refer an organization** and you want to reward them for **organization account expansion**. Here is an example of the `POST /events` call to send a `new-signup` event: ```bash theme={null} POST https://api.cello.so/events { "eventName": "ReferralUpdated", "payload": { "ucc": "cello-ucc", "newUserId": "new-user-product-user-id", // or "new-user-organization-id" "price": 0, "currency": "" }, "context": { "newUser": { "id": "new-user-product-user-id", "email": "new_user@gmail.com", "name": "new-user-name", "organizationId": "new-user-organization-id" }, "event": { "trigger": "new-signup", "timestamp": "2022-10-05 14:14:34" } } } ``` # Tracking "demo attended" event > [!TIP] > > Use this option if your product follows a sales-led model where successful conversions are driven by users attending a demo call. Send a `demo-attended` event to the Cello API with the following values in the payload: * `ucc` - ucc, a referral code identifying the referrer. You can retrieve this code using [attribution script](/sdk/client-side/attribution-js-introduction) `getUcc ()` method, you have installed as a prerequisite to this guide. * `newUserId` - a unique ID in your system, identifying the **new user** who just signed up. Can also be **organization ID**, if your referrers can refer organizations and you want to **reward them for organization account expansion**. * `newUser.id` - unique ID of the new user (not the organization, if you are rewarding on organization level). This should be the same ID (`productUserId`) you will use to boot the [Referral component](/referral-component/introduction), when this user logs into your app * `newUser.email` - new user email * `newUser.name` - new user name * `newUser.organizationId`(optional) - add organization ID, if your referrers can **refer an organization** and you want to reward them for **organization account expansion**. Here is an example of the `POST /events` call to send a `new-signup` event: ```bash theme={null} POST https://api.cello.so/events { "eventName": "ReferralUpdated", "payload": { "ucc": "cello-ucc", "newUserId": "product-user-id" // or 'new-user-organization-id' }, "context": { "newUser": { "id": "new-user-product-user-id", "email": "new-user@gmail.com", "name": "new-user-name", "organizationId": "new-user-organization-id" }, "event": { "trigger": "demo-call-attended", "timestamp": "2022-10-05 14:14:34" } } } ``` # Typeform Forms Source: https://docs.cello.so/attribution/typeform Ingest Cello's referral code (ucc) into HubSpot using Typeform forms This page guides you through the required steps to ingest **Cello's referral code (`ucc`) into HubSpot using Typeform forms**. ## Create a form with a hidden ucc field in Typeform **1. Create a new form** Create a new form in Typeform **2. Add Hidden Fields** On the initial question in your form, go to **Hidden Fields** via **Logic → Hidden Fields** on the panel on the right **3. Add ucc field** Add a new field named `ucc` and click Save ![Cello Capture UCC Typeform hidden fields setup](https://mintcdn.com/cello/l6CiJRlHFcrgg5IY/attribution/attribution-typeform-1.png?fit=max\&auto=format\&n=l6CiJRlHFcrgg5IY\&q=85\&s=3482fe87d0e1810204ccdcc395a02b45) ## Setup of Sync from Typeform to HubSpot **1. Connect HubSpot** Navigate to the **Connect** Section in the header of Typeform and connect HubSpot **2. Select HubSpot object** After the authorization is done, you can select the HubSpot object to which you want to sync the `ucc`. In the below example the `ucc` is synced to a deal in HubSpot. > [!NOTE] > > You can also sync the `ucc` to multiple objects at the same time: contact, company and deals. **3. Configure pipeline** If you sync the `ucc` to a deal, you have to specify in which pipeline at which stage the deals should be created **4. Save and test** After finalizing the setup of the integration, save the settings and run a short test run ![Cello Capture UCC Typeform HubSpot integration setup](https://mintcdn.com/cello/l6CiJRlHFcrgg5IY/attribution/attribution-typeform-2.png?fit=max\&auto=format\&n=l6CiJRlHFcrgg5IY\&q=85\&s=ba9a46d3d4c24b1ceec054da6dc37e7a) ## Test the created Typeform and HubSpot integration **1. Open Typeform** Open the created Typeform **2. Add ucc parameter** Add either `?ucc=12341234` or `&ucc=12341234` to the link depending on if there is already a "?" present in the link ![Cello Capture UCC Typeform URL with UCC parameter](https://mintcdn.com/cello/l6CiJRlHFcrgg5IY/attribution/attribution-typeform-3.png?fit=max\&auto=format\&n=l6CiJRlHFcrgg5IY\&q=85\&s=fc29dad9185d3f22125082433e64b70b) **3. Submit form** Submit the Typeform **4. Verify in HubSpot** Open HubSpot and check that the contact, company or deal was created and the `ucc` was synced correctly ![Cello Capture UCC Typeform HubSpot deal with UCC](https://mintcdn.com/cello/l6CiJRlHFcrgg5IY/attribution/attribution-typeform-4.png?fit=max\&auto=format\&n=l6CiJRlHFcrgg5IY\&q=85\&s=0dbcb3c2d3c77152d4528c070877019b) ## Further hints > [!TIP] > > You can also embed a Calendly in Typeform to allow customers to schedule e.g. a demo from the Typeform. Documentation can be found [here](https://www.typeform.com/connect/calendly/). # Chargebee Webhook Quickstart Source: https://docs.cello.so/attribution/use-cases/chargebee Learn how to integrate Cello if you are using Chargebee JS to create Chargebee customer and Chargebee Webhook to send Cello conversion events. > [!TIP] > > This guide is **optimized for the typical freemium scenario with Chargebee**. > > Use this guide if you: > > * Create Chargebee customer on signup > * Use Chargebee webhook to send Cello referral conversion events # Step 1: Integrate the Referral Component First, integrate Cello Referral Component into your web app to provide referrers with full referral experience. Referral Component is integrated using one of our SDKs. For your web app, use Cello JS - our client-side SDK. You can install it by: 1. Adding a script tag to the `` of your application 2. Generating a JWT token for user authentication 3. Booting the component with the provided token and user details Follow this installation guide: > [card] [Referral Component Quickstart](https://docs.cello.so/referral-component/quickstart) You can also integrate Referral Component into your mobile applications: > [card] [iOS SDK](https://docs.cello.so/sdk/mobile/ios) > [card] [Android SDK](https://docs.cello.so/sdk/mobile/android) > [card] [React Native SDK](https://docs.cello.so/sdk/mobile/react-native) # Step 2: Capture referral codes on landing page Next, you will need to add [Cello attribution script](https://docs.cello.so/sdk/client-side/attribution-lib) to your referral landing page: 1. Setup a [landing page](https://docs.cello.so/docs/optimize-landing) for your referral links to redirect to 2. Install attribution script. Choose one of the following installation options best suited for your setup: > [card] [Embedded Script Tag](https://docs.cello.so/sdk/client-side/embedded-script-tag) > [card] [Google Tag Manager](https://docs.cello.so/sdk/client-side/google-tag-manager) 3. Verify the installation > [!TIP] > > To verify, follow these steps: > > 1. Add `?productId=test` and `?ucc=test` to your website URL > > ```html theme={null} > https://yourwebsite.com/?productId=test&ucc=test > ``` > 2. Make sure that these values are saved in the cookies as `cello-product-id` and `cello-referral` > 3. Navigate to your signup page and try to access the ucc using the `getUcc()` method from the browser console > > ```javascript theme={null} > window.CelloAttribution('getUcc') > ``` > > This method should return a promise with value `test` > > ```javascript theme={null} > Promise {: 'test'} > ``` > > **If this check passes, the script is installed correctly.** For capturing referral code in your mobile signup flow, follow this guide: > [card] [Mobile signup flow](https://docs.cello.so/attribution/for-mobile) # Step 3: Add Cello metadata or custom fields on Chargebee customer creation To track a signup, you can pass the following metadata to Chargebee on customer creation. > [!NOTE] > > You can also choose to use **Chargebee custom fields (CF\_)** to add referral data to the event. Learn more about custom fields in the [**Chargebee documentation**](https://www.chargebee.com/docs/billing/2.0/site-configuration/custom_fields) * `cello_ucc` - ucc, a referral code identifying the referrer. You can retrieve this code using [attribution script](https://docs.cello.so/sdk/client-side/attribution-lib) `getUcc ()` method, you have installed as a prerequisite to this guide. * `new_user_id` - a unique user ID in your system, identifying the new user who just signed up. This should be the same ID (`productUserId`) you will use to boot the [Referral component](https://docs.cello.so/sdk/client-side/cello-js), when this user logs into your app * `new_user_organization_id` (optional) - add this, if your referrers can refer an organization rather then a single user and you want to reward based on that. Modify customer data you send upon customer creation. Here is an example for a NodeJS App that does that with `meta_data`: ```javascript theme={null} var chargebee = require("chargebee"); chargebee.configure({site : "getmoonly-v3-test", api_key : "test_jqXGuQLkBHUSR2PM0qgUV21W1VqSFJIU"}); chargebee.customer.create({ first_name : "Bob", last_name : "Bobsky", //... // other customer fields //... meta_data: { cello_ucc: "hdz7afhs7", new_user_id: "xcsdad", // product user id of the new user new_user_organization_id: "123456" } // .. // }) ``` > [!TIP] > > Now that the customer is created in Chargebee with Cello metadata, a `Customer Created` event will be sent with [Chargebee Webhook](https://docs.cello.so/integrations/webhooks/chargebee-webhook), which we will count as a signup event in Cello. # Step 4: Connect Chargebee Webhook to send signup and purchase events To send Cello signup and purchase events, you will need to connect Chargebee Webhook to Cello. Follow this guide to connect the webhook: > [card] [Chargebee Webhook](/integrations/webhooks/chargebee-webhook) > > Send events using Chargebee Webhook > [!TIP] > > **Congratulations!** You are done and now able to try out the full Cello referral experience 🎉 # HubSpot + Zapier Quickstart Source: https://docs.cello.so/attribution/use-cases/hubspot-zapier Learn how to send Cello signup events from HubSpot deal stage changes using a no-code Zapier workflow. > [!TIP] > > This guide is **optimized for sales-led products** where conversions are driven by demos, sales calls, or other manual qualification steps tracked in HubSpot. > > Use this guide if you: > > * Use **HubSpot** as your source of truth for deals > * Want to send Cello signup events (e.g. `demo-call-attended`) **without writing any backend code** > * Trigger events based on **HubSpot deal stage changes** (e.g. "Demo Done", "Qualified", "Purchase Consideration") # Overview This guide walks you through building a no-code Zapier workflow that: 1. **Watches HubSpot** for deals moving into a specific stage (e.g. "Demo Done") 2. **Filters** deals to only those with a captured `ucc` referral code 3. **Authenticates** with the Cello API to obtain an access token 4. **Sends a signup event** to Cello using the `POST /events` endpoint By the end, every qualified deal in HubSpot will automatically generate a Cello conversion event - letting you reward referrers as soon as their referee attends a demo or hits any milestone in your sales pipeline. # Prerequisites Before you start, make sure you have: * A **HubSpot account** with deals flowing through your sales pipeline * A **Zapier account** (Starter plan or above - Code by Zapier steps require a paid plan) * A **Cello account** with API credentials (`accessKeyId` and `secretAccessKey`) - generate these in the [Cello Portal](https://app.cello.so) * A **`ucc` property** on your HubSpot deal or company object, populated when the referral lands. Follow the [HubSpot Forms attribution guide](/attribution/hubspot) to set this up. * [Cello JS Referral Component](/referral-component/quickstart) integrated in your product so referrers can share referral links > [!WARNING] > > If `ucc` is not being captured on your HubSpot deals, the Zap will skip every event. Complete the [HubSpot Forms attribution setup](/attribution/hubspot) first and verify with a test referral before continuing. # The completed Zap Your finished Zap will have four steps: ![HubSpot + Zapier flow with four steps: retrieve deal info, filter on ucc, create access token, send signup event](https://mintcdn.com/cello/Uf5UjoLiG99SD05k/attribution/hubspot-zapier-flow-overview.png?fit=max\&auto=format\&n=Uf5UjoLiG99SD05k\&q=85\&s=41c5ddf417fdc8cecc7262641d8f361e) # Step 1: Trigger on HubSpot deal stage change The Zap fires whenever a deal enters the stage you choose (typically the one that represents a qualified conversion - "Demo Done", "Purchase Consideration", or similar). 1. In Zapier, create a new Zap and choose **HubSpot** as the trigger app. 2. Pick the event **"Deal in stage"** (or "Deal Property Changed" depending on your HubSpot plan). 3. Select your **Deal Pipeline** and the **Deal Stage** that should trigger the event (e.g. `Demo Done/Purchase Consideration`). 4. Under **Additional properties to retrieve**, add the `ucc` property so it's available in later steps. ![HubSpot trigger configured with pipeline, deal stage, and ucc as an additional property](https://mintcdn.com/cello/Uf5UjoLiG99SD05k/attribution/hubspot-zapier-step-1-trigger.png?fit=max\&auto=format\&n=Uf5UjoLiG99SD05k\&q=85\&s=fe5e74f31d284076388bc5030f55b70b) > [!NOTE] > > The HubSpot trigger checks for matching deals every 15 minutes and only picks up deals moved into the stage in the **last 30 minutes**. Plan your stage transitions accordingly. Test the trigger and confirm Zapier returns a sample deal with the expected fields: `dealname`, `hs_object_id`, `ucc`, plus any contact/company info you want to forward. # Step 2: Filter deals without a `ucc` You only want to send events for deals that came from a referral. Add a **Filter by Zapier** step: 1. Choose **Filter by Zapier**. 2. Set the rule to: `1. Deal information: ucc` **Exists**. ![Zapier filter step: only continue if deal property ucc exists](https://mintcdn.com/cello/Uf5UjoLiG99SD05k/attribution/hubspot-zapier-step-2-filter.png?fit=max\&auto=format\&n=Uf5UjoLiG99SD05k\&q=85\&s=82d51cc373eb6acf251ad126440bfefe) Deals without a `ucc` will stop here and no Cello event will be sent. # Step 3: Create a Cello access token Cello uses short-lived access tokens for API auth. Add a **Code by Zapier** step using Python: 1. Choose **Code by Zapier** → **Run Python**. 2. Leave **Input Data** empty (credentials are hardcoded in this step). 3. Paste the snippet below and replace `` and `` with your Cello API credentials. ```python theme={null} import json import urllib.request ACCESS_KEY_ID = "" SECRET_ACCESS_KEY = "" body = { "accessKeyId": ACCESS_KEY_ID, "secretAccessKey": SECRET_ACCESS_KEY } req = urllib.request.Request( url="https://api.cello.so/token", data=json.dumps(body).encode("utf-8"), method="POST", headers={"Content-Type": "application/json"} ) try: with urllib.request.urlopen(req, timeout=10) as resp: data = json.loads(resp.read().decode("utf-8")) output = { "access_token": data.get("accessToken"), "expires_in": data.get("expiresIn"), "status": resp.status } except urllib.error.HTTPError as e: output = { "access_token": "", "status": e.code, "error": e.read().decode("utf-8") } ``` ![Code by Zapier step creating a Cello access token via POST /token](https://mintcdn.com/cello/Uf5UjoLiG99SD05k/attribution/hubspot-zapier-step-3-token.png?fit=max\&auto=format\&n=Uf5UjoLiG99SD05k\&q=85\&s=7069d8e9324974b19ba34f85a1a65380) Test the step - you should see an `access_token` value and `status: 200` in the output. > [!TIP] > > For production, store your `accessKeyId` and `secretAccessKey` in Zapier's **Storage by Zapier** or as **Code by Zapier environment variables** rather than hardcoding them. See [Zapier's guide on storing credentials](https://help.zapier.com/hc/en-us/articles/8496062115597-Using-Storage-by-Zapier-values-in-Code-Steps) for details. Reference: [Cello Authentication API](/api-reference/authentication/get-token). # Step 4: Send the signup event to Cello Add a second **Code by Zapier (Python)** step that posts the event to `POST /events`. 1. Choose **Code by Zapier** → **Run Python**. 2. Map the following **Input Data** fields from the previous steps: | Input Data key | Map from | | - | - | | `access_token` | Step 3 → `Access Token` | | `ucc` | Step 1 → `Deal information: ucc` | | `user_id` | Step 1 → `Deal information: Record ID` (or your own product user ID property) | | `email` | Step 1 → `Deal information: email_of_demo_request` (or contact email) | | `name` | Step 1 → `Deal information: Deal Name` (or contact name) | | `org_id` | Step 1 → company / organization ID (optional) | 3. Paste the snippet below: ```python theme={null} import json import urllib.request from datetime import datetime, timezone access_token = input_data.get("access_token", "") ucc = input_data.get("ucc", "") user_id = input_data.get("user_id", "") email = input_data.get("email", "") name = input_data.get("name", "") org_id = input_data.get("org_id", "") timestamp = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S") body = { "eventName": "ReferralUpdated", "payload": { "ucc": ucc, "newUserId": user_id }, "context": { "newUser": { "id": user_id, "email": email, "name": name, "organizationId": org_id }, "event": { "trigger": "demo-call-attended", "timestamp": timestamp } } } req = urllib.request.Request( url="https://api.cello.so/events", data=json.dumps(body).encode("utf-8"), method="POST", headers={ "Content-Type": "application/json", "Authorization": f"Bearer {access_token}" } ) try: with urllib.request.urlopen(req, timeout=10) as resp: response_body = resp.read().decode("utf-8") output = {"status": resp.status, "response": response_body} except urllib.error.HTTPError as e: output = {"status": e.code, "response": e.read().decode("utf-8")} ``` ![Code by Zapier step sending a demo-call-attended event to Cello with mapped HubSpot fields](https://mintcdn.com/cello/Uf5UjoLiG99SD05k/attribution/hubspot-zapier-step-4-event.png?fit=max\&auto=format\&n=Uf5UjoLiG99SD05k\&q=85\&s=8e0e64bb91b53093daecd2b0e2f27069) > [!NOTE] > > The `event.trigger` value (`demo-call-attended` in this example) determines how Cello classifies the event. Common values: > > * `new-signup` - user signed up but no demo yet > * `demo-call-attended` - user attended a sales/demo call > * `qualified-lead` - user has been qualified by sales > > Match the trigger to the HubSpot deal stage you're firing from. Test the step and confirm you receive `status: 200` from Cello. # Step 5: Verify and publish 1. **Publish your Zap.** 2. Move a test deal into the trigger stage in HubSpot. 3. Wait up to 15 minutes for Zapier to pick up the change. 4. Open [Developers → Events](https://app.cello.so/developers/events) in the Cello Portal and confirm the event was received with the correct `ucc`, `newUserId`, and `trigger`. 5. Check your [integration status](/mcp/developers/integration-status) - **Signups** should now show as **Connected**. > [!TIP] > > **You're done!** Every qualified deal in HubSpot will now generate a Cello signup event automatically. To also track purchase events, pair this with the [Stripe](/attribution/use-cases/stripe) or [Chargebee](/attribution/use-cases/chargebee) webhook integrations - or extend this Zap with an additional Code step that posts a `purchase` event when the deal closes won. # Variations * **Different trigger stages.** Duplicate the Zap and change the HubSpot deal stage + `event.trigger` value to track multiple milestones (e.g. one Zap for `demo-call-attended`, another for `qualified-lead`). * **Reward at the organization level.** Set `newUserId` to the HubSpot company ID instead of the deal/contact ID, and populate `newUser.organizationId` accordingly. See [Tracking Signups](/attribution/tracking-signups) for the organization-level attribution model. * **Use the Zapier HTTP action instead of Code steps.** If you prefer not to write Python, both API calls can be done with **Webhooks by Zapier → POST**. The body and headers are the same as in the snippets above. # Stripe Webhook Quickstart Source: https://docs.cello.so/attribution/use-cases/stripe Learn how to integrate Cello if you are using Stripe JS to create Stripe customer and Stripe Webhook to send Cello conversion events. > [!TIP] > > This guide is **optimized for the typical freemium scenario with Stripe**. > > Use this guide if you: > > * Create Stripe customer on signup > * Use Stripe webhook to send Cello referral conversion events # Step 1: Integrate the Referral Component First, integrate Cello Referral Component into your web app to provide referrers with full referral experience. Referral Component is integrated using one of our SDKs. For your web app, use Cello JS - our client-side SDK. You can install it by: 1. Adding a script tag to the `` of your application 2. Generating a JWT token for user authentication 3. Booting the component with the provided token and user details Follow this installation guide: > [card] [Referral Component Quickstart](https://docs.cello.so/referral-component/quickstart) You can also integrate Referral Component into your mobile applications: > [card] [iOS SDK](https://docs.cello.so/sdk/mobile/ios) > [card] [Android SDK](https://docs.cello.so/sdk/mobile/android) > [card] [React Native SDK](https://docs.cello.so/sdk/mobile/react-native) # Step 2: Capture referral codes on landing page Next, you will need to add [Cello attribution script](https://docs.cello.so/sdk/client-side/attribution-lib) to your referral landing page: 1. Setup a [landing page](https://docs.cello.so/docs/optimize-landing) for your referral links to redirect to 2. Install attribution script. Choose one of the following installation options best suited for your setup: > [card] [Embedded Script Tag](https://docs.cello.so/sdk/client-side/embedded-script-tag) > [card] [Google Tag Manager](https://docs.cello.so/sdk/client-side/google-tag-manager) 3. Verify the installation > [!TIP] > > To verify, follow these steps: > > 1. Add `?productId=test` and `?ucc=test` to your website URL > > ```html theme={null} > https://yourwebsite.com/?productId=test&ucc=test > ``` > 2. Make sure that these values are saved in the cookies as `cello-product-id` and `cello-referral` > 3. Navigate to your signup page and try to access the ucc using the `getUcc()` method from the browser console > > ```javascript theme={null} > window.CelloAttribution('getUcc') > ``` > > This method should return a promise with value `test` > > ```javascript theme={null} > Promise {: 'test'} > ``` > > **If this check passes, the script is installed correctly.** For capturing referral code in your mobile signup flow, follow this guide: > [card] [Mobile signup flow](https://docs.cello.so/attribution/for-mobile) # Step 3: Add Cello metadata on Stripe customer creation To track a signup, you can pass the following `metadata` to Stripe [Customer Object](https://docs.stripe.com/api/customers/object?api-version=2024-09-30.acacia#customer_object-metadata) on customer creation. * `cello_ucc` - ucc, a referral code identifying the referrer. You can retrieve this code using [attribution script](https://docs.cello.so/sdk/client-side/attribution-lib) `getUcc ()` method, you have installed as a prerequisite to this guide. * `new_user_id` - a unique user ID in your system, identifying the new user who just signed up. This should be the same ID (`productUserId`) you will use to boot the [Referral component](https://docs.cello.so/sdk/client-side/cello-js), when this user logs into your app * `new_user_organization_id` (optional) - add this, if your referrers can refer an organization rather then a single user and you want to reward based on that. Modify customer fields you send upon customer creation. Here is an example for a NodeJS App that does that: ```javascript theme={null} const stripe = require('stripe')('sk_test_51KiCYYCSMQAUBF...'); const customer = await stripe.customers.create({ description: 'New Stripe Customer', metadata: { cello_ucc: "hdz7afhs7", new_user_id: "xcsdad", // product user id of the new user new_user_organization_id: "123456" // organization id of the new user } }); ``` > [!TIP] > > Now that the customer is created in Stripe with Cello metadata, a `customer.created` event will be sent with [Stripe Webhook](https://docs.cello.so/integrations/webhooks/stripe-webhook), which we will count as a signup event in Cello. You will connect Stripe Webhook in the next step. # Step 4: Connect Stripe Webhook to send signup and purchase events To send Cello signup and purchase events, you will need to connect Stripe Webhook to Cello. Follow this guide to connect the webhook: > [card] [Stripe Webhook](https://docs.cello.so/integrations/webhooks/stripe-webhook) > > Send events using Stripe Webhook > [!TIP] > > **Congratulations!** You are done and now able to try out the full Cello referral experience 🎉 # Cello + Bolt integration Source: https://docs.cello.so/coding-apps/bolt-integration How to add user referrals to your app using Cello with Bolt. Bolt can implement Cello user referrals end-to-end if you give it the **right guidance** and force it to create a plan before coding. ![Group 2](https://mintcdn.com/cello/9I_GJwnpy9k9Akv3/images/Group-2-1.png?fit=max\&auto=format\&n=9I_GJwnpy9k9Akv3\&q=85\&s=229740cb5f916e24c8f9ff28d9aa791b) ## Prerequisites Before integrating Cello, ensure the following prerequisites are met: * Signup and authentication flow with a database to store user records is functional * Stripe or Chargebee subscription flow is functional * You have a Cello account and API keys at hand. > [!NOTE] > > You can integrate directly on production - your account stays in **pre-launch phase** until you launch, so all events are recorded as test data and nothing is paid out. A sandbox is optional if you prefer a separate environment. ## Connect the Cello MCP Connect the [Cello MCP server](/mcp/introduction) before you start. It gives Bolt direct access to Cello's documentation, your integration status, your incoming events, and best-practice recommendations, so Bolt can look up the right docs itself, verify your setup as it goes, and follow best practices automatically instead of relying only on the guide link you paste. Open **My account → MCP Server** in the [Cello Portal](https://app.cello.so/mcp), turn the server on, and use the one-click connect for your tool - or the generic option if it doesn't have its own card yet. There's no token to generate or paste. See [Connect your client](/mcp/connect) for more detail. > [accordion] Adding the server manually in Bolt > > * Go to [https://bolt.new/settings?page=mcp-servers](https://bolt.new/settings?page=mcp-servers) > * Add a Custom MCP server using the URL `https://mcp.cello.so/mcp` > * Select MCP OAuth > * Authenticate via the Cello Portal ## Cello user referrals integration (Coding-agent flow) **1. Add Cello Integration Guide Skill** * Go to [https://bolt.new/settings?page=skills-personal](https://bolt.new/settings?page=skills-personal) * Add the skill from Cello's GitHub ```text theme={null} https://github.com/getcello/cello-cursor-plugin/blob/main/skills/cello-get-integration-guide/SKILL.md ``` **2. Integrate Cello** * Use the skill to get a tailored integration guide for Cello * The Bolt Agent will ask you questions that cannot be answered automatically **3. Confirm executing the plan** Review the plan carefully. It should cover: * Cello JS SDK initialization and user authentication * Referral component placement and configuration * Attribution setup for tracking referred signups * Webhook integration for conversion tracking If it looks correct, tell Bolt to proceed and start implementing it. **4. Verify each component as you go** Don't wait until the end. As Bolt finishes each part, ask it to check that part before moving on: *"Use Cello to check my integration status - is the attribution library connected yet?"* The four things the plan covers are the same four the health check reports on, and the same four you'll test later in the [pre-launch testbook](/guides/integration/pre-launch-testbook#test-by-area): | What you just built | In the health report | Testbook section | | - | - | - | | SDK initialization and referral component placement | Referral component | [Referral component](/guides/integration/pre-launch-testbook#referral-component) | | Attribution setup | Attribution library | [Capturing the referral code](/guides/integration/pre-launch-testbook#capturing-the-referral-code) | | Signup tracking | Signups tracking | [Signup tracking](/guides/integration/pre-launch-testbook#signup-tracking) | | Purchase and conversion tracking | Purchases tracking | [Purchase tracking](/guides/integration/pre-launch-testbook#purchase-tracking) | Two things to expect, so a partial result doesn't look like a failure: * **All four components are reported every time.** The ones you haven't built yet read **Not connected**, which is correct at this stage. Only judge the one you just finished. * **Status lags behind your code.** A component turns **Connected** once a successful event reaches Cello within the health window, which can take up to \~10 minutes. Re-check before concluding anything is broken. If a component comes back with a warning, ask for the events behind it. The health check tells you *which* component is failing; the events tell you *why*: *"Show me my recent Cello events and tell me which fields are failing validation."* **5. Work through the pre-launch testbook** The [Pre-launch Testbook](/guides/integration/pre-launch-testbook) covers the manual, front-end checks no automated tool can see for you: whether the referral component sits well in your UI, whether the new-user banner reads correctly, and whether the discount math is right on both monthly and yearly plans. Bolt can fetch it and walk you through it, because the testbook is part of the documentation the Cello MCP server searches: *"Pull the Cello pre-launch testbook and walk me through the signup tracking section."* > [card] [Pre-launch Testbook](/guides/integration/pre-launch-testbook) **6. Publish & Test** Run your app and test the end-to-end flow. If everything was implemented correctly, you should see events coming in to the [Cello Dashboard](https://app.cello.so/performance/referrer-activity), marked as testing until you launch your program. Events reach **Developers → Events** within a few minutes, but dashboards refresh hourly - see [when each surface updates](/guides/integration/pre-launch-testbook#when-each-surface-updates) before assuming something is missing. ## After you're live If you have the Cello MCP connected, it continues to be useful after the initial integration: | Prompt | What happens | | - | - | | *"Is my Cello integration working?"* | Checks all four integration components and reports which are connected or broken | | *"Why aren't referral rewards being triggered?"* | Inspects recent events to find missing or malformed fields preventing attribution | | *"How can I improve my referral program?"* | Returns a prioritized list of recommendations across activation, sharing, and conversion | | *"Which recommendations need code changes?"* | Separates the optional enhancements that need dev work from the ones that are only portal configuration | | *"How do I set up a custom referral launcher?"* | Searches the docs for custom launcher implementation guides | > [!NOTE] > > For a step-by-step technical implementation (source of truth + acceptance criteria), follow the detailed guide: > > * [React + Node.js Integration Guide](/resources/react-nodejs-integration) > > The guide uses React + Node.js as an example, but it can be any other combination - the steps stay the same. # Cello + Claude integration Source: https://docs.cello.so/coding-apps/claude-integration How to add user referrals to your app using Cello with Claude Claude can implement Cello user referrals end-to-end if you give it the **right guide** and force it to create a plan before coding. Use **Claude Code** (the CLI coding agent) to build the integration, and connect the Cello MCP so Claude can look up docs and verify your setup as it goes. > [!NOTE] > > This page covers using **Claude Code** to build your referral integration. To connect the **Claude desktop or web app** so you can chat about your program, see the [Claude](/mcp/connect#claude) section of the MCP connect guide. ![Cello + Claude integration](https://mintcdn.com/cello/4C7XEZmkMsMYyA_d/coding-apps/claude_cello.png?fit=max\&auto=format\&n=4C7XEZmkMsMYyA_d\&q=85\&s=a86705dbc261d8a68f049fe13715253c) ## Prerequisites Before integrating Cello, ensure the following prerequisites are met: * User signup and authentication is functional * Stripe subscription flow is functional * You have a Cello account and API keys at hand. > [!NOTE] > > You can integrate directly on production - your account stays in **pre-launch phase** until you launch, so all events are recorded as test data and nothing is paid out. A sandbox is optional if you prefer a separate environment. ## Connect the Cello MCP Connect the [Cello MCP server](/mcp/introduction) before you start. It gives Claude direct access to Cello's documentation, your integration status, your incoming events, and best-practice recommendations, so Claude can look up the right docs itself, verify your setup as it goes, and follow best practices automatically instead of relying only on the guide link you paste. Open **My account → MCP Server** in the [Cello Portal](https://app.cello.so/mcp), turn the server on, and use the one-click connect for your tool - or the generic option if it doesn't have its own card yet. There's no token to generate or paste. See [Connect your client → Claude Code](/mcp/connect#claude-code) for more detail. ## Cello user referrals integration > [!NOTE] > > For a step-by-step technical implementation (source of truth + acceptance criteria), follow the detailed guide: > > * [React + Node.js Integration Guide](/resources/react-nodejs-integration) > > The guide uses React + Node.js as an example, but it can be any other combination - the steps stay the same. **1. Prep your project** * Signup and authentication flow is functional * Stripe subscription flow is functional * Cello API keys are handy **2. Add Cello Webhook Endpoint to Stripe** * Get your webhook URL from [Cello Portal](https://app.cello.so/developers/webhooks) * Add a Webhook endpoint in Stripe (Log into your Stripe Dashboard -> Go to Developer Mode -> Add a Webhook endpoint and enter endpoint URL -> Select the events to send -> Click "Add endpoint") * Secure the Webhook with "Signing secret" Events to send: * `charge.refunded`, `charge.succeeded`, `charge.updated` * `customer.created`, `customer.deleted`, `customer.updated` * `customer.subscription.created`, `customer.subscription.deleted`, `customer.subscription.updated` * `invoice.paid` See [Stripe Webhook Integration](/integrations/webhooks/stripe-webhook#steps) for more details. **3. Prompt Claude Code to add User Referrals to your app** Ask Claude Code to create a plan first - it stays in **plan mode** until you approve. Paste this prompt: ```text theme={null} I want to add user referrals to my app using Cello. Use the Cello MCP to search the integration documentation, check my current integration status, and create a thorough implementation plan. Follow all best-practice recommendations from Cello. ``` Claude pulls the relevant guides, checks what's already set up, and tailors the plan to your project, asking you guiding questions before it writes any code. > [accordion] If you haven't connected MCP > > Paste the guide URL instead. Claude gets the documentation, but no integration status and no event inspection, so you'll have to verify the integration yourself. > > ```text theme={null} > I now want to add user referrals. I chose platform Cello for this. > > I added a Cello integration guide according to which you should do the implementation. parsed the documentation more carefully from the start rather than assuming standard patterns would work. create a thorough implementation plan based on guidance, patterns and AC from the provided guide. Don't skip any content, it is all relevant > > Guide: https://docs.cello.so/resources/react-nodejs-integration > ``` **4. Confirm executing the plan** Review the plan carefully. It should cover: * Cello JS SDK initialization and user authentication * Referral component placement and configuration * Attribution setup for tracking referred signups * Stripe webhook integration for conversion tracking If it looks correct, tell Claude to proceed and start implementing it. **5. Verify each component as you go** Don't wait until the end. As Claude finishes each part, ask it to check that part before moving on: *"Use Cello to check my integration status - is the attribution library connected yet?"* The four things the plan covers are the same four the health check reports on, and the same four you'll test later in the [pre-launch testbook](/guides/integration/pre-launch-testbook#test-by-area): | What you just built | In the health report | Testbook section | | - | - | - | | SDK initialization and referral component placement | Referral component | [Referral component](/guides/integration/pre-launch-testbook#referral-component) | | Attribution setup | Attribution library | [Capturing the referral code](/guides/integration/pre-launch-testbook#capturing-the-referral-code) | | Signup tracking | Signups tracking | [Signup tracking](/guides/integration/pre-launch-testbook#signup-tracking) | | Purchase and conversion tracking | Purchases tracking | [Purchase tracking](/guides/integration/pre-launch-testbook#purchase-tracking) | Two things to expect, so a partial result doesn't look like a failure: * **All four components are reported every time.** The ones you haven't built yet read **Not connected**, which is correct at this stage. Only judge the one you just finished. * **Status lags behind your code.** A component turns **Connected** once a successful event reaches Cello within the health window, which can take up to \~10 minutes. Re-check before concluding anything is broken. If a component comes back with a warning, ask for the events behind it. The health check tells you *which* component is failing; the events tell you *why*: *"Show me my recent Cello events and tell me which fields are failing validation."* **6. Work through the pre-launch testbook** The [Pre-launch Testbook](/guides/integration/pre-launch-testbook) covers the manual, front-end checks no automated tool can see for you: whether the referral component sits well in your UI, whether the new-user banner reads correctly, and whether the discount math is right on both monthly and yearly plans. Claude can fetch it and walk you through it, because the testbook is part of the documentation the Cello MCP server searches: *"Pull the Cello pre-launch testbook and walk me through the signup tracking section."* > [card] [Pre-launch Testbook](/guides/integration/pre-launch-testbook) **7. Run & Test** Run your app and test the end-to-end flow. If everything was implemented correctly, you should see events coming in to the [Cello Dashboard](https://app.cello.so/performance/referrer-activity), marked as testing until you launch your program. Events reach **Developers → Events** within a few minutes, but dashboards refresh hourly - see [when each surface updates](/guides/integration/pre-launch-testbook#when-each-surface-updates) before assuming something is missing. ## After you're live If you have the Cello MCP connected, it continues to be useful after the initial integration: | Prompt | What happens | | - | - | | *"Is my Cello integration working?"* | Checks all four integration components and reports which are connected or broken | | *"Why aren't referral rewards being triggered?"* | Inspects recent events to find missing or malformed fields preventing attribution | | *"How can I improve my referral program?"* | Returns a prioritized list of recommendations across activation, sharing, and conversion | | *"Which recommendations need code changes?"* | Separates the optional enhancements that need dev work from the ones that are only portal configuration | | *"How do I set up a custom referral launcher?"* | Searches the docs for custom launcher implementation guides | # Cello + Codex integration Source: https://docs.cello.so/coding-apps/codex-integration How to add user referrals to your app using Cello with Codex Codex can implement Cello user referrals end-to-end if you give it the **right guidance** and force it to create a plan before coding. The Cello plugin for ChatGPT and Codex gives it both in one install. > [card] [Install the Cello plugin](https://chatgpt.com/plugins/cello) > > Cello MCP server plus the integration guide, health check, and program performance skills. ![Cello plugin for ChatGPT and Codex](https://mintcdn.com/cello/X9r1IKT5c5ilptad/coding-apps/codex_cello_plugin.png?fit=max\&auto=format\&n=X9r1IKT5c5ilptad\&q=85\&s=af5cae6200c14df0c5469f488fea92a4) ## Prerequisites Before integrating Cello, ensure the following prerequisites are met: * Signup and authentication flow with a database to store user records is functional. * Stripe or Chargebee subscription flow is functional. * You have a Cello account and API keys at hand. > [!NOTE] > > You can integrate directly on production - your account stays in **pre-launch phase** until you launch, so all events are recorded as test data and nothing is paid out. A sandbox is optional if you prefer a separate environment. ## Install the Cello plugin The [Cello plugin](https://chatgpt.com/plugins/cello) bundles the [Cello MCP server](/mcp/introduction) and three skills. The MCP server gives Codex direct access to Cello's documentation, your integration status, your incoming events, and best-practice recommendations. The skills tell Codex how to use them: | Skill | What it does | | - | - | | `cello-get-integration-guide` | Analyzes your app and builds a tailored integration plan | | `cello-integration-health-check` | Checks each integration component and explains what is failing | | `cello-get-program-performance` | Summarizes program health, trends, benchmarks, and top referrers | > [tab] ChatGPT desktop app > > 1. Open the [Cello plugin page](https://chatgpt.com/plugins/cello), or open **Plugins** in the ChatGPT desktop app and search for **Cello**. > 2. Select **Install plugin**. > 3. Sign in with your Cello account when prompted. There's no token to generate or paste. > 4. Start a new Codex chat. Type `@` and check that **Cello** and its skills are listed. > [tab] Codex CLI > > 1. Start Codex and open the plugin browser: > > ```text theme={null} > codex > /plugins > ``` > > 2. Find **Cello** and install it. > > 3. Sign in with your Cello account when prompted. There's no token to generate or paste. > > 4. Start a new Codex session so the plugin's skills and tools are loaded. In `/plugins`, Cello should show as installed and turned on. > [!NOTE] > > The Codex IDE extension doesn't support plugins. Install the plugin from the ChatGPT desktop app or Codex CLI, or use the manual setup below. > [accordion] Manual setup without the plugin > > Add the Cello MCP server from the terminal: > > ```bash theme={null} > codex mcp add cello-so --url https://mcp.cello.so/mcp > ``` > > Authenticate via the Cello Portal when prompted. You can also turn the server on under **My account → MCP Server** in the [Cello Portal](https://app.cello.so/mcp) and follow [Connect your client](/mcp/connect). > > Then download the integration guide skill into your repo's skills folder: > > ```bash theme={null} > mkdir -p .agents/skills/cello-get-integration-guide > curl -o .agents/skills/cello-get-integration-guide/SKILL.md \ > https://raw.githubusercontent.com/getcello/cello-cursor-plugin/main/skills/cello-get-integration-guide/SKILL.md > ``` > > Restart Codex so it picks up the new skill. You can also install it at the user level (`$HOME/.agents/skills`) so it's available across all your projects, or at the admin level (`/etc/codex/skills`) for your whole org. ## Cello user referrals integration (Coding-agent flow) **1. Create the integration plan** Ask Codex to plan the integration with the integration guide skill: *"Use cello-get-integration-guide to create a Cello integration plan for this app."* Codex analyzes your frontend, signup flow, and payment gateway, and asks you the questions it can't answer from the code. **2. Confirm executing the plan** Review the plan carefully. It should cover: * Cello JS SDK initialization and user authentication * Referral component placement and configuration * Attribution setup for tracking referred signups * Webhook integration for conversion tracking If it looks correct, tell Codex to proceed and start implementing it. **3. Verify each component as you go** Don't wait until the end. As Codex finishes each part, ask it to run the health check skill on that part before moving on: *"Use cello-integration-health-check to check my integration - is the attribution library connected yet?"* The four things the plan covers are the same four the health check reports on, and the same four you'll test later in the [pre-launch testbook](/guides/integration/pre-launch-testbook#test-by-area): | What you just built | In the health report | Testbook section | | - | - | - | | SDK initialization and referral component placement | Referral component | [Referral component](/guides/integration/pre-launch-testbook#referral-component) | | Attribution setup | Attribution library | [Capturing the referral code](/guides/integration/pre-launch-testbook#capturing-the-referral-code) | | Signup tracking | Signups tracking | [Signup tracking](/guides/integration/pre-launch-testbook#signup-tracking) | | Purchase and conversion tracking | Purchases tracking | [Purchase tracking](/guides/integration/pre-launch-testbook#purchase-tracking) | Two things to expect, so a partial result doesn't look like a failure: * **All four components are reported every time.** The ones you haven't built yet read **Not connected**, which is correct at this stage. Only judge the one you just finished. * **Status lags behind your code.** A component turns **Connected** once a successful event reaches Cello within the health window, which can take up to \~10 minutes. Re-check before concluding anything is broken. If a component comes back with a warning, ask for the events behind it. The health check tells you *which* component is failing; the events tell you *why*: *"Show me my recent Cello events and tell me which fields are failing validation."* **4. Work through the pre-launch testbook** The [Pre-launch Testbook](/guides/integration/pre-launch-testbook) covers the manual, front-end checks no automated tool can see for you: whether the referral component sits well in your UI, whether the new-user banner reads correctly, and whether the discount math is right on both monthly and yearly plans. Codex can fetch it and walk you through it, because the testbook is part of the documentation the plugin's MCP server searches: *"Pull the Cello pre-launch testbook and walk me through the signup tracking section."* > [card] [Pre-launch Testbook](/guides/integration/pre-launch-testbook) **5. Publish & Test** Run your app and test the end-to-end flow. If everything was implemented correctly, you should see events coming in to the [Cello Dashboard](https://app.cello.so/performance/referrer-activity), marked as testing until you launch your program. Events reach **Developers → Events** within a few minutes, but dashboards refresh hourly - see [when each surface updates](/guides/integration/pre-launch-testbook#when-each-surface-updates) before assuming something is missing. ## After you're live The Cello plugin continues to be useful after the initial integration: | Prompt | What happens | | - | - | | *"Is my Cello integration working?"* | Checks all four integration components and reports which are connected or broken | | *"Why aren't referral rewards being triggered?"* | Inspects recent events to find missing or malformed fields preventing attribution | | *"How is my referral program performing?"* | Runs `cello-get-program-performance`: health, trends, industry benchmarks, and top referrers in one readout | | *"How can I improve my referral program?"* | Returns a prioritized list of recommendations across activation, sharing, and conversion | | *"Which recommendations need code changes?"* | Separates the optional enhancements that need dev work from the ones that are only portal configuration | | *"How do I set up a custom referral launcher?"* | Searches the docs for custom launcher implementation guides | ### Use the plugin in ChatGPT The same plugin works in ChatGPT, so people who don't use Codex can ask about the program too. Install it once from the [plugin page](https://chatgpt.com/plugins/cello), then ask in any chat, for example *"Analyze my Cello referral program performance."* ChatGPT uses `cello-get-program-performance` to answer. > [!NOTE] > > For a step-by-step technical implementation (source of truth + acceptance criteria), follow the detailed guide: > > * [React + Node.js Integration Guide](/resources/react-nodejs-integration) > > The guide uses React + Node.js as an example, but it can be any other combination - the steps stay the same. # Cello + Cursor integration Source: https://docs.cello.so/coding-apps/cursor-integration How to add user referrals to your app using Cello with Cursor Cursor can implement Cello user referrals end-to-end if you give it the **right guide** and force it to create a plan before coding. ![Cello + Cursor integration](https://mintcdn.com/cello/4C7XEZmkMsMYyA_d/coding-apps/cursor_cello.png?fit=max\&auto=format\&n=4C7XEZmkMsMYyA_d\&q=85\&s=d057538599f479353ea5e4d4ad8c4dad) > [accordion] Watch the walkthrough > > [Cello + Cursor integration walkthrough](https://www.loom.com/embed/70f4b664bb6e44a69510b44110a55d5c?autoplay=0) ## Prerequisites Before integrating Cello, ensure the following prerequisites are met: * User signup and authentication is functional * Stripe subscription flow is functional * You have a Cello account and API keys at hand. > [!NOTE] > > You can integrate directly on production - your account stays in **pre-launch phase** until you launch, so all events are recorded as test data and nothing is paid out. A sandbox is optional if you prefer a separate environment. ## Connect the Cello MCP Connect the [Cello MCP server](/mcp/introduction) before you start. It gives Cursor direct access to Cello's documentation, your integration status, your incoming events, and best-practice recommendations, so Cursor can look up the right docs itself, verify your setup as it goes, and follow best practices automatically instead of relying only on the guide link you paste. Open **My account → MCP Server** in the [Cello Portal](https://app.cello.so/mcp), turn the server on, and use the one-click connect for your tool - or the generic option if it doesn't have its own card yet. There's no token to generate or paste. See [Connect your client → Cursor](/mcp/connect#cursor) for more detail. ## Cello user referrals integration > [!NOTE] > > For a step-by-step technical implementation (source of truth + acceptance criteria), follow the detailed guide: > > * [React + Node.js Integration Guide](/resources/react-nodejs-integration) > > The guide uses React + Node.js as an example, but it can be any other combination - the steps stay the same. **1. Prep your project** * Signup and authentication flow is functional * Stripe subscription flow is functional * Cello API keys are handy **2. Add Cello Webhook Endpoint to Stripe** * Get your webhook URL from [Cello Portal](https://app.cello.so/developers/webhooks) * Add a Webhook endpoint in Stripe (Log into your Stripe Dashboard -> Go to Developer Mode -> Add a Webhook endpoint and enter endpoint URL -> Select the events to send -> Click "Add endpoint") * Secure the Webhook with "Signing secret" Events to send: * `charge.refunded`, `charge.succeeded`, `charge.updated` * `customer.created`, `customer.deleted`, `customer.updated` * `customer.subscription.created`, `customer.subscription.deleted`, `customer.subscription.updated` * `invoice.paid` See [Stripe Webhook Integration](/integrations/webhooks/stripe-webhook#steps) for more details. **3. Prompt Cursor to add User Referrals to your app** Switch Cursor to **Plan mode**, then paste this prompt: ```text theme={null} I want to add user referrals to my app using Cello. Use the Cello MCP to search the integration documentation, check my current integration status, and create a thorough implementation plan. Follow all best-practice recommendations from Cello. ``` Cursor pulls the relevant guides, checks what's already set up, and tailors the plan to your project, asking you guiding questions before it writes any code. > [accordion] If you haven't connected MCP > > Paste the guide URL instead. Cursor gets the documentation, but no integration status and no event inspection, so you'll have to verify the integration yourself. > > ```text theme={null} > I now want to add user referrals. I chose platform Cello for this. > > I added a Cello integration guide according to which you should do the implementation. parsed the documentation more carefully from the start rather than assuming standard patterns would work. create a thorough implementation plan based on guidance, patterns and AC from the provided guide. Don't skip any content, it is all relevant > > Guide: https://docs.cello.so/resources/react-nodejs-integration > ``` **4. Confirm executing the plan** Review the plan carefully. It should cover: * Cello JS SDK initialization and user authentication * Referral component placement and configuration * Attribution setup for tracking referred signups * Stripe webhook integration for conversion tracking If it looks correct, tell Cursor to proceed and start implementing it. **5. Verify each component as you go** Don't wait until the end. As Cursor finishes each part, ask it to check that part before moving on: *"Use Cello to check my integration status - is the attribution library connected yet?"* The four things the plan covers are the same four the health check reports on, and the same four you'll test later in the [pre-launch testbook](/guides/integration/pre-launch-testbook#test-by-area): | What you just built | In the health report | Testbook section | | - | - | - | | SDK initialization and referral component placement | Referral component | [Referral component](/guides/integration/pre-launch-testbook#referral-component) | | Attribution setup | Attribution library | [Capturing the referral code](/guides/integration/pre-launch-testbook#capturing-the-referral-code) | | Signup tracking | Signups tracking | [Signup tracking](/guides/integration/pre-launch-testbook#signup-tracking) | | Purchase and conversion tracking | Purchases tracking | [Purchase tracking](/guides/integration/pre-launch-testbook#purchase-tracking) | Two things to expect, so a partial result doesn't look like a failure: * **All four components are reported every time.** The ones you haven't built yet read **Not connected**, which is correct at this stage. Only judge the one you just finished. * **Status lags behind your code.** A component turns **Connected** once a successful event reaches Cello within the health window, which can take up to \~10 minutes. Re-check before concluding anything is broken. If a component comes back with a warning, ask for the events behind it. The health check tells you *which* component is failing; the events tell you *why*: *"Show me my recent Cello events and tell me which fields are failing validation."* **6. Work through the pre-launch testbook** The [Pre-launch Testbook](/guides/integration/pre-launch-testbook) covers the manual, front-end checks no automated tool can see for you: whether the referral component sits well in your UI, whether the new-user banner reads correctly, and whether the discount math is right on both monthly and yearly plans. Cursor can fetch it and walk you through it, because the testbook is part of the documentation the Cello MCP server searches: *"Pull the Cello pre-launch testbook and walk me through the signup tracking section."* > [card] [Pre-launch Testbook](/guides/integration/pre-launch-testbook) **7. Run & Test** Run your app and test the end-to-end flow. If everything was implemented correctly, you should see events coming in to the [Cello Dashboard](https://app.cello.so/performance/referrer-activity), marked as testing until you launch your program. Events reach **Developers → Events** within a few minutes, but dashboards refresh hourly - see [when each surface updates](/guides/integration/pre-launch-testbook#when-each-surface-updates) before assuming something is missing. ## After you're live If you have the Cello MCP connected, it continues to be useful after the initial integration: | Prompt | What happens | | - | - | | *"Is my Cello integration working?"* | Checks all four integration components and reports which are connected or broken | | *"Why aren't referral rewards being triggered?"* | Inspects recent events to find missing or malformed fields preventing attribution | | *"How can I improve my referral program?"* | Returns a prioritized list of recommendations across activation, sharing, and conversion | | *"Which recommendations need code changes?"* | Separates the optional enhancements that need dev work from the ones that are only portal configuration | | *"How do I set up a custom referral launcher?"* | Searches the docs for custom launcher implementation guides | # Cello + Devin integration Source: https://docs.cello.so/coding-apps/devin-integration How to add user referrals to your app using Cello with Devin Devin can implement Cello user referrals end-to-end if you give it the **right guidance** and force it to create a plan before coding. ## Prerequisites Before integrating Cello, ensure the following prerequisites are met: * Signup and authentication flow with a database to store user records is functional * Stripe or Chargebee subscription flow is functional * You have a Cello account and API keys at hand. > [!NOTE] > > You can integrate directly on production - your account stays in **pre-launch phase** until you launch, so all events are recorded as test data and nothing is paid out. A sandbox is optional if you prefer a separate environment. ## Connect the Cello MCP Connect the [Cello MCP server](/mcp/introduction) before you start. It gives Devin direct access to Cello's documentation, your integration status, your incoming events, and best-practice recommendations, so Devin can look up the right docs itself, verify your setup as it goes, and follow best practices automatically instead of relying only on the guide link you paste. Open **My account → MCP Server** in the [Cello Portal](https://app.cello.so/mcp), turn the server on, and use the one-click connect for your tool - or the generic option if it doesn't have its own card yet. There's no token to generate or paste. See [Connect your client](/mcp/connect) for more detail. > [accordion] Installing the Cello MCP in Devin > > * Go to [https://app.devin.ai/customize?browse=true](https://app.devin.ai/customize?browse=true) > * Find Cello and install it > * Authenticate via the Cello Portal ## Cello user referrals integration (Coding-agent flow) **1. Add Cello Integration Guide Skill** * Go to [https://app.devin.ai/customize?tab=skills](https://app.devin.ai/customize?tab=skills) * Add the skill from Cello's GitHub ```text theme={null} https://github.com/getcello/cello-cursor-plugin/blob/main/skills/cello-get-integration-guide/SKILL.md ``` **2. Integrate Cello** * Use the skill to get a tailored integration guide for Cello * Devin will ask you questions that cannot be answered automatically **3. Confirm executing the plan** Review the plan carefully. It should cover: * Cello JS SDK initialization and user authentication * Referral component placement and configuration * Attribution setup for tracking referred signups * Webhook integration for conversion tracking If it looks correct, tell Devin to proceed and start implementing it. **4. Verify each component as you go** Don't wait until the end. As Devin finishes each part, ask it to check that part before moving on: *"Use Cello to check my integration status - is the attribution library connected yet?"* The four things the plan covers are the same four the health check reports on, and the same four you'll test later in the [pre-launch testbook](/guides/integration/pre-launch-testbook#test-by-area): | What you just built | In the health report | Testbook section | | - | - | - | | SDK initialization and referral component placement | Referral component | [Referral component](/guides/integration/pre-launch-testbook#referral-component) | | Attribution setup | Attribution library | [Capturing the referral code](/guides/integration/pre-launch-testbook#capturing-the-referral-code) | | Signup tracking | Signups tracking | [Signup tracking](/guides/integration/pre-launch-testbook#signup-tracking) | | Purchase and conversion tracking | Purchases tracking | [Purchase tracking](/guides/integration/pre-launch-testbook#purchase-tracking) | Two things to expect, so a partial result doesn't look like a failure: * **All four components are reported every time.** The ones you haven't built yet read **Not connected**, which is correct at this stage. Only judge the one you just finished. * **Status lags behind your code.** A component turns **Connected** once a successful event reaches Cello within the health window, which can take up to \~10 minutes. Re-check before concluding anything is broken. If a component comes back with a warning, ask for the events behind it. The health check tells you *which* component is failing; the events tell you *why*: *"Show me my recent Cello events and tell me which fields are failing validation."* **5. Work through the pre-launch testbook** The [Pre-launch Testbook](/guides/integration/pre-launch-testbook) covers the manual, front-end checks no automated tool can see for you: whether the referral component sits well in your UI, whether the new-user banner reads correctly, and whether the discount math is right on both monthly and yearly plans. Devin can fetch it and walk you through it, because the testbook is part of the documentation the Cello MCP server searches: *"Pull the Cello pre-launch testbook and walk me through the signup tracking section."* > [card] [Pre-launch Testbook](/guides/integration/pre-launch-testbook) **6. Publish & Test** Run your app and test the end-to-end flow. If everything was implemented correctly, you should see events coming in to the [Cello Dashboard](https://app.cello.so/performance/referrer-activity), marked as testing until you launch your program. Events reach **Developers → Events** within a few minutes, but dashboards refresh hourly - see [when each surface updates](/guides/integration/pre-launch-testbook#when-each-surface-updates) before assuming something is missing. ## After you're live If you have the Cello MCP connected, it continues to be useful after the initial integration: | Prompt | What happens | | - | - | | *"Is my Cello integration working?"* | Checks all four integration components and reports which are connected or broken | | *"Why aren't referral rewards being triggered?"* | Inspects recent events to find missing or malformed fields preventing attribution | | *"How can I improve my referral program?"* | Returns a prioritized list of recommendations across activation, sharing, and conversion | | *"Which recommendations need code changes?"* | Separates the optional enhancements that need dev work from the ones that are only portal configuration | | *"How do I set up a custom referral launcher?"* | Searches the docs for custom launcher implementation guides | > [!NOTE] > > For a step-by-step technical implementation (source of truth + acceptance criteria), follow the detailed guide: > > * [React + Node.js Integration Guide](/resources/react-nodejs-integration) > > The guide uses React + Node.js as an example, but it can be any other combination - the steps stay the same. # Cello + Lovable integration Source: https://docs.cello.so/coding-apps/lovable-integration How to add user referrals to your app using Cello with Lovable Lovable now lets you integrate Cello user referrals entirely through **chat**. Just ask Lovable to **"Add user referrals to your app"** and it will do the rest - no manual coding required. ![Cello + Lovable integration](https://mintcdn.com/cello/Xqm021Gy_uvBncuM/coding-apps/lovable-cello.png?fit=max\&auto=format\&n=Xqm021Gy_uvBncuM\&q=85\&s=dedb999be23e245c292b1304792ee8a9) > [accordion] Watch the walkthrough > > [Cello + Lovable integration walkthrough](https://www.loom.com/embed/3121fcb685884030bce0746b6350bd5d?autoplay=0) ## Prerequisites Before integrating Cello, ensure the following prerequisites are met: * The project **must** be connected to Supabase. [Learn more about Supabase](https://docs.lovable.dev/integrations/supabase) * User signup and authentication via Supabase is functional * Stripe subscription flow is functional * You have a Cello account and API keys at hand. > [!NOTE] > > You can integrate directly on production - your account stays in **pre-launch phase** until you launch, so all events are recorded as test data and nothing is paid out. A sandbox is optional if you prefer a separate environment. ## Connect the Cello MCP Connect the [Cello MCP server](/mcp/introduction) before you start. It gives Lovable direct access to Cello's documentation, your integration status, your incoming events, and best-practice recommendations, so Lovable can look up the right docs itself, verify your setup as it goes, and follow best practices automatically instead of relying only on the guide link you paste. Open **My account → MCP Server** in the [Cello Portal](https://app.cello.so/mcp), turn the server on, and use the one-click connect for your tool - or the generic option if it doesn't have its own card yet. There's no token to generate or paste. See [Connect your client → Lovable](/mcp/connect#lovable) for more detail. ## Cello user referrals integration > [!NOTE] > > For a step-by-step technical implementation (source of truth + acceptance criteria), follow the detailed guide: > > * [Cello + Lovable Detailed Integration Guide](/resources/cello-lovable-detailed-integration) > * [Cello + Lovable Detailed Integration (Credit-based Rewards)](/resources/cello-lovable-detailed-integration-credit-based-rewards) **1. Prep your project** * Signup and authentication flow with Supabase is functional * Stripe subscription flow is functional * Cello API keys are handy **2. Add Cello Webhook Endpoint to Stripe** * Get your webhook URL from [Cello Portal](https://app.cello.so/developers/webhooks) * Add a Webhook endpoint in Stripe (Log into your Stripe Dashboard -> Go to Developer Mode -> Add a Webhook endpoint and enter endpoint URL -> Select the events to send -> Click "Add endpoint") * Secure the Webhook with "Signing secret" Events to send: * `charge.refunded`, `charge.succeeded`, `charge.updated` * `customer.created`, `customer.deleted`, `customer.updated` * `customer.subscription.created`, `customer.subscription.deleted`, `customer.subscription.updated` * `invoice.paid` See [Stripe Webhook Integration](/integrations/webhooks/stripe-webhook#steps) for more details. **3. Prompt Lovable to add User Referrals to your app** Switch Lovable to **Plan mode**, then paste this prompt: ```text theme={null} I want to add user referrals to my app using Cello. Use the Cello MCP to search the integration documentation, check my current integration status, and create a thorough implementation plan. Follow all best-practice recommendations from Cello. ``` Lovable pulls the relevant guides, checks what's already set up, and tailors the plan to your project, asking you guiding questions before it writes any code. > [accordion] If you haven't connected MCP > > Paste the guide URL instead. Lovable gets the documentation, but no integration status and no event inspection, so you'll have to verify the integration yourself. > > ```text theme={null} > I now want to add user referrals. I chose platform Cello for this. > > I added a Cello integration guide according to which you should do the implementation. parsed the documentation more carefully from the start rather than assuming standard patterns would work. create a thorough implementation plan based on guidance, patterns and AC from the provided guide. Don't skip any content, it is all relevant > > Guide: https://docs.cello.so/resources/cello-lovable-detailed-integration > ``` **4. Confirm executing the plan** Review the plan carefully. It should cover: * Cello JS SDK initialization and user authentication * Referral component placement and configuration * Attribution setup for tracking referred signups * Stripe webhook integration for conversion tracking If it looks correct, tell Lovable to proceed and start implementing it. **5. Verify each component as you go** Don't wait until the end. As Lovable finishes each part, ask it to check that part before moving on: *"Use Cello to check my integration status - is the attribution library connected yet?"* The four things the plan covers are the same four the health check reports on, and the same four you'll test later in the [pre-launch testbook](/guides/integration/pre-launch-testbook#test-by-area): | What you just built | In the health report | Testbook section | | - | - | - | | SDK initialization and referral component placement | Referral component | [Referral component](/guides/integration/pre-launch-testbook#referral-component) | | Attribution setup | Attribution library | [Capturing the referral code](/guides/integration/pre-launch-testbook#capturing-the-referral-code) | | Signup tracking | Signups tracking | [Signup tracking](/guides/integration/pre-launch-testbook#signup-tracking) | | Purchase and conversion tracking | Purchases tracking | [Purchase tracking](/guides/integration/pre-launch-testbook#purchase-tracking) | Two things to expect, so a partial result doesn't look like a failure: * **All four components are reported every time.** The ones you haven't built yet read **Not connected**, which is correct at this stage. Only judge the one you just finished. * **Status lags behind your code.** A component turns **Connected** once a successful event reaches Cello within the health window, which can take up to \~10 minutes. Re-check before concluding anything is broken. If a component comes back with a warning, ask for the events behind it. The health check tells you *which* component is failing; the events tell you *why*: *"Show me my recent Cello events and tell me which fields are failing validation."* > [!NOTE] > > Publish before you check. Events don't reach Cello from Preview mode, so a component checked against an unpublished change will read **Not connected**. **6. Work through the pre-launch testbook** The [Pre-launch Testbook](/guides/integration/pre-launch-testbook) covers the manual, front-end checks no automated tool can see for you: whether the referral component sits well in your UI, whether the new-user banner reads correctly, and whether the discount math is right on both monthly and yearly plans. Lovable can fetch it and walk you through it, because the testbook is part of the documentation the Cello MCP server searches: *"Pull the Cello pre-launch testbook and walk me through the signup tracking section."* > [card] [Pre-launch Testbook](/guides/integration/pre-launch-testbook) **7. Publish & Test** You cannot try the full end-to-end flow in Preview mode. Publish your changes to test. If everything was implemented correctly, you should see events coming in to the [Cello Dashboard](https://app.cello.so/performance/referrer-activity), marked as testing until you launch your program. Events reach **Developers → Events** within a few minutes, but dashboards refresh hourly - see [when each surface updates](/guides/integration/pre-launch-testbook#when-each-surface-updates) before assuming something is missing. ## After you're live If you have the Cello MCP connected, it continues to be useful after the initial integration: | Prompt | What happens | | - | - | | *"Is my Cello integration working?"* | Checks all four integration components and reports which are connected or broken | | *"Why aren't referral rewards being triggered?"* | Inspects recent events to find missing or malformed fields preventing attribution | | *"How can I improve my referral program?"* | Returns a prioritized list of recommendations across activation, sharing, and conversion | | *"Which recommendations need code changes?"* | Separates the optional enhancements that need dev work from the ones that are only portal configuration | | *"How do I set up a custom referral launcher?"* | Searches the docs for custom launcher implementation guides | # Cello + Replit integration Source: https://docs.cello.so/coding-apps/replit-integration How to add user referrals to your app using Cello with Replit Replit Agent can implement Cello user referrals end-to-end if you give it the **right guide** and force it to create a plan before coding. ![Cello + Replit integration](https://mintcdn.com/cello/BQTZMO-jgvpA9pM3/coding-apps/replit_cello.png?fit=max\&auto=format\&n=BQTZMO-jgvpA9pM3\&q=85\&s=afac8c690b472ed300980e533b79ae5a) ## Prerequisites Before integrating Cello, ensure the following prerequisites are met: * Signup and authentication flow with a database to store user records is functional * Stripe subscription flow is functional * You have a Cello account and API keys at hand. > [!NOTE] > > You can integrate directly on production - your account stays in **pre-launch phase** until you launch, so all events are recorded as test data and nothing is paid out. A sandbox is optional if you prefer a separate environment. ## Connect the Cello MCP Connect the [Cello MCP server](/mcp/introduction) before you start. It gives Replit direct access to Cello's documentation, your integration status, your incoming events, and best-practice recommendations, so Replit can look up the right docs itself, verify your setup as it goes, and follow best practices automatically instead of relying only on the guide link you paste. Open **My account → MCP Server** in the [Cello Portal](https://app.cello.so/mcp), turn the server on, and use the one-click connect for your tool - or the generic option if it doesn't have its own card yet. There's no token to generate or paste. See [Connect your client](/mcp/connect) for more detail. ## Cello user referrals integration (Coding-agent flow) > [!NOTE] > > For a step-by-step technical implementation (source of truth + acceptance criteria), follow the detailed guide: > > * [React + Node.js Integration Guide](/resources/react-nodejs-integration) > > The guide uses React + Node.js as an example, but it can be any other combination - the steps stay the same. **1. Prep your project** * Signup and authentication flow with a database to store user records is functional * Stripe subscription flow is functional * Cello API keys are handy **2. Add Cello Webhook Endpoint to Stripe** * Get your webhook URL from [Cello Portal](https://app.cello.so/developers/webhooks) * Add a Webhook endpoint in Stripe (Log into your Stripe Dashboard -> Go to Developer Mode -> Add a Webhook endpoint and enter endpoint URL -> Select the events to send -> Click "Add endpoint") * Secure the Webhook with "Signing secret" Events to send: * `charge.refunded`, `charge.succeeded`, `charge.updated` * `customer.created`, `customer.deleted`, `customer.updated` * `customer.subscription.created`, `customer.subscription.deleted`, `customer.subscription.updated` * `invoice.paid` See [Stripe Webhook Integration](/integrations/webhooks/stripe-webhook#steps) for more details. **3. Prompt Replit Agent to add User Referrals to your app** Paste this prompt into Replit Agent: ```text theme={null} I want to add user referrals to my app using Cello. Use the Cello MCP to search the integration documentation, check my current integration status, and create a thorough implementation plan. Follow all best-practice recommendations from Cello. ``` Replit Agent pulls the relevant guides, checks what's already set up, and tailors the plan to your project, asking you guiding questions before it writes any code. > [accordion] If you haven't connected MCP > > Paste the guide URL instead. Replit Agent gets the documentation, but no integration status and no event inspection, so you'll have to verify the integration yourself. > > ```text theme={null} > I now want to add user referrals. I chose platform Cello for this. > > I added a Cello integration guide according to which you should do the implementation. parsed the documentation more carefully from the start rather than assuming standard patterns would work. create a thorough implementation plan based on guidance, patterns and AC from the provided guide. Don't skip any content, it is all relevant > > Guide: https://docs.cello.so/resources/react-nodejs-integration > ``` **4. Confirm executing the plan** Review the plan carefully. It should cover: * Cello JS SDK initialization and user authentication * Referral component placement and configuration * Attribution setup for tracking referred signups * Stripe webhook integration for conversion tracking If it looks correct, tell Replit Agent to proceed and start implementing it. **5. Verify each component as you go** Don't wait until the end. As Replit Agent finishes each part, ask it to check that part before moving on: *"Use Cello to check my integration status - is the attribution library connected yet?"* The four things the plan covers are the same four the health check reports on, and the same four you'll test later in the [pre-launch testbook](/guides/integration/pre-launch-testbook#test-by-area): | What you just built | In the health report | Testbook section | | - | - | - | | SDK initialization and referral component placement | Referral component | [Referral component](/guides/integration/pre-launch-testbook#referral-component) | | Attribution setup | Attribution library | [Capturing the referral code](/guides/integration/pre-launch-testbook#capturing-the-referral-code) | | Signup tracking | Signups tracking | [Signup tracking](/guides/integration/pre-launch-testbook#signup-tracking) | | Purchase and conversion tracking | Purchases tracking | [Purchase tracking](/guides/integration/pre-launch-testbook#purchase-tracking) | Two things to expect, so a partial result doesn't look like a failure: * **All four components are reported every time.** The ones you haven't built yet read **Not connected**, which is correct at this stage. Only judge the one you just finished. * **Status lags behind your code.** A component turns **Connected** once a successful event reaches Cello within the health window, which can take up to \~10 minutes. Re-check before concluding anything is broken. If a component comes back with a warning, ask for the events behind it. The health check tells you *which* component is failing; the events tell you *why*: *"Show me my recent Cello events and tell me which fields are failing validation."* **6. Work through the pre-launch testbook** The [Pre-launch Testbook](/guides/integration/pre-launch-testbook) covers the manual, front-end checks no automated tool can see for you: whether the referral component sits well in your UI, whether the new-user banner reads correctly, and whether the discount math is right on both monthly and yearly plans. Replit Agent can fetch it and walk you through it, because the testbook is part of the documentation the Cello MCP server searches: *"Pull the Cello pre-launch testbook and walk me through the signup tracking section."* > [card] [Pre-launch Testbook](/guides/integration/pre-launch-testbook) **7. Publish & Test** Run your app and test the end-to-end flow. If everything was implemented correctly, you should see events coming in to the [Cello Dashboard](https://app.cello.so/performance/referrer-activity), marked as testing until you launch your program. Events reach **Developers → Events** within a few minutes, but dashboards refresh hourly - see [when each surface updates](/guides/integration/pre-launch-testbook#when-each-surface-updates) before assuming something is missing. ## After you're live If you have the Cello MCP connected, it continues to be useful after the initial integration: | Prompt | What happens | | - | - | | *"Is my Cello integration working?"* | Checks all four integration components and reports which are connected or broken | | *"Why aren't referral rewards being triggered?"* | Inspects recent events to find missing or malformed fields preventing attribution | | *"How can I improve my referral program?"* | Returns a prioritized list of recommendations across activation, sharing, and conversion | | *"Which recommendations need code changes?"* | Separates the optional enhancements that need dev work from the ones that are only portal configuration | | *"How do I set up a custom referral launcher?"* | Searches the docs for custom launcher implementation guides | # AI Assistant Source: https://docs.cello.so/guides/ai-assistant/overview Get answers about your referral program performance and take action faster - directly in the Cello portal The Cello AI Assistant helps you understand program performance and take action faster - directly inside the Cello portal. It answers questions using your Cello data, metrics, benchmarks, and documentation. > [!NOTE] > > This feature is available to growth managers in the Cello portal. Your feedback helps us improve - see [Providing feedback](#providing-feedback) below. > [!NOTE] > > Prefer to work from your own AI client like Claude? The same data is available through the [Cello MCP server](/mcp/growth/use-cases). ## Using the assistant The assistant is available in the Cello portal. To get started: 1. Open the assistant from the portal navigation 2. Type your question or select an example from the [AI Prompt Library](/guides/ai-assistant/prompt-library) 3. Review the response - the assistant will link to relevant charts, reports, or settings when applicable ![AI Assistant](https://mintcdn.com/cello/mPEX9OjLkcglNgF5/guides/ai-assistant/ai-assistant.png?fit=max\&auto=format\&n=mPEX9OjLkcglNgF5\&q=85\&s=290e45b6581022d5153a9f91f17e43b1) The assistant works best with specific questions about your program. See the [AI Prompt Library](/guides/ai-assistant/prompt-library) for examples organized by category. ## How responses are generated Responses are grounded in your portal context, Cello metrics, benchmarks (when available), and Cello documentation. The assistant links to relevant charts, reports, or settings so you can verify data and take action quickly. ## When the assistant can't help If the assistant can't answer a question confidently, it will let you know and help you reach Support so your request is handled quickly. ## Providing feedback Your feedback helps us improve quality and coverage: * **Rate responses** using thumbs up/down to help us understand what's working * **Share details** when something is off - what you asked, what you expected, and a screenshot if possible We use feedback to improve prompts, add missing documentation, expand the AI Prompt Library, and refine the assistant's capabilities. ## Privacy and data The AI Assistant runs in Cello's EU-hosted AWS environment. Customer content is not used to train foundation models. The assistant only uses the minimum context needed to answer using approved Cello sources. # AI Prompt Library Source: https://docs.cello.so/guides/ai-assistant/prompt-library Example questions to ask the Cello AI Assistant The AI Assistant handles a wide range of questions about your referral program. Here are examples organized by category - you'll also find these in the Prompt Library inside the assistant. ## Performance and analytics Understand how your referral program is performing and how it compares to similar programs. * "How do my metrics compare to benchmarks?" * "What's my conversion rate from views to signups?" * "How does my activation rate compare to benchmark?" ## Optimization Get recommendations on where to focus your efforts to improve program performance. The assistant can help you prioritize actions from your [Performance Recommendations](/guides/attribution/recommendations) score. * "What are the most impactful improvements I should prioritize?" * "Which improvements require the least dev effort?" * "How can I improve my sharing rate?" * "How can I improve my active rate?" ## Referrers Identify your top-performing referrers and understand where users are dropping off. * "Which referrers drive the most signups?" * "Which referrers drive the most revenue?" * "What's causing my biggest drop-offs?" ## Conversion Find ways to improve conversion rates at each stage of the referral funnel. * "How can I increase new user signups to meet benchmarks?" * "How can I improve purchase conversion vs. benchmark?" ## Fraud and review Get help reviewing flagged referrals and potential fraud cases. * "Can you help me review open fraud cases?" ## Notifications Configure notification settings and get recommendations for engaging referrers. * "How can I configure my notification settings?" * "Which notification updates are recommended?" # Performance Benchmarks Source: https://docs.cello.so/guides/attribution/benchmarks Understand how your program performance compares to similar companies Cello provides industry benchmarks to help you understand how your referral program stacks up against similar companies. Benchmarks appear as horizontal reference lines on your dashboard charts, making it easy to identify where your program excels and where there's room for improvement. Cello uses these benchmarks along with deep analysis of your program data to generate specific, actionable [Performance Recommendations](/guides/attribution/recommendations) tailored to your situation. Visit the [Recommendations page](https://app.cello.so/recommendations) in the Cello Portal to see exactly what to focus on next. ## Benchmarked Metrics Cello provides benchmarks for four key metrics across the referral funnel. Benchmarks are hidden by default. Toggle them on from any supported chart to see how you compare. ![Benchmark lines on a Cello dashboard chart](https://mintcdn.com/cello/n_tEUaaKgm2qj5G0/guides/attribution/benchmarks.png?fit=max\&auto=format\&n=n_tEUaaKgm2qj5G0\&q=85\&s=98c3807b5ef8d6cabcf2e4af8b02078e) * **Active Rate**: Percentage of enabled users who open the referral widget. Calculated as `Active Referrers / Enabled Referrers`. * **Sharing Rate**: Percentage of active users who share their referral link. Calculated as `Sharing Referrers / Active Referrers`. * **Signup Rate**: Percentage of unique referral link views that convert to signups. Calculated as `New User Signups / Unique Views`. * **Unique Views per Share**: Average number of unique people who view each shared referral link. Calculated as `Unique Views / Sharing Referrers`. > [!NOTE] > > Sharing rate benchmarks are adjusted based on your active rate. Cello automatically determines which benchmark band applies to you, so you're always comparing against relevant peers. ## Methodology Benchmarks are calculated from anonymized, aggregated monthly performance rates across all Cello customers. Your performance is compared using your latest 30-day rolling rates. Charts show two benchmark lines: * **Median (Average)**: The 50th percentile, half of customers perform better, half perform worse * **Best in Class**: The 75th percentile, top 25% of customers achieve this or better Benchmarks are segmented by Go-to-Market model so you're compared against similar businesses: * **Free Trial**: Customers offering free trials before purchase * **Freemium**: Customers with free tiers and paid upgrades * **Demo Only**: Customers requiring demos before purchase * **Overall**: All customers combined (used when your GTM model doesn't match the above) Cello automatically detects your GTM model and shows the appropriate benchmarks. ## Interpreting Your Results Visit [Performance Recommendations](/guides/attribution/recommendations) to understand your score, or go directly to the [Recommendations page](https://app.cello.so/recommendations) in the Cello Portal to see your specific next steps. **Above Best in Class**\ Your program is in the top 25% for this metric. This is a strength worth maintaining - consider what's driving this success and whether those practices can be applied elsewhere. **Between Median and Best in Class**\ You're performing above average but have room to reach best-in-class status. Review the relevant best practices guides to identify optimization opportunities. **Below Median**\ There's a clear opportunity for improvement. See recommendations in the [Cello Portal](https://app.cello.so/recommendations) or explore these best practices: * **Low active rate?** See [Increase Discoverability](/guides/best-practices/Increase-discoverability-of-your-referral-program) to get more users opening the widget * **Low sharing rate?** Review [Contextual Sharing](/guides/best-practices/contextual-sharing) to prompt referrals at high-intent moments * **Low signup rate?** Check [Optimizing Signup Conversion](/guides/best-practices/optimizing-signup-conversion) for landing page and flow improvements You can query benchmark data from your own AI client using [`cello_get_program_metrics`](/mcp/tools#cello_get_program_metrics) via the [Cello MCP](/mcp/growth/use-cases). # Manual Attribution Source: https://docs.cello.so/guides/attribution/manual-attribution At Cello, we understand that there may be instances where automated referral attribution doesn't work as expected At Cello, we understand that there may be instances where automated referral attribution doesn't work as expected. In such cases, our platform provides the flexibility to manually attribute referrals to ensure that your users receive the proper rewards for their efforts. This guide will walk you through the steps of manually attributing referrals within the Cello platform. ## When to Manually Attribute Referrals 1. **Technical Glitches**: If you encounter technical issues or glitches that prevent automated attribution, manual attribution allows you to override these challenges. 2. **User Disputes**: In cases where users claim they referred someone but the system did not capture it correctly, manual attribution provides a resolution path. 3. **Custom Scenarios**: For unique situations or custom referral setups, manual attribution offers a tailored solution. > [!WARNING] > > Cello will only import transaction events linked to a manually attributed referral that is less than 30 days old. If a purchase is older, please reach out to the Cello support team. ## How to Manually Attribute Referrals > [tab] Stripe webhook only > > 1. Customer gets `cello_ucc` of referrer from the Cello Portal and retrieves `cello_ucc` of referrer and `new_user_id` (former product_user_id) new user from their own system. If data cannot be found, please reach out to Cello. > 2. Customer adds `cello_ucc` of referrer and `new_user_id` (former product_user_id) ID of new user to the existing Stripe customer of new user in Stripe. > 3. Cello receives a `customer.updated` event from Stripe for the customer. > 4. If there were already paid invoices, please resend the past `invoice.paid` events of the new user to Cello. This can be done by: > 1. Go to the transaction > 2. Select the `invoice.paid` event in the feed at the bottom > 3. Click **View event details** > 4. Check webhook attempts and resend the event > > ![Step 4a,b: Open invoice.paid event](https://uploads.developerhub.io/prod/d316/mbks67245wq3wx26x8ckl8w9ry2bbs13294rcb0g2a0desuw8ubdund6xp7qgnmb.png) > > ![Step 4c: View event details](https://uploads.developerhub.io/prod/d316/l4n9q5sbpqnftik5vgtww5ga6e6s6ehtnizfaqgkg3o8mgn6dyoid79rks9gbpgj.png) > > ![Step 4d: Resend past invoice.paid events](https://uploads.developerhub.io/prod/d316/tzlsgmwylhtcojadrybjcnbeap9vx7l3ehdvow8nwnvcygyxgj8j7rc5tguk46al.png) > [tab] Chargebee webhook only > > 1. Customer gets `cello_ucc` of referrer from the Cello Portal and retrieves `cello_ucc` of referrer and `new_user_id` (former product_user_id) ID of new user from their own system. If data cannot be found, please reach out to Cello. > 2. In Chargebee, you add `cello_ucc` of referrer and `new_user_id` (former product_user_id) of new user to the metadata of the new user's Chargebee customer. > 3. We automatically receive a `customer_changed` event via the webhook. > 4. If there were already payments from the new user, you need to resend the past `payment_succeeded` events via the webhook. You can trigger this inside Chargebee manually. > [tab] Cello API & Webhook > > 1. Customer gets `cello_ucc` of referrer from the Cello Portal and retrieves `new_user_id` ID of new user from their own system. If data cannot be found, please reach out to Cello. > > 2. Customer resends the signup event manually via the Cello API. Fields are filled as in the automated Cello API events. The detailed documentation can be found in the [Example Requests](/api-reference/generic-events/send-event). > > 3. To add the parameters to the metadata in your payment gateway and resend past transactions, follow step 2-4 from the tab applicable for your payment gateway. > > > [!NOTE] > > > > In case Cello API events can not be resend via API, manual reports can be provided to Cello. The reports need to contain equivalent information as the specific event. The report templates will be provided by Cello Support team. > [tab] Cello API only > > 1. Customer gets `cello_ucc` of referrer from the Cello Portal and retrieves `new_user_id` ID of new user from their own system. If data cannot be found, please reach out to Cello. > > 2. Customer resends the signup event manually via the Cello API. Fields are filled as in the automated Cello API events. The detailed documentation can be found in the [Example Requests](/api-reference/generic-events/send-event). > > 3. Customer resends past transaction events manually via the Cello API. Fields are filled as in the automated Cello API events. The detailed documentation can be found in the [Example Requests](/api-reference/generic-events/send-event). > > > [!NOTE] > > > > In case Cello API events can not be resend via API, manual reports can be provided to Cello. The reports need to contain equivalent information as the specific event. The report templates will be provided by Cello Support team. ## Contact Support If you encounter challenges or have questions during the manual attribution process, our support team is here to assist you. Reach out to us via [support@cello.so](mailto:support@cello.so) with detailed information about the referral in question, and we'll promptly assist you in resolving the matter. # Program Performance and ARR Source: https://docs.cello.so/guides/attribution/program-performance Understand how Cello calculates Annual Recurring Revenue to measure your referral program's performance Cello tracks **Net New Annual Recurring Revenue (ARR)** - the annualized value of recurring revenue from referred customers. ARR is calculated from **invoice paid events** rather than looking at subscription objects in Stripe or Chargebee. This approach reflects actual revenue collected and works consistently across different billing systems. ## Why invoice-based? Using invoice paid events means you see real revenue collected, not theoretical subscription values. It also handles complex scenarios like prorations, upgrades, and plan changes automatically - without requiring special configuration. ## Annualizing different billing intervals Customers pay on different schedules, so Cello normalizes everything to an annual basis. This lets you compare the true value of different customers regardless of how they chose to pay. Here are examples of how subscription intervals are annualized: * A \$50 **monthly** subscription becomes \$600 ARR * A \$150 **quarterly** subscription becomes \$600 ARR * A \$600 **yearly** subscription stays at \$600 ARR * A \$1,200 two-year **biannual** contract becomes \$600 ARR ## Rolling forward recurring revenue When a customer pays for a yearly subscription in January, that revenue represents value for the entire year. Cello "rolls forward" non-monthly subscriptions so your monthly ARR charts reflect ongoing revenue, not just the months when invoices happen to be paid. This also means churn is detected automatically - if a renewal invoice doesn't arrive when expected, the ARR stops being rolled forward and drops off your charts. ### What this means for your dashboard The ARR shown in Cello represents actual paid revenue from referred customers, annualized. When comparing to your billing system's total ARR, remember that Cello shows only **attributed ARR** - revenue from customers who came through your referral program. ## Handling real-world billing scenarios Cello automatically adjusts for common situations: * **Late invoicing** – If an invoice comes in a few days late (within 7 days), it's attributed to the expected month to prevent artificial dips or jumps in your charts * **Early renewals** – Overlapping subscription periods are detected to avoid double-counting * **Prorations** – When customers upgrade mid-cycle, proration credits are factored in to show the true subscription value > [!NOTE] > > The Proration feature gradually being rolled out gradually across customers where applicable. ## ARR movement breakdown Cello breaks down ARR changes into components so you can understand what's driving growth: * **New ARR** – Revenue from newly referred customers * **Expansion ARR** – Increases from existing customers upgrading or adding seats * **Contraction ARR** – Decreases from downgrades * **Churned ARR** – Lost revenue when customers cancel or don't renew You can choose to enable or disable the ARR movement from the **New User ARR** chart menu. ![Image](https://mintcdn.com/cello/Nqx6h_TC2To4BPZj/images/image-2.png?fit=max\&auto=format\&n=Nqx6h_TC2To4BPZj\&q=85\&s=dbbd92c0d331ebf43effb7a8bc81bed2) You can query program performance data from your own AI client using [`cello_get_program_metrics`](/mcp/tools#cello_get_program_metrics) via the [Cello MCP](/mcp/growth/use-cases). # Performance Recommendations Source: https://docs.cello.so/guides/attribution/recommendations Prioritized actions to improve your referral program performance The Recommendations page in the Cello portal shows you a prioritized list of actions to improve your referral program. Each recommendation includes a point value indicating its potential impact on your overall score. ## How it works Your **score** reflects how well your referral program is configured for success, rated Poor, Okay or Good. It is based on proven best practices across activation, sharing, and conversion. You can see your score on **Home**. Click the **Recommendations** card to open the full list. ![Recommendations card on Home with the recommendation score and how many actions are completed](https://mintcdn.com/cello/qtx4Sz4eACfrTKXR/guides/attribution/recommendation-score.png?fit=max\&auto=format\&n=qtx4Sz4eACfrTKXR\&q=85\&s=577055621f536619992694d184f22bd1) Each recommendation shows: * **Point value** - the impact on your score when completed * **Category** - which area of your program it affects * **Action** - what you need to do, with **Learn more** links to settings or documentation, and **Mark as complete** ![Recommendations page with the score and recommendations grouped into Activation, Sharing and Conversion](https://mintcdn.com/cello/qtx4Sz4eACfrTKXR/guides/attribution/recommendations-page.png?fit=max\&auto=format\&n=qtx4Sz4eACfrTKXR\&q=85\&s=bc6171f3fb175a7f39c868b6924cef5f) As you complete recommendations, your score increases and you'll see new recommendations unlock. ## Recommendation areas ### Activation Actions that help users discover your referral program and understand its value. This includes launcher visibility, announcements, and activation campaigns. ### Sharing Actions that encourage users to share more often and more effectively. This includes contextual prompts, reward messaging, and launcher configuration. ### Conversion Actions that improve signup and purchase rates for referred users. This includes dual-sided rewards and personalization. To see how your current metrics compare to industry benchmarks, see [Performance Benchmarks](/guides/attribution/benchmarks). ## Using recommendations with AI You can ask the [AI Assistant](/guides/ai-assistant/overview) built into the portal to help you prioritize recommendations: * "What are the most impactful improvements I should prioritize?" * "Which improvements require the least dev effort?" The assistant will reference your current recommendations and help you decide where to focus. Prefer working from your own AI client? The same data is available via the [Cello MCP](/mcp/growth/use-cases) using the `cello_get_recommendations` tool. # Increase Discoverability Of Your Referral Program Source: https://docs.cello.so/guides/best-practices/Increase-discoverability-of-your-referral-program Learn how to drive organic activation of your referral program with high discoverability To drive organic activation for your referral program, high discoverability is key. 1. **1st-level visibility** - Creating basic awareness for your referral program with a launcher that is always visible is an absolute must-have to see success. 2. **Multiple referral launchers** - Add launchers in positions where they naturally attract user attention, the biggest lever for recurring traction ![Increase Discoverability 1 St Level Launcher Multiple Launchers](https://mintcdn.com/cello/hRw0TtxP9XMl4Flv/images/increase-discoverability-1-st-level-launcher-multiple-launchers.png?fit=max\&auto=format\&n=hRw0TtxP9XMl4Flv\&q=85\&s=ccead681c436e873b917dc5e1163e983) ## **1st-level visibility** +4.4x activation rate +21 score points Display the **CTA link in the navigation menu at 1st-level**. When the link is displayed in a prominent position on screen, it can improve activation significantly. **Its positioning is crucial.** If the CTA is placed in a secondary menu, the activation rate is drastically reduced (\<1%). ### How to implement? 1. Choose a 1st level menu position and give it a unique html identifier. 2. Decide what your CTA is. We advice [adding a reward amount](https://docs.cello.so/referral-component/custom-launcher#add-reward-in-launcher) as it **increases activation by 1.5x** and adds **6 points** to your score. 3. Set the Custom Launcher Selector in [Cello Portal → User experience](https://app.cello.so/user-experience) to match your element identifier. For a step-by-step guide, go to [Custom Launcher documentation](/referral-component/custom-launcher). ## **Multiple referral launchers** +8.8x activation rate +14 score points Integrating multiple launchers into your product pages can significantly increase activation, especially on pages where users are **primed for sharing such as upgrades, subscriptions, sharing content, and inviting team members.** The benefits of adding a custom launcher is that you can craft an activation message specific to that particular context. ### How to implement? You can add a custom button anywhere in your UI and have it open the Referral Component. 1. Identify where to add the button together with your growth manager and UX designer. 2. Use [window.Cello("open")](/sdk/client-side/cello-js-usage#open-destination) method to open the Referral Component when the button is clicked. ```javascript theme={null} window.Cello("open"); ``` ## Performance impact The chart below shows all Cello average active users rates. User activation increases by 8.8x when applying these 2 recommendations. ![Increase Discoverability](https://mintcdn.com/cello/hRw0TtxP9XMl4Flv/images/increase-discoverability.png?fit=max\&auto=format\&n=hRw0TtxP9XMl4Flv\&q=85\&s=f31a370a743cec1a2e0f9fa6a34eb391) # Contextual Sharing Source: https://docs.cello.so/guides/best-practices/contextual-sharing Guide for increasing referral sharing at key moments Increase sharing by creating referral program awareness, keeping it top of mind for users and making referrals part of your main user flow. To achieve this, we recommend utilizing **moments of delight** and regular communication. How to encourage referrers to share at key moments in the user journey: * [Add a CTA to refer your product](#add-a-cta-to-refer-your-product) * [Send an instant message to introduce the referral program](#send-an-instant-message-to-introduce-the-referral-program) * [Add referral link to regular emails](#add-referral-link-to-regular-emails) > [!TIP] > > **Contextual sharing can increase sharing rates by 3.4x** > > Adding sharing prompts to just a few moments of delight can increase sharing rates more than x3. ![Contextual sharing strategy overview showing integration points in user journey](https://mintcdn.com/cello/6Zr08teY9AER0ncF/guides/best-practices/cello-guides-contextual-sharing-1.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=5d7f506061d33f5f03f70f4df175db44) ## Add a CTA to refer your product A product lifecycle naturally has **moments of delight** when a user would be more likely to share their satisfaction with the product within their network. Add a CTA to open the [referral component](/sdk/client-side/cello-js-usage) at such moments and make referring part of this flow. ![In-app announcement introducing referral program at moment of delight](https://mintcdn.com/cello/6Zr08teY9AER0ncF/guides/best-practices/cello-guides-contextual-sharing-4.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=3ac14bb56f7668eeab6e3c0ca50209ed) ### How to implement? For Developers You can add a custom button anywhere in your UI at the moment of delight and have it open the Referral Component. 1. Identify where to add the button together with your Growth manager and UX designer 2. Use [window.Cello("open")](/sdk/client-side/cello-js-usage#open-destination) method to open the Referral Component when the button is clicked. ```javascript theme={null} window.Cello("open"); ``` ## Send an instant message to introduce the referral program When your user reaches a **moment of delight** in their journey, that's the time to prompt them to share your product with an introductory in-product message i.e. [announcement](/guides/user-experience/referral-notifications-and-emails#announcement). This introduces the referral program to the user at the time they feel compelled to share their experience and effectively boost the conversion rate from users to referrers. ![Examples of referral CTAs integrated at moments of delight](https://mintcdn.com/cello/6Zr08teY9AER0ncF/guides/best-practices/cello-guides-contextual-sharing-2.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=2f3b2128e510c622ef376702e38785f3) ### How to implement? For Developers You can trigger [an announcement](/guides/user-experience/referral-notifications-and-emails#announcement) using [Cello.js](/sdk/client-side/cello-js-usage) client-side JS method at any point of the user journey. Here is how to do it: 1. Add [announcement to your custom launcher](/referral-component/custom-launcher#add-announcement-selector), so they are displayed when triggered. 2. Use [window.Cello("showAnnouncement")](/sdk/client-side/cello-js-usage#showannouncement-announcement) method to open the Referral Component when the button is clicked. Below example will trigger a default [welcome announcement](/guides/user-experience/referral-notifications-and-emails#announcement): ```javascript theme={null} window.Cello("showAnnouncement", { "type": "welcome-announcement-1" } ); ``` > [!TIP] > > You can also use a server-side API to trigger the announcement. Check out this guide [on behaviour-based triggers](/guides/best-practices/behavior-based-triggers). ## Add referral link to regular emails Use regular communication with your users as an opportunity to remind them about the referral program and keep it top of mind. For example, add their personal invite link to your weekly updates or transactional emails. ![Email template with referral link integration example](https://mintcdn.com/cello/6Zr08teY9AER0ncF/guides/best-practices/cello-guides-contextual-sharing-3.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=71cd7e0d9a9ad40f8540514090fc458d) ### How to implement? For Developers Depending on your email sending service, you can add additional content to your email, in this case, a personal invite link. To get the link for each referrer, you can use our Cello API [/active-link endpoint](/api-reference/referral-codes/fetch-active-link) and enrich the emails you already send to your users with information about referral program and their personal invite link. # Optimize signup conversion Source: https://docs.cello.so/guides/best-practices/optimizing-signup-conversion Recommendations to optimize the signup conversion of referred users Improve signup conversion for referred users with personalized experiences. These best practices can significantly increase conversion rates. 1. **Show personalization and discounts** - Display the referrer's name and discount offer on your website 2. **Custom referral landing page** - Create a dedicated landing page and disable the Cello-hosted page ## **Show personalization and discounts** \~50% higher signup rate When a referred user lands on your website, showing them who referred them and what discount they're getting makes the offer feel personal. They're not seeing a generic signup page. They're seeing a recommendation from someone they know, with a clear incentive to act. ![Personalization example](https://mintcdn.com/cello/M1jfPW839M7x8wbe/images/image-6.png?fit=max\&auto=format\&n=M1jfPW839M7x8wbe\&q=85\&s=503a1b57967d8cb2e637a8cc543cbeb5) ### How it works 1. **Personalization**: Referrer names can be integrated into your website or into Cello's new user banner. The name is provided via the Cello boot inside your product. 2. **Full integration**: Your developer can set up personalization directly in your website based on URL parameters and cookie information provided by Cello. 3. **New user banner**: Cello can activate a banner on your website to display the offer to referred users. Personalization is optional. 4. **Disable Cello-hosted landing page**: The Cello hosted-landing page can be disabled since discount information is displayed on your website. One conversion step is eliminated. ### How to implement Your developer can add personalization in two ways: * **Inline personalization**: Use the [Cello Attribution script](/sdk/client-side/attribution-js-usage) to fetch referrer info and display it in your page headlines, banners, or CTAs * **New user banner**: Enable the no-code [Cello banner](/guides/user-experience/personalizing-referrals#add-personalization-with-the-new-user-banner) that automatically appears for referred visitors To fetch referrer information for personalization, use the [referral code API](/api-reference/referral-codes/fetch-referral-code-info). For detailed implementation guides, see: * [Personalizing referrals](/guides/user-experience/personalizing-referrals) * [New user discounts](/guides/user-experience/new-user-discounts) ### Examples 🔗 [VEED referral landing page with personalization](https://veed.cello.so/x23zCRNtZqx) 🔗 [MeetGeek with personalized new user banner](https://meetgeek.ai/go/refer?productId=app.meetgeek.ai\&ucc=vTlj7ne4Fkf\&n=VG9iaWFz) *** ## **Custom referral landing page** \~2x higher signup rate Instead of sending referred users to the Cello-hosted landing page, send them directly to a page you control. You can tailor the messaging, show your product's value, and get them to signup without an extra redirect. Fewer steps can lead to less drop-offs. ### Key building blocks 1. **Personalized headline** - Include the referrer's name 2. **New user discount** - Make the discount clear and visible 3. **Hero message** - Your key value proposition 4. **Product visual** - Show what the product does 5. **CTA** - Direct signup with the offer highlighted 6. **Social proof** - G2/Capterra badges, Trustpilot, customer logos 7. **Customer quotes** - Real testimonials 8. **FAQs** - Answer common questions > [!TIP] > > **Leverage existing assets** - Do you already have an optimized landing page for ads? Reuse the content and directly include the signup form for the fastest path to success. ### How to set up 1. Create your landing page using the building blocks above 2. Go to [User experience → Landing page](https://app.cello.so/user-experience/landing-page) in Cello Portal 3. Switch to **Custom landing page** and add your URL For a detailed guide, see [Optimizing referral landing pages](/guides/user-experience/optimizing-landing-pages). ### Examples 🔗 [Typeform landing page](https://www.typeform.com/refer-a-friend/invite/?utm_medium=referrerlink\&utm_source=typeform\&utm_campaign=refer_a_friend_cello\&productId=admin.typeform.com\&ucc=ARn30TGHAsq) 🔗 [VEED landing page with personalization](https://veed.cello.so/x23zCRNtZqx) 🔗 [Heyflow standalone landing page](https://get.heyflow.app/referral-lp?productId=go.heyflow.app\&utm_source=cello\&utm_medium=referral\&utm_campaign=Cello-RS20-C1000-D50\&ucc=2dRGoRjgP7A#start) 🔗 [Cello standalone landing page with direct signup](https://cello.so/invitation/) # Setting Up Campaigns Source: https://docs.cello.so/guides/campaigns/setting-up-campaigns Cello makes it easy to automatically notify and reward your users for making successful referrals Cello makes it easy to automatically notify and reward your users for making successful referrals. This is done by creating **campaigns** with specific **payout rules.** Your rules are then automated based on confirmation of **events** and **purchases.** These can be based on transactions for referred contacts, but can also be based on free trials, demos, or events you define. ## Example: Recurring Rewards Encourage Continuous Sharing In this typical example, a referrer is rewarded **50%** for each referral up to a **\$100 maximum reward cap** with a **\$5 signup bonus**. The referee initially purchases a **\$10** subscription for herself, and then **upgrades her team** in the following month. The referrer earns recurring rewards with each payment until they reach the **maximum cap of \$100** for this referral. In this example, that happens to take 6 months based on the referred user's spending. These regular rewards encourage further sharing. ![Recurring rewards example over 6 months](https://uploads.developerhub.io/prod/d316/oh9ars47amj4ogptpxzfqvdvdv7g6dcm7fho2e7s65odyhqx962x9s3h0bwzk0sv.png) It's important to note that the **new user also receives an exclusive 50% discount** from the referrer when purchasing for the first 6 months. Our research shows that **symmetric rewards** (i.e., the referrer and the referred have incentives of similar values) work best because referrers invest their social capital when recommending a product; having similar incentives makes the referral look fair to both parties involved. ## Campaign Settings All campaigns must have one or more rules to reward referrers for the referrals they made. **Campaign** settings can be configured under [Campaigns](https://app.cello.so/campaigns) in the Cello Portal. ![Campaigns page listing user referral, A/B testing and partner campaigns with their rewards and new user discounts](https://mintcdn.com/cello/7eTCc0afkbnHBNzw/guides/campaigns/campaigns-list.png?fit=max\&auto=format\&n=7eTCc0afkbnHBNzw\&q=85\&s=926ca0a35f7b02eeb6f00b0aec7b30c0) Open a campaign and click **Edit** on the **Rewards** section to change them. ![Rewards section of a campaign with reward amount, reward cap, new user discount and bonuses](https://mintcdn.com/cello/LPpA77SIJOCgPpJp/guides/campaigns/campaign-rewards.png?fit=max\&auto=format\&n=LPpA77SIJOCgPpJp\&q=85\&s=a129c6dab8a51180d3e1ed1a36142fca) Rewards are typically based on a **percentage** of the transaction amount generated when new customers make a payment up to a **maximum** amount per referral. Additional rewards can also be set on other key events such as **signups** and **purchases** to help encourage more engagement and sharing. | **Section** | **Rule** | **Description** | | - | - | - | | What the referrer gets | Reward amount | Percentage of attributed new revenue that will be paid as a reward | | What the referrer gets | Reward cap | The maximum reward that can be earned per referral | | Bonuses | Signup bonus, First-purchase bonus | Additional rewards that can be set for signups or purchases to encourage more sharing. Bonus rewards are also recommended for products with longer free to paid conversion times. | | New user discount | Discount amount and Duration | The new user discount to encourage additional sharing. | > [!WARNING] > > Cello uses the new user reward settings to display to the new user on your signup screens. You will need to take additional steps to implement the discount at the point of purchase. See the docs [here](/attribution/apply-discounts) for more information. ### Running promotional campaigns Cello supports one active campaign at a time. To run a time-limited promotion (e.g., Black Friday): 1. Adjust your reward percentages and new user discounts in [Campaign Settings](https://app.cello.so/campaigns) 2. Revert the settings when the promotion ends There's no automated scheduling, so set a reminder to update your settings before and after the promotional period. # Cello vs. FirstPromoter Source: https://docs.cello.so/guides/competitor-comparison/cello-vs-firstpromoter Compare Cello and FirstPromoter for referral programs: integration effort, server vs client tracking, in‑app UI, notifications, campaign rules, payouts, and trade‑offs. If you're deciding between **Cello and FirstPromoter** for referrals, this page gives a practical comparison to help you choose. You'll find what you need to build for each option and the trade‑offs across attribution reliability, in‑app UX, notifications, campaigns, and payouts. > [!TIP] > > **Cello** embeds a native referral component, coordinates in‑app + email journeys, and uses server‑side attribution via Stripe and webhooks. **FirstPromoter** provides a tracking snippet and hosted affiliate portal; teams typically build or embed the user experience themselves. ## Overview * **In‑product referral UI**: Cello provides a native in‑app referral panel for web and mobile; users see their link, status, and rewards inside your app. * **Affiliate portal model**: FirstPromoter centers on a JavaScript tracking snippet (`fpr.js`) and a hosted portal; there is no pre‑built in‑app referral panel. ## Integration and UX embedding | **Topic** | **Cello** | **FirstPromoter** | | - | - | - | | **Referral UI embedding** | Native Referral Component; in‑app panel shows link, status, rewards. | JS tracking snippet; no embedded referral widget. Affiliate UI is hosted externally or embedded via iframe. | | **Custom launcher / placement** | Custom Launcher to open panel from any UI element with full styling control. | No equivalent launcher pattern; developers wire UI to APIs or redirect to hosted pages. | | **Branding & control** | Inherits your design system; theming is automatic. | Branding primarily on the hosted portal or via white‑label settings. | ### Example Open Cello’s referral panel from a profile menu item; keep the experience fully in‑app and on‑brand. ![Referral Component Pn](https://mintcdn.com/cello/6Zr08teY9AER0ncF/referral-component/referral-component.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=73321c0f80997dd009c289bd91a0513c) ### Notifications and engagement Cello includes an in‑app and email notification system for referral programs: * **In‑app alerts and badges:** e.g., an alert under a “Rewards” tab and a badge on the launcher when a reward is earned. * **Announcements (callouts):** prompts for next actions such as adding payout details after earning a reward. * **Email notifications:** lifecycle emails at moments like welcome, first share, reward earned, and unclaimed reminders. * **Journey logic:** behavior‑based timing (e.g., alert now, then announcement after 7 days if no action). ![Announcement feature examples](https://uploads.developerhub.io/prod/d316/ctsxd2yb6srflbb9e4aejnc85yabjrh8lzuhw2cw9xf5i03m9czkjbh3pm59vh1e.png) FirstPromoter offers **email notifications** and **webhooks** for events. There is **no native in‑app notification layer**; teams implement journeys via external tooling, **requiring additional development effort**. ## Mobile SDKs | **Topic** | **Cello** | **FirstPromoter** | | - | - | - | | **Native mobile SDKs** | iOS, Android, and React Native SDKs with a plug‑and‑play referral component. | No native mobile SDK; web‑first via JavaScript (`fpr.js`) and REST API/webhooks. | | **Integration pattern** | Quick install (SPM/CocoaPods/Gradle). Initialize with product ID/user token; supports custom launchers and native share sheets. | Mobile apps embed a web view/portal or build custom flows against the REST API and webhooks. | | **In‑app referral UI** | Embedded panel inside the mobile app; users copy links, view progress, manage rewards natively. | No pre‑built in‑app panel; experiences are web/portal‑based or custom‑built. | | **Payout support** | Platform includes automated payouts via PayPal/Venmo with credit note issuance and VAT handling (outside SDK code). | Payouts handled externally via dashboard/API; not native to the mobile app. | > [!WARNING] > > If you need native, in‑app referral UX on iOS/Android with minimal build, Cello’s SDKs provide a faster path. FirstPromoter requires custom mobile implementation or redirecting to a web portal. ## Attribution: client vs server flow | **Topic** | **Cello** | **FirstPromoter** | | - | - | - | | **Tracking model** | Backend‑centric attribution using secure IDs and event webhooks (e.g., Stripe). No reliance on cookies or client scripts. | Client‑side cookie tracking by default (`_fprom_ref`, `_fprom_tid`). API‑only mode exists but requires custom setup. | | **Conversion flow** | Ties referrals to backend payment events via Stripe metadata (`cello_ucc`, `new_user_id`) or API payloads. Deterministic even in blocked/mobile contexts. | Attributes sales by matching customer emails from client‑recorded leads to billing events; sensitive to missing cookies or mismatched emails. | | **Resilience** | Works in privacy‑restricted or JS‑disabled environments; ideal for mobile, embedded, or secure checkout flows. | Dependent on browser state; cookie‑less or JS‑restricted scenarios require custom logic. | > [!WARNING] > > In environments with strict CSP, script blockers, mobile apps, or server‑rendered checkouts, server‑first attribution reduces reliance on client events. FirstPromoter can be configured via API but requires additional work. ## Campaigns, rewards, and payouts ### Campaign design and reward rules | Aspect | **Cello** | **FirstPromoter** | | - | - | - | | **Campaign flexibility** | Multi‑condition campaigns (percentage, fixed, discount) within one rule set. | One primary reward per campaign; advanced structures require manual setup. | | **Double‑sided** | Native friend incentives (“give $X, get $Y”) built into campaign logic. | Implemented via coupon codes synced with Stripe; manual configuration required. | | **Recurring rewards** | Recurring rewards with configurable caps per campaign. | Recurring commissions supported; limits are defined per campaign manually. | | **Computation** | Reward logic executed server‑side; rewards auto‑registered via events. | Tracked on client lead creation; resolved by matching purchase webhooks. | ### Payout management | Aspect | **Cello** | **FirstPromoter** | | - | - | - | | **Fulfillment** | Automated reward registration and payout initiation. | Aggregates commissions; payouts executed manually or via PayPal API. | | **User experience** | Users select payout method (e.g., PayPal, Venmo) inside your application. | Payouts managed on the hosted portal; not within your product UI. | ## Summary: key differences 1. **In‑app referral UX vs portal**: Cello provides a native embedded panel; FirstPromoter uses a hosted affiliate portal and snippet. 2. **Engagement**: Cello offers in‑app + email journeys; FirstPromoter relies on email and webhooks with no in‑app layer. 3. **Attribution**: Cello is server‑first via metadata/webhooks; FirstPromoter defaults to client cookies and email matching. 4. **Campaigns**: Cello supports multi‑type and double‑sided rewards in one campaign; FirstPromoter is more single‑reward oriented. 5. **Payouts**: Cello manages payouts inside your app; FirstPromoter manages payouts externally. 6. **Mobile SDKs**: Cello offers native iOS/Android/React Native SDKs with a plug‑and‑play component; FirstPromoter has no native mobile SDK and is web‑first. Select the option that fits your integration model (in‑app vs portal), attribution requirements (server‑side vs client‑side), and operational preferences (built‑in journeys vs custom tooling). # Cello vs. Impact Advocate (SaaSquatch) Source: https://docs.cello.so/guides/competitor-comparison/cello-vs-impact-advocate Compare Cello and Impact Advocate (SaaSquatch): integration effort, widgets vs embedded UI, server vs client attribution, notifications, campaign rules, and payouts. If you're deciding between **Cello and Impact Advocate (SaaSquatch)** for referrals, this page gives a practical comparison across integration effort, attribution reliability, in‑app experience, notifications, campaigns, and payouts. > [!TIP] > > **Cello** embeds a native referral component, coordinates in‑app + email journeys, and uses server‑side attribution via Stripe metadata. **Advocate** relies on embeddable widgets and external portals that often require additional styling and setup to feel native. ## Overview * **Embedded referral UI**: Cello’s Referral Component integrates natively in your app (web/mobile) with automatic theming and a launcher. * **Widget/portal model**: Advocate provides widgets (`squatch.js`, ``), which are external elements styled separately or surfaced via a portal. ## Integration and UX embedding | **Topic** | **Cello** | **Impact Advocate (SaaSquatch)** | | - | - | - | | **Referral UI embedding** | Native Referral Component; in‑app panel with link, status, rewards; floating or custom launcher supported. | Widgets via `squatch.js` or ``; iframe‑like embeds requiring separate styling; no pre‑built native referral panel. | | **Custom launcher / placement** | Custom Launcher to open panel from any UI element, keeping the flow in context. | Developers manually wire triggers (e.g., ``); no built‑in launcher button. | ### Example Open Cello’s referral panel from a menu item; keep users in‑app with a cohesive look and feel. Widgets typically need extra work to match your design system. ![Referral Component Pn](https://mintcdn.com/cello/6Zr08teY9AER0ncF/referral-component/referral-component.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=73321c0f80997dd009c289bd91a0513c) ### Notifications and engagement Cello includes an in‑app and email notification system for referral programs: * **In‑app alerts and badges** for important moments like reward earned. * **Announcements (callouts)** to prompt next actions, such as adding payout details. * **Email lifecycle notifications** (welcome, first share, reward earned, unclaimed reminders). * **Behavior‑based timing** to coordinate in‑app and email touchpoints. ![Announcement feature examples](https://uploads.developerhub.io/prod/d316/ctsxd2yb6srflbb9e4aejnc85yabjrh8lzuhw2cw9xf5i03m9czkjbh3pm59vh1e.png) **Advocate** provides **event webhooks** and **email templates** but no native in‑app notification layer. Teams typically build in‑app nudges with other systems, **requiring additional development effort**. ## Mobile SDKs | **Topic** | **Cello** | **Impact Advocate (SaaSquatch)** | | - | - | - | | **Native mobile SDKs** | iOS, Android, React Native SDKs with a plug‑and‑play referral component. | iOS and Android SDKs available; mobile widgets and deep‑linking supported. | | **Integration pattern** | Quick install (SPM/CocoaPods/Gradle). Initialize with product ID/user token; supports native share sheets and custom launchers. | Hybrid model: combine SDK with server‑side REST API calls; SDKs do not support payment‑provider programs. | | **In‑app referral UI** | Embedded mobile panel showing link, progress, rewards; theming aligns with app UI. | SDK gives control over in‑app presentation; also offers mobile widgets to embed experiences. | | **Payout support** | Platform includes automated payouts via PayPal/Venmo with credit note issuance and VAT handling (outside SDK code). | Rewards tracked in platform; payout fulfillment handled via platform/integrations, not SDK. | > [!WARNING] > > Impact’s SDKs cover core referral mechanics but require server APIs and do not support payment‑provider programs. Cello’s SDKs include a pre‑built component and platform payout automation to reduce custom work. ## Attribution: client vs server flow | **Topic** | **Cello** | **Impact Advocate (SaaSquatch)** | | - | - | - | | **Client dependency** | Backend‑centric attribution driven by webhooks and secure metadata; resilient without client scripts. | Client + cookie‑based tracking by default; server API integration is optional and requires extra setup. | | **Payment/Stripe linkage** | Stripe metadata (`cello_ucc`, `new_user_id`) for direct backend attribution - no client JS required. | Relies on browser cookies or manual event calls; payment integrations exist but typically require more config. | > [!WARNING] > > In strict CSP environments, with script blockers, mobile apps, or server‑rendered checkouts, server‑first attribution reduces points of failure. Advocate can reach parity with extra server work. ## Campaigns, rewards, and payouts ### Campaign design and reward rules | Aspect | **Cello** | **Impact Advocate (SaaSquatch)** | | - | - | - | | **Campaign flexibility** | Multiple reward types in one campaign (fixed, %, signup bonus, discounts); double‑sided supported. | Complex structures via rules engine but often split across multiple programs. | | **Reward types** | Combines cash, % commissions, and friend discounts in one flow. | Wide catalog (points, gift cards, coupons) but often one primary type per program. | | **Configuration** | Managed in Cello dashboard or via API. | Configured mainly in Advocate portal; APIs for advanced use cases. | ### Payout management | Aspect | **Cello** | **Impact Advocate (SaaSquatch)** | | - | - | - | | **Fulfillment** | Fully automated payouts (PayPal, Venmo) with tracking and tax handling. | Tracks rewards; fulfillment via provider integrations (PayPal, Tango Card) or manual. | | **User experience** | Users claim and manage payouts inside your app. | Users redeem via portal, email, or third‑party sites. | | **Workflow** | End‑to‑end: reward earned → notified → paid. | Requires configuration of a payout provider or manual redemption flow. | ### Recurring rewards and multi‑month commissions | Aspect | **Cello** | **Impact Advocate (SaaSquatch)** | | - | - | - | | **Recurring commissions** | Native recurring rewards with configurable caps. | Supports recurring events; caps require custom logic. | | **Granular controls** | Built‑in duration and cap settings per campaign. | Requires advanced rule setup or calculated fields. | ## Summary: key differences 1. **Embedded UI vs widgets/portal**: Cello is native in‑app; Advocate relies on widgets and portals. 2. **Engagement**: Cello provides in‑app + email journeys; Advocate requires external tooling for in‑app nudges. 3. **Attribution**: Cello is server‑first via Stripe metadata; Advocate defaults to client/cookie tracking. 4. **Campaigns**: Cello composes multiple reward types in one campaign; Advocate often splits across programs. 5. **Payouts**: Cello automates payouts inside your product; Advocate integrates with providers or uses manual flows. 6. **Mobile SDKs**: Both provide native iOS/Android SDKs; Cello includes a plug‑and‑play component and platform payout automation, while Advocate’s SDK is hybrid (server APIs) and does not support payment‑provider programs. Choose the option that aligns with your integration model (embedded vs widgets/portal), attribution requirements, and operations (built‑in journeys vs custom assembly). # Cello vs. PartnerStack Source: https://docs.cello.so/guides/competitor-comparison/cello-vs-partnerstack Compare Cello and PartnerStack for referrals: embedded UI vs external portal, server vs client tracking, notifications, campaign rules, payouts, and trade‑offs. If you're evaluating **Cello vs PartnerStack** for referral programs, this guide summarizes integration effort, attribution reliability, in‑app experience, notifications, campaigns, and payouts to inform your choice. > [!TIP] > > **Cello** embeds a native referral panel with server‑side attribution and in‑app + email journeys. **PartnerStack** focuses on a broad partner portal and JS SDK; users typically manage links and payouts on an external dashboard. ## Overview * **In‑product referral UI**: Cello’s Referral Component lives inside your app; users can copy links, view stats, and manage rewards without leaving. * **Portal‑centric model**: PartnerStack centers on an external portal and SDK; in‑app referral UI is minimal and often redirects to PartnerStack. ## Integration and UX embedding | **Topic** | **Cello** | **PartnerStack** | | - | - | - | | **Referral UI embedding** | Embedded referral panel in‑app; shows each user’s link, stats, rewards, fully native to your UX. | JS SDK and simple iFrame form for collecting emails/generating links. No in‑app referral dashboard; users manage referrals on PartnerStack’s site. | | **Custom launcher / placement** | Flexible launcher: attach panel open to any element (menu item, button). Replace or hide the default floating button for a fully branded UX. | No native launcher concept; teams create custom buttons/links to open forms or redirect to the portal. | ### Example Open Cello’s panel from an “Invite Friends” button in your app; PartnerStack typically takes users out to an external dashboard for management. ![Referral Component Pn](https://mintcdn.com/cello/6Zr08teY9AER0ncF/referral-component/referral-component.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=73321c0f80997dd009c289bd91a0513c) ### Notifications and engagement Cello includes an in‑app and email notification system for referral programs: * **In‑app alerts & badges** for referral joins or rewards earned. * **Announcements** prompting next steps (e.g., add payout details). * **Email lifecycle** for welcome, reward earned, and unclaimed reminders. * **Behavior‑based timing** to coordinate prompts and reminders. ![Announcement feature examples](https://uploads.developerhub.io/prod/d316/ctsxd2yb6srflbb9e4aejnc85yabjrh8lzuhw2cw9xf5i03m9czkjbh3pm59vh1e.png) **PartnerStack** does not provide native in‑app notifications. It relies on **webhooks** and external email triggers; custom in‑app messaging requires manual builds, **requiring additional development effort**. ## Mobile SDKs | **Topic** | **Cello** | **PartnerStack** | | - | - | - | | **Native mobile SDKs** | iOS, Android, React Native SDKs with a plug‑and‑play referral component. | No native mobile SDK; focuses on partner portal, JS tracking, and referral iFrame. | | **Integration pattern** | Quick install (SPM/CocoaPods/Gradle). Initialize with product ID/user token; supports native share sheets and custom launchers. | Mobile apps embed a portal/iFrame or build custom UI against REST APIs; referrals managed in external portal. | | **In‑app referral UI** | Embedded mobile panel that is themable and aligns with app UI. | No pre‑built in‑app referral panel; experiences are portal/web‑based. | | **Payout support** | Platform includes automated payouts via PayPal/Venmo with credit note issuance and VAT handling (outside SDK code). | Payouts managed via PartnerStack portal on monthly cycles; not inside your app. | > [!WARNING] > > If you need native iOS/Android referral experiences, Cello’s SDKs provide the in‑app component. PartnerStack is portal‑centric and requires custom app work or redirects. ## Attribution: client vs server flow | **Topic** | **Cello** | **PartnerStack** | | - | - | - | | **Client dependency** | Backend‑centric tracking: attribution on server events (e.g., Stripe webhooks); no cookies or client scripts required. | Client‑centric tracking via JS snippet and cookies; requires a front‑end call to confirm conversions. Missing scripts or blockers can break attribution. | | **Stripe / metadata** | Server metadata‑based: referral codes stored on Stripe objects; attribution via webhooks. | Cookie & ID matching: matches by email or client IDs, often with delays. Server‑side setup is optional and more complex. | > [!WARNING] > > Server‑first attribution remains reliable across strict privacy environments, mobile apps, and blocked scripts. PartnerStack’s JS flow is browser‑dependent unless hardened with server integrations. ## Campaigns, rewards, and payouts ### Campaign design and reward rules | Aspect | **Cello** | **PartnerStack** | | - | - | - | | **Campaign flexibility** | Multiple reward types in one campaign: % commissions, bonuses, caps, and friend discounts. | Managed via Triggers: one reward per trigger; complex logic requires multiple triggers. | | **Reward types** | Combine % and fixed bonuses, plus new‑user discounts, in a single setup. | Each trigger offers a single flat or % reward; no native friend‑gets‑X incentives in the same flow. | ### Payout management | Aspect | **Cello** | **PartnerStack** | | - | - | - | | **Fulfillment** | Automated payout calculation and initiation. | Monthly batch payouts via the portal or manual approval. | | **User Experience** | Referrers choose payout method (e.g., PayPal, Venmo) inside your app. | Users get paid via PartnerStack’s portal, not inside your product. | | **Workflow** | Real‑time payout updates and in‑app notifications. | External batch payout cycle, disconnected from your UX. | ### Recurring rewards and multi‑month commissions | Aspect | **Cello** | **PartnerStack** | | - | - | - | | **Recurring commissions** | Native recurring rewards with configurable caps. | Recurring commissions supported; caps require manual setup. | | **Control** | Built‑in duration and reward caps. | Requires manual review or multi‑trigger management. | ## Summary: key differences 1. **In‑app UI vs portal**: Cello is embedded; PartnerStack is portal‑centric. 2. **Engagement**: Cello provides in‑app + email journeys; PartnerStack relies on external comms. 3. **Attribution**: Cello is server‑first via metadata/webhooks; PartnerStack defaults to client/cookie tracking. 4. **Campaigns**: Cello composes multiple rewards in one campaign; PartnerStack uses single‑reward triggers. 5. **Payouts**: Cello supports in‑app payout flows; PartnerStack manages payouts externally. 6. **Mobile SDKs**: Cello offers native iOS/Android/React Native SDKs with an embedded component; PartnerStack has no native mobile SDK (portal‑centric). Choose the platform that matches your desired integration model, attribution requirements, and operational ownership. # Cello vs. Rewardful Source: https://docs.cello.so/guides/competitor-comparison/cello-vs-rewardful Evaluate and prototype Cello vs Rewardful: what to build, risks, and trade‑offs across attribution, UI, notifications, rewards, and payouts. If you're deciding between **Cello and Rewardful** for referrals, this page gives a practical comparison to help you choose. You'll find a concise overview of what you need to build for each option, the trade‑offs around attribution reliability, in‑app UX, notifications, campaigns, and payouts, and practical pros/cons to inform your architecture. > [!TIP] > > **Cello** offers an embedded referral UI, built‑in journeys, and server‑first attribution that can reduce time‑to‑value; **Rewardful** provides a lightweight tracking layer suited to teams that plan to build out user experience and messaging orchestration themselves. ## Overview * **In‑product referral UI**: Cello embeds a panel directly in your application so users can copy links, view progress, and manage rewards without leaving your app. * **Snippet‑based tracking**: Rewardful centers on a JavaScript snippet and REST API. You implement the user‑facing UI yourself or link out to an external portal. ## Integration and UX embedding | **Topic** | **Cello** | **Rewardful** | | - | - | - | | **Referral UI embedding** | Cello’s referral component embeds in your UI. Use a floating action button or a custom launcher to open an in‑app panel with a user’s referral link, status, and rewards. | Implements a JS snippet that exposes a browser API (`rewardful` function) to track conversions. No pre‑built in‑app referral panel; you build the user‑facing experience or use their portal. | | **Custom launcher / placement** | Cello supports a custom launcher: attach any element (button, menu item, etc.) to open the referral panel; you may hide the default floating button. | No native embedded launcher. Teams wire up their own UI to call methods like `rewardful('ready', ...)` and `rewardful('convert', {...})`. | ### Example **Cello** Referral Component opens from a custom launcher in your product menu. This keeps the experience in‑app and aligned with your UI. ![Referral Component Pn](https://mintcdn.com/cello/6Zr08teY9AER0ncF/referral-component/referral-component.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=73321c0f80997dd009c289bd91a0513c) **Rewardful** does not provide a pre‑built in‑app referral panel; you build the user‑facing experience or use their portal. ### Notifications and engagement Cello includes an in‑app and email notification system for referral programs: * **In‑product alerts and badges:** e.g., an alert under a “Rewards” tab with a badge on the launcher when a reward is earned. * **Announcements (callouts):** anchored prompts for next actions (e.g., add payout details after earning a reward). Dismissible. * **Email notifications:** lifecycle emails at moments such as welcome, first share, reward earned, and unclaimed reminders. * **Journey logic:** timing based on behavior (e.g., alert now, follow‑up announcement after 7 days if no action; recurring reminders only for recently active users). ### Example **Cello** in‑app “new reward” notification prompts a user to add payout details in the referral component. ![Announcement feature examples](https://uploads.developerhub.io/prod/d316/ctsxd2yb6srflbb9e4aejnc85yabjrh8lzuhw2cw9xf5i03m9czkjbh3pm59vh1e.png) **Rewardful** does not include a native in‑app notification framework; Instead Rewardful exposes webhooks for events (e.g., referral created, converted, payout due). Teams typically connect these to their email/in‑app systems, **requiring additional development effort**. ## Attribution: client vs server flow | **Topic** | **Cello** | **Rewardful** | | - | - | - | | **Client dependency** | Backend‑centric attribution. Attribution runs on backend events (e.g., Stripe webhooks). SDK initialization can pass `productUserDetails` for identification and fraud checks ([docs.cello.so](http://docs.cello.so/)). | Client‑side default. Requires snippet load and `rewardful('convert', { email })` on a confirmation page. Referrals are linked via email lookup in Stripe (\~24 h) ([developers.rewardful.com](http://developers.rewardful.com/)). | | **Stripe / metadata** | Server‑side, metadata‑based. Add `cello_ucc` and `new_user_id` to Stripe Customer / Checkout Session. Webhooks link and reward automatically - no client conversion call required ([docs.cello.so](http://docs.cello.so/)). | Client‑dependent linking. Uses Stripe `client_reference_id` and a \~24 h email‑match window. Can be hardened with custom server logic ([help.rewardful.com](http://help.rewardful.com/)). | > [!WARNING] > > In environments with strict CSP, script blockers, mobile apps, or server‑rendered checkouts, a server‑first pattern reduces dependency on client events. Rewardful can be configured server‑side but requires additional work. ## Campaigns, rewards, and payouts ### Campaign design and reward rules | Aspect | **Cello** | **Rewardful** | | - | - | - | | **Campaign flexibility** | Multiple payout rules within one campaign: % commissions, fixed bonuses, reward caps, and new‑user discounts. | One reward type/rate per campaign. | | **Reward types** | Combine % of revenue, fixed bonuses (e.g., signup or first purchase), and new‑user discounts in a single flow. | Choose either % commission or fixed amount per conversion. | | **Example setup** | 50% of payments up to $100, plus $5 signup bonus, and 50% discount for 6 months - in one configuration. | Set a % or fixed reward per conversion. | | **Double‑sided incentives** | New‑user discounts integrated into campaign logic. | Possible via Stripe coupons (plan‑dependent). | | **Configuration** | Managed in‑app or via API. | Configurable via REST API. | ### Payout management | Aspect | **Cello** | **Rewardful** | | - | - | - | | **Fulfillment** | Automated reward registration and payout initiation. | Tracks payout data; execution handled externally. | | **User experience** | End‑users choose payout method (e.g., PayPal, Venmo) inside your app. | No native end‑user payout UI. | | **Workflow** | Rules calculate rewards, trigger notifications, and mark payouts ready. | Commissions accumulate; payouts marked paid via dashboard/API. | | **Integration depth** | In‑app payout management via hosted component. | Developer‑level API integration. | ### Recurring rewards and multi‑month commissions | Aspect | **Cello** | **Rewardful** | | - | - | - | | **Recurring commissions** | Native support for recurring rewards with configurable caps. | Recurring commissions via Stripe renewals. | | **Granular controls** | Reward caps configurable in campaign setup. | Reward caps often require custom logic. | | **Common use cases** | Multi‑month or capped rewards configured directly. | Lifetime or one‑off bounties are typical. | | **Implementation** | Defined in campaign configuration. | Tracked via Stripe events. | ## Summary: key differences 1. **In‑app referral UI vs snippet‑only**: Cello includes an embedded panel; Rewardful provides tracking APIs. 2. **Notifications**: Cello includes in‑app and email journeys; Rewardful relies on webhooks to power your own stack. 3. **Attribution**: Cello is server‑first via Stripe metadata; Rewardful defaults to client conversion calls (server hardening is possible). 4. **Campaigns**: Cello supports multiple reward rules per campaign; Rewardful focuses on a single reward type/rate. 5. **Payouts**: Cello provides in‑app payout flows; Rewardful tracks balances and leaves payout UX external. Select the option that best aligns with your integration model (in‑app vs external), attribution requirements (server‑side vs client‑side), and operational preferences (built‑in journeys vs custom tooling). # Fraud Detection Source: https://docs.cello.so/guides/fraud-detection Cello provides automated capabilities to detect and automatically mitigate potential cases of self-referrals and fraudulent activity Cello provides automated capabilities to detect and automatically mitigate potential cases of self-referrals and fraudulent activity. With Cello, you can maintain complete control of how any potential cases are handled, either by automatically rejecting or reviewing some on a case-by-case basis. ### Reviewing potential cases Potential cases of self-referrals or other fraudulent activity are flagged in the Cello portal under the **[Referrals → Review](https://app.cello.so/referrals/review)** section. You can then see all cases that are **In Review** or **Completed** using the filters at the top of the table. ![Review Referrals section with filters](https://uploads.developerhub.io/prod/d316/d9rrphodu5st3xmiu0a3kgjuteeiiq3k04ue8qs2nwgzko46gj7hvzm0m4evibru.png) ### Automation and risk factors Cello automates detection based on a number of factors to determine the potential risk of fraudulent activity. A complete list can be provided upon request. To see the individual risk factors that are available, you can hover over the status column for a referral. ![Risk factors displayed on hover](https://uploads.developerhub.io/prod/d316/400gxytd9k19v9ctbij1cuob5b4dpsj1ht86ztgwzo0vvj0534lztfbh3p9gk56j.png) > [!NOTE] > > Note that risk factors can change over time during the initial 30 day review period. ### Manually accepting or rejecting For pending referrals, you can manually accept or reject them at any time by clicking on the **Review** button and selecting your choice. You can optionally provide additional reasons for accepting or rejecting. This information is used by Cello to improve and customize detection. ![Manual review interface with accept/reject options](https://uploads.developerhub.io/prod/d316/hgx4setuiw7mouzim39ypg3gyjfcadb3pk9ert0lcd0xwmeu37lafigpp8pzkb2f.png) When reviewing transactions manually, we recommend looking for the following factors: * Issuing chargebacks or canceling within a short amount of time * Unusual patterns of usage * Is the referrer still a paying user? ### Payout delays Long payout delays are typically not required. Programs using spaced rewards with low percentages naturally have less exposure, and Cello automatically cancels pending rewards when refunds occur. If your program requires additional protection, Cello can configure a longer waiting period before rewards are paid out. Contact your CSM or [support@cello.so](mailto:support@cello.so) to set this up. You can review fraud analysis from your own AI client using [`cello_get_fraud_analysis`](/mcp/tools#cello_get_fraud_analysis) via the [Cello MCP](/mcp/growth/use-cases). # Pre-launch Testbook Source: https://docs.cello.so/guides/integration/pre-launch-testbook A step-by-step testbook to validate your Cello integration end to end: confirm each component is healthy, check your events are correct, run the manual front-end checks, and launch your program. This testbook walks you through testing your Cello integration on your own, from first event to launch. By the end you should have: * The **referral widget** and **attribution library** connected * **Signups** and **purchases** tracked, with **events validated** as correct * The **manual front-end checks** done that the portal can't see for you * Everything ready to **launch your program** This is the full testbook behind the **View full test book** link in the launch checklist and on the **Technical integration** page. ## Integrate, test, and launch You integrate, test, and launch all from your **main account**. While you build and test, the account stays in **pre-launch (testing) mode**, so everything in this testbook runs safely against your real product - nothing reaches your referrers until you go live. | Behavior | Pre-launch (testing mode) | Live | | - | - | - | | Events & data | Created as **test data** and marked as testing on your dashboards | Treated as live | | Analytics & billing | Excluded - test data isn't used in analytics calculations or billing | Included | | Rewards | **Not paid out** to referrers, even if a payout method is set | Paid out | | Notifications (emails & announcements) | **Sent** to your test users when the triggering activity happens, such as a signup being detected or a reward being issued | Sent to your real referrers | | Payout delay | **Not applied** - test transactions without waiting | Applied | | Fraud checks | Not run | Run | When you **launch your program**, payouts begin, notifications start reaching real referrers, the payout delay applies, and all new events and data are treated as live. You don't need a sandbox to run this testbook - testing happens directly in pre-launch. A **sandbox** is an optional, fully isolated environment with its own credentials (**My account → Create sandbox**). It's how you test changes once you're live, because launching is not reversible. ## What this testbook covers Six areas, each testing one part of your integration. Read this table first to see which ones apply to you, then work through them in order. | Area | What it proves | Applies to | | - | - | - | | [Referral component](#referral-component) | The widget boots in your app and the referrer-facing experience is right | Everyone except partners-only | | [Notifications](#notifications) | The badge, announcements and emails reach referrers, and email buttons open the widget | Everyone except partners-only | | [Capturing the referral code](#capturing-the-referral-code) | A referred visitor's `ucc` is captured and survives to signup | Everyone | | [Signup tracking](#signup-tracking) | Referred signups reach Cello and attribute to the referrer | Everyone | | [Applying discounts](#applying-discounts) | The new-user discount is correct at checkout | Only if your offer includes a discount | | [Purchase tracking](#purchase-tracking) | Referred purchases reach Cello with the fields rewards depend on | Everyone | Then check [Alternative scenarios](#alternative-scenarios) for anything else that describes your setup - a partners-only program, a mobile app, organization-level rewards, Auto Attribution, or report-based attribution. ## Before you start * You can sign in to the [Cello Portal](https://app.cello.so), and your main account is in **pre-launch (testing) mode** * The referral component, attribution library, and your signup and purchase events are implemented (see the [Setup Overview](/integration-overview)) * You have test accounts for **every signup method** you support (email/password, Google SSO, Microsoft SSO, and so on) - you'll need a fresh user per signup test * You have access to your payment gateway's test mode, for example [Stripe test cards](https://stripe.com/docs/testing) or the [Chargebee test gateway](https://www.chargebee.com/docs/2.0/chargebee-test-gateway.html) **Definition of done:** all four components report **Connected** when you ask your coding tool for your integration status, your events validate as **OK** under **Developers → Events**, and the manual checks in each area pass. That's everything the launch checklist asks for - then you can **launch your program**. ## Where to check things Two places do most of the work: > [card] [Integration status](/mcp/developers/integration-status) > > High-level health of your four components, through the Cello MCP server. Answers "is everything working?" > [card] [Developers → Events](/guides/support/portal/event-feed) > > Per-event, per-field validation. Answers "why did this specific event fail?" ## When each surface updates Cello's surfaces refresh at different speeds, so give each one time before assuming something is broken. These intervals are the same in pre-launch as they are once you're live. | Surface | When it updates | | - | - | | **Developers → Events** | 1-5 minutes after the event is sent | | **Integration status** | Up to \~10 minutes. A component is **Connected** once at least one successful event arrives within the health window, so re-check if you've only just sent your first event | | **Dashboards, and the referrer's view in the widget** | Hourly - signups, purchases and rewards are matched and aggregated before they surface | ## Test by area Each area below follows the same shape: what it needs before you start, what to do, and what you should see when it works. ### Referral component The referral widget (`cello.js`) booting in your app, plus the referrer-facing experience around it. **Prerequisite:** the referral component is implemented and **boots at login** - not lazily when the launcher is first clicked. Booting at login is what makes notifications and rewards ready the moment a referrer signs in, lets the button in referral emails open the widget, and produces the `booted` events Cello tracks. **Do this:** log in as a new user *without* opening the widget, so the component has to boot on its own. Open dev tools → Network, filter for `cello`, and reload. Then ask your coding tool for your integration status, and open the widget as a referrer. **You should see** | Where | What good looks like | | - | - | | Dev tools → Network | A `v2?...` request appears, confirming Cello booted at login and not just loaded | | Integration status | **Referral component** is **Connected**, with no recent errors on the card | | Your product | The launcher and widget are positioned so they don't interfere with your UI, and don't clash with other pop-ups such as Intercom | | Your product | Copy and the reward or offer in the widget, on both the Invite tab and How-it-works, are accurate | | Your product | **Add payment details** shows the payout methods you intend referrers to use | | Your product | After you log out, the widget is no longer reachable | | Your product | The widget works across browser sizes and on a mobile browser, not just desktop | **If it's not working** * If only `cello.js` loads and no `v2?...` request follows, Cello is loaded but not booted. Boot it on login. * If no Cello requests appear until you click the launcher, your app loads Cello on click. Load and boot it at login instead. Otherwise the badge and announcements can't appear before the referrer opens the widget, and [email links](#email-cta-link) can't open it. * A **JWT token** error means the widget token is missing, malformed, or expired. Regenerate it on your backend - see [User Authentication](/sdk/client-side/user-authentication). ### Notifications The badge, in-app announcements, and emails that keep referrers engaged. See [Referral notifications and emails](/guides/user-experience/referral-notifications-and-emails). **Prerequisites** * The referral component is integrated and booting, so the badge and announcements can anchor to the launcher. If you use a custom launcher, it's anchored to a unique selector. * The boot command sends `productUserDetails` with at least `email`, and `firstName` for personalization. Both are required for emails - see the [boot command](/referral-component/quickstart). * Notifications send on their own in pre-launch, so they reach your test users when the activity that triggers them happens. **Do this:** review the email and announcement previews in the Portal, then run the activity behind each notification - have a referral link viewed, and let a referred signup and a reward come through - so the badge, announcement and email reach your test user. To check an announcement's placement without waiting for a trigger, render one on demand from your browser dev console with [`window.Cello("showAnnouncement", ...)`](/sdk/client-side/cello-js-usage#showannouncement-announcement), for example `{ type: "welcome-announcement-1" }`. **You should see** | What | What good looks like | | - | - | | **Badge** | Appears on the launcher when a link is viewed or a reward is earned, and on all menu items if you use a 2nd-level menu. Allow up to an hour - the badge follows the same refresh cycle as the dashboards | | **Announcement** | Displays in full and is anchored in the correct position to the launcher | | **Email** | The copy explains how to open the referral program in your product, the logo is sharp, the CTAs work (see [Email CTA link](#email-cta-link)), the reward amounts are correct, and you've signed off on the welcome email | **If it's not working:** if the announcement doesn't show, check your [Announcement Selector](/referral-component/custom-launcher#troubleshooting-announcement-not-showing) matches exactly one visible element. #### Email CTA link Every referral email has a button that should take the referrer into your product with the widget already open. This works through the [`cello-open` URL parameter](/referral-component/quickstart#opening-the-referral-component-with-a-link): when Cello boots on a page whose URL includes `cello-open=true`, it opens the widget. **Prerequisite:** Cello boots at login, as tested in [Referral component](#referral-component). If your app only loads or boots Cello when someone clicks the launcher, nothing reads the parameter when the page opens, so the link lands in your product but the widget stays closed. **Do this** 1. In the [Cello Portal](https://app.cello.so/user-experience/emails), go to **User experience → Emails** and find the **CTA link**, the URL behind the button in every referral email. 2. Signed in as a test user, open the CTA link in a new tab without clicking the launcher. 3. Sign out, open the CTA link again, and sign in. 4. Once your test user receives a referral email, click its button. **You should see** | Where | What good looks like | | - | - | | Cello Portal | The CTA link goes to a page in your product where Cello boots, not to your marketing site or a placeholder | | Cello Portal | The CTA link includes `cello-open=true`, for example `https://app.your-product.com/?cello-open=true`, or `&cello-open=true` if the URL already has a `?` | | Cello Portal | If you set a second CTA link on the Welcome email, it goes where you intended | | Your product, signed in | The widget opens on its own, without clicking the launcher | | Your product, signed out | After you sign in, the widget opens on its own | | Test email | The button opens your product with the widget open | **If it's not working** * **Your product opens but the widget doesn't:** Cello isn't booting when the page loads. Reload with dev tools → Network filtered for `cello`, without clicking anything. If no `v2?...` request appears until you click the launcher, boot Cello at login instead. * **It works when you're already signed in, but not after signing in from the link:** your login redirect drops the parameter. Add `cello-open=true` back to the URL users land on after login. ### Capturing the referral code The attribution library (`cello-attribution.js`) on your landing pages, capturing the referral code (`ucc`) when someone clicks a referral link. **Prerequisite:** the attribution library is embedded on every page reachable from a referral link, and your signup URL is set in **User Experience → Settings**. See [Web attribution setup](/attribution/for-web). **Do this:** open one of your referral links in a fresh incognito window to land on your page, then ask your coding tool for your integration status. **You should see** | Where | What good looks like | | - | - | | Integration status | **Attribution library** is **Connected** | | Your landing page | You land on the correct page - signup, website, or referral landing page | | Your landing page | Cello's UCC is stored as a first-party cookie, under dev tools → Application → Cookies. This is what makes indirect signups attributable | | Your landing page | The new-user banner shows with the right copy, offer, colors, and **referrer personalization** such as the referrer's first name, if configured | **If it's not working:** "no signup URL" means you need to set your signup URL in **User Experience → Settings**. If it stays **Not connected**, confirm `cello-attribution.js` is embedded on the landing pages reachable from your referral links. ### Signup tracking Referred signups reaching Cello and being attributed to the referrer. **Prerequisite:** your **signup source** is set (self-serve in pre-launch) and signups are implemented for that source. > [!NOTE] > > **You can set the signup source yourself, and change it while you're still testing.** The key Stripe/Chargebee vs Cello API rule: Stripe/Chargebee can only be the signup source if your payment-provider customer is created **at signup**. IF the customer is created **at first purchase**, use the Cello API to send `new-signup` at the real signup moment instead. The right choice also depends on your payment provider, reward model, and motion - see [Changing the configured source](/mcp/developers/integration-status#changing-the-configured-source) for all the factors. If you're unsure which source fits your setup, confirm it with Cello before you build against it. > [tab] Cello API > > Source: **Cello API** (`new-signup` events). You send events yourself via [`POST /events`](/api-reference/generic-events/send-event). See [Track Signups](/attribution/tracking-signups). > > Needs an API key under **Developers → Access keys** - generate one if there isn't one. > [tab] Stripe > > Source: **Stripe** (`customer.created`, `customer.updated`). Events flow via the [Stripe webhook](/integrations/webhooks/stripe-webhook). > > Needs the Stripe webhook installed and pointed at the correct Cello endpoint. > [tab] Chargebee > > Source: **Chargebee** (`Customer Created`, `Customer Changed`). Events flow via the [Chargebee webhook](/integrations/webhooks/chargebee-webhook). > > Needs the Chargebee webhook configured and forwarding events to Cello. > [tab] Auto Attribution > > Source: **Auto Attribution** - Cello infers signups without you sending events. See the [Auto Attribution guide](/guides/attribution/auto-attribution). > > Needs Auto Attribution enabled for your tenant - contact Support if it's not in the dropdown. **Do this:** complete a referred signup by following a referral link and signing up, then check your integration status and open **Developers → Events**. Repeat for **every signup method you support**, testing both a **direct** signup (open the link, go straight to signup) and an **indirect** one (open the link, browse around your site, then sign up). **You should see** | Where | What good looks like | | - | - | | Integration status | **Signups** is **Connected**, with a recent **last attributed signup** | | Developers → Events | The signup event is **OK**, with no red **Required** or **Invalid** flags on `ucc` or `newUserId` / `productUserId` | | Your product | The **direct** signup is attributed to the referrer | | Your product | The **indirect** signup is attributed to the referrer. This one relies on the attribution cookie from [Capturing the referral code](#capturing-the-referral-code) | **If it's not working:** "events received, none attributed" means your events are arriving without a referral code. Open **Developers → Events** to see which `ucc` is missing or malformed. > [!NOTE] > > When you change a source, that component reverts to **Not connected** until events from the new source start arriving, usually within \~10 minutes. Only events that include a referral code (`ucc`) appear in **Events**. ### Applying discounts The new-user discount your referred users get at checkout. Applies if you offer a discount, typically freemium or trial. **Prerequisite:** a new-user discount is configured for your campaign. See [Apply discounts](/attribution/apply-discounts) and [New user discounts](/guides/user-experience/new-user-discounts). **Do this:** as the referred user from [Signup tracking](#signup-tracking), go to your upgrade or checkout page. **You should see** | Where | What good looks like | | - | - | | Your checkout | The discount is visible **before** entering card details, ideally on the pricing page | | Your checkout | The discount math is correct for **monthly** and **yearly** plans | | Your checkout | The reward to the referrer for the first month does **not** exceed what the new user pays in the first month. This is a fraud safeguard | | Developers → Events | The discounted amount comes through on the purchase event - confirm it as part of [Purchase tracking](#purchase-tracking) below | ### Purchase tracking Referred purchases reaching Cello with the right fields, so rewards can be calculated. **Prerequisite:** your **purchase source** is set (self-serve in pre-launch) and purchases are implemented for that source. > [!NOTE] > > **You can set the purchase source yourself, and change it while you're still testing.** The correct source depends on your payment provider and reward model, and the wrong source silently breaks attribution rather than failing loudly - so if you're unsure which one fits, confirm it with Cello before you build against it. See [Changing the configured source](/mcp/developers/integration-status#changing-the-configured-source) for all the factors. > [tab] Cello API > > Source: **Cello API** (`invoice-paid` events). See [Track Purchases](/attribution/tracking-purchase). > > Required fields: `ucc`, one of `newUserId` / `productUserId`, plus `invoiceId`, `interval`, and `currency`. `price` is validated when present, and the timestamp must be a valid Unix timestamp. > [tab] Stripe > > Source: **Stripe** (purchase events such as `invoice.paid` and `charge.succeeded`) via the [Stripe webhook](/integrations/webhooks/stripe-webhook). > > Required fields: `ucc` and `newUserId`. `email` is recommended, and required if you use Auto Attribution. > [tab] Chargebee > > Source: **Chargebee** (purchase events) via the [Chargebee webhook](/integrations/webhooks/chargebee-webhook). > > Required fields: `ucc` and `newUserId`. `email` is recommended, and required if you use Auto Attribution. **Do this:** with the referred user from [Signup tracking](#signup-tracking), complete a test purchase using your gateway's test card, then check your integration status and open **Developers → Events**. **You should see** | Where | What good looks like | | - | - | | Integration status | **Purchases** is **Connected**, with a recent **last attributed purchase** | | Developers → Events | The purchase event is **OK**, with every required field valid | | Developers → Events | `email` is present. Yellow **Recommended** warnings are fine unless you use Auto Attribution, where `email` is required | ## Alternative scenarios Only work through the ones that describe your setup. ### Partners only You run a partner or affiliate program with no in-app referral widget. Partners get their sharing link and see their performance in the Cello-hosted [Partner Portal](/guides/partners/partner-portal), so `cello.js` is never deployed in your product. **What still applies:** [Capturing the referral code](#capturing-the-referral-code), [Signup tracking](#signup-tracking) and [Purchase tracking](#purchase-tracking), exactly as written above. A partner's referral link is attributed the same way any referral link is. **What doesn't apply:** [Referral component](#referral-component) and [Notifications](#notifications). Both test the in-app widget, which you don't have. > [!NOTE] > > Expect **Referral component** to read **Not connected** in your integration status. The health check reports all four components every time, and with no widget deployed there are no boot events for it to see. That is correct for a partners-only setup and doesn't block your launch. **Prerequisites** * A **partner campaign** exists. You can't invite partners without one. * You've invited yourself as a test partner from **Partner Users**. See [Manage partners](/guides/partners/manage-partners). **Do this:** register from the invite email, then run a full referral through your own partner link - land on your site, sign up as a new user, and complete a test purchase. **You should see** | Where | What good looks like | | - | - | | Partner invite email | Arrives, and the registration link works | | Partner Portal | Your sharing link, the offer, and the reward details are all correct | | Partner Portal | Payout setup is reachable and offers the methods you intend partners to use | | Your landing page | The partner link lands on the right page and sets the UCC cookie | | Developers → Events | The signup and the purchase from the partner link both validate as **OK** | | Partner Portal | The test signup and purchase appear under the partner's performance. Allow an hour - this follows the dashboard refresh cycle | | Partner Portal | Any [partner resources](/guides/partners/partner-resources) you uploaded are visible to the partner | For how the program is set up end to end, see the [Partner program overview](/guides/partners/partner-overview). ### Mobile app Users can sign up directly inside your mobile app, so attribution has to work there too. See the [Mobile SDKs](/sdk/mobile/introduction). | What | What good looks like | | - | - | | Referral component | Opens, loads correct copy and rewards, and closes properly. Test iOS, Android, and React Native separately | | Signup | A signup from the app is attributed to the referrer and shows **OK** in **Events** | | Purchase | A purchase from the app is attributed and shows **OK** in **Events** | ### Organization-level attribution Your referrers are individual users, but they refer organizations or teams, so signups and purchases are attributed at the organization level. | What | What good looks like | | - | - | | UCC scope | Two users in the same org see **different** UCCs, because referral links are given to individual users, not organizations | | Event payload | Signup and purchase events carry the org id (`organizationId` / `payload.newUserId`) and the user id (`context.newUser.id`) as defined for your source | | Developers → Events | `organizationId` validates **OK** and is **not equal** to `newUserId` | ### Auto Attribution You opted into Auto Attribution instead of sending your own events. See the [Auto Attribution guide](/guides/attribution/auto-attribution). | What | What good looks like | | - | - | | Widget | After a referred signup, the widget shows the signup \~10-20 seconds later | | Developers → Events | The signup appears tagged as Auto Attribution. It won't appear in real time the way webhook events do | | Signups data | \~5-10 minutes later, the signup shows with source **AA** | ### Report-based attribution Only if you can't send events automatically. This is less reliable and higher-maintenance - prefer a webhook or the Cello API where possible. See [Report-based attribution](/guides/attribution/manual-attribution). ## Launch your program When the checks above pass, you're ready to go live. Do one last thing to your payment provider first, then launch from the **Home** page. ### Switch your payment provider to live credentials You tested against your gateway's test mode, so the webhook forwarding events to Cello is a test-mode endpoint with a test-mode signing secret. Stripe and Chargebee keep test and live as separate environments, so that webhook never fires for a real purchase - signups and purchases would silently stop being attributed the moment you go live. Add the same webhook in live mode, update the signing secret under **Developers → Webhooks**, and re-check your integration status once a real event has come through. This is about your payment provider's environment, not Cello's. Your Cello account is already production - launching only takes it out of pre-launch mode. ### Confirm the pre-launch checklist On the **Home** page, open the **Go live** card. A short **pre-launch checklist** appears confirming the essentials this testbook covers - one item per area above: * Referral widget loads and opens for signed-in users * Notifications work: badge, announcement, email * New users land on the correct page from a referral link * Signups are attributed to the referrer * The new-user discount shows correctly at checkout, if your offer includes one * Purchases are attributed to the referrer The four event-based items also report **Connected** in your integration status. Confirm them, then **Launch program**. > [!TIP] > > **Check your recommendations before you launch.** The card next to **Go live** scores a set of optional [performance enhancements](/integration-overview#performance-enhancements). A low score never blocks **Launch program**, but it is the best early signal of how the program will perform once you're live - and the ones that need code are much cheaper to fold in now, while you're still in pre-launch. > [!WARNING] > > Launching **can't be undone**. It takes your account out of pre-launch (testing) mode, so everything moves to the **Live** column of the [table above](#integrate-test-and-launch): rewards pay out, notifications reach real referrers, fraud checks run, and the payout delay applies. To test changes after launch, use a sandbox. ### After you launch Re-check your integration status periodically. It flags when an upstream change - a redeployed script, a rotated webhook secret - silently breaks a component. # Introduction Source: https://docs.cello.so/guides/introduction Your complete playbook for building and optimizing successful referral programs with Cello Welcome to the Cello Growth Guides - your comprehensive resource for maximizing the impact of your referral program. These guides are designed specifically for growth managers, marketing leaders, and customer success teams who want to turn their users into their most valuable acquisition channel. ## What You'll Find Here Our guides are organized into strategic areas that address the full lifecycle of referral program management, from initial setup to advanced optimization techniques. ### Campaign Management **Set up reward structures that drive results** * [Campaign Setup](/guides/campaigns/setting-up-campaigns) - Configure reward percentages, caps, and payout rules that motivate both referrers and new users * Master symmetric reward strategies that balance **referrer incentives** with **new user discounts** ### User Experience Optimization **Create seamless referral experiences that users love** * [Referral Component Overview](/guides/user-experience/overview) - Understand all the features available in your referral widget * [Component Configuration](/guides/user-experience/configuring-referral-component) - Customize appearance, messaging, and behavior * [Landing Page Optimization](/guides/user-experience/optimizing-landing-pages) - Design high-converting referral landing pages * [In-app and Email Notifications](/guides/user-experience/referral-notifications-and-emails) - Keep users engaged with timely updates * [Personalized Experiences](/guides/user-experience/personalizing-referrals) - Add referrer names and custom messages * [New User Discounts](/guides/user-experience/new-user-discounts) - Configure discount strategies for referred users ### Growth Best Practices **Proven strategies to increase sharing and conversions** * [Contextual Sharing](/guides/best-practices/contextual-sharing) - Prompt referrals at high-intent moments * [Behavior-Based Triggers](/guides/best-practices/behavior-based-triggers) - Automate referral prompts based on user actions * [User Activation Improvement](/guides/best-practices/improve-user-activation) - Convert more referrals into active users * [Conversion Optimization](/guides/best-practices/optimizing-signup-conversion) - Maximize signup rates from referral traffic ### Partner Program Management **Scale beyond user referrals with strategic partnerships** * [Partner Program Overview](/guides/partners/partner-overview) - Set up affiliate and influencer programs * [Partner Portal](/guides/partners/partner-portal) - Provide partners with dedicated dashboards and resources * [Partner Management](/guides/partners/manage-partners) - Invite, onboard, and manage your partner network ### Attribution & Reporting **Track performance and prove ROI** * [Auto-Attribution](/guides/attribution/auto-attribution) - Automatically track referral conversions * [CRM Integration Reports](/guides/attribution/hubspot-reports) - Connect referral data to HubSpot, Salesforce * [Payment Platform Reports](/guides/attribution/stripe-reports) - Track revenue attribution through Stripe ### Data & Integrations **Connect Cello to your growth stack** * [Integration status](/mcp/developers/integration-status) - Get a real-time health view of your integration * [Event Feed](/guides/support/portal/event-feed) - Monitor and debug your integration events ## Getting Started If you're new to Cello or referral programs: 1. **Start with [Campaign Setup](/guides/campaigns/setting-up-campaigns)** to configure your reward structure 2. **Review [User Experience Overview](/guides/user-experience/overview)** to understand the referral component features 3. **Implement [Contextual Sharing](/guides/best-practices/contextual-sharing)** strategies to increase sharing rates 4. **Set up [Attribution](/guides/attribution/auto-attribution)** to track and reward successful referrals ## Need Help? Each guide includes actionable steps and real examples from successful Cello customers. For additional support: * Contact your Customer Success team via Slack * Email [support@cello.so](mailto:support@cello.so) for technical questions * Schedule a strategy session to review your program performance > [!NOTE] > > These guides focus on growth strategy and program optimization. For technical implementation details, visit our [Developer Documentation](/referral-component/quickstart) and [API Reference](/api-reference/introduction). # Manage Partners Source: https://docs.cello.so/guides/partners/manage-partners Cello allows you to manage your partners and affiliates to provide them with a full portal experience Cello allows you to manage your partners and affiliates, providing them with a full portal experience for accessing their affiliate links, tracking referral progress, and receiving rewards for successful referrals. Inviting partners takes only a few clicks. ## Inviting New Partners to Your Program 1. Navigate to the **Partners** page in the Cello Portal and click **Add partner** in the upper right. > [!NOTE] > > If you don't see the **Partners** page, check that the **Sandbox / Production** toggle in the portal is set to **Production**. Partner pages are only visible in Production mode. If you've switched to Production and the page is still missing, contact Cello support to have the necessary permissions applied to your account. ![Partners page with the Add partner button](https://mintcdn.com/cello/LPpA77SIJOCgPpJp/guides/partners/partners-list.png?fit=max\&auto=format\&n=LPpA77SIJOCgPpJp\&q=85\&s=3941fe8cdf60c01c8cd236b240604782) 2. Enter the **Partner email** and choose the **Referral campaign** you want to assign to the partner user. **Product user ID** is optional and should be added if you want to update an existing user to partner status. ![Add a partner user form with partner email, referral campaign and Product user ID fields](https://mintcdn.com/cello/LPpA77SIJOCgPpJp/guides/partners/add-partner.png?fit=max\&auto=format\&n=LPpA77SIJOCgPpJp\&q=85\&s=24b2bfd46112f157d87fc4c66b2b3d66) > [!NOTE] > > **What is the Product User ID?** It is the unique identifier your product already assigns to that user - the same ID you pass as `productUserId` when generating the JWT token and booting the Referral Component. You can look up an existing user's ID in the **Referrer Id** column of the Referrals dashboard in the Cello Portal. > > **When to provide it:** always fill in the Product User ID when the person you're inviting as a partner is already a user in your product. This ensures their existing referral code (`ucc`) is retained through the transition, so their referral link stays the same. > > If you do not specify the Product User ID, Cello automatically creates a new identifier, and the user will end up with two separate referral links: one inside your product and one in the Cello partner portal, with split referral tracking. 3. Click **Add user**. 4. The partner user will receive a branded email invitation with instructions to register. 5. From this email, they can click a link to register quickly, either using **sign up with Google** or by providing an email and password. (Note: If a user signs up using email, they can later use Google to sign in with the same email address.) ![Partner invitation email with a Join Program button](https://mintcdn.com/cello/qtx4Sz4eACfrTKXR/guides/partners/partner-invite-email.png?fit=max\&auto=format\&n=qtx4Sz4eACfrTKXR\&q=85\&s=0dcdd6eac0124e23f015ecfb9701f8cd) # Overview Source: https://docs.cello.so/guides/partners/partner-overview Cello allows you to set up and manage all aspects of your own partner program, unifying user referrals and partners in one platform Cello allows you to set up and manage all aspects of your own partner program, unifying user referrals and partners in one platform. All partner features are offered as part of the core Cello platform without additional technical effort needed. ![Partner portal Performance page with rewards earned, signups, purchases and charts over time](https://mintcdn.com/cello/7eTCc0afkbnHBNzw/guides/partners/partner-performance.png?fit=max\&auto=format\&n=7eTCc0afkbnHBNzw\&q=85\&s=67d9cfa0c32ad2a36d0bbc4c2f6b482d) > [!NOTE] > > Cello provides support on setting up your partner program or if you have an existing program that you would like to transfer to Cello. Feel free to contact our support team via Slack to guide you through the setup. > > You can find a [walkthrough of the Partner Portal](https://www.loom.com/share/f8f5c502832b485da6ffb1186bd00d89?sid=2f71041c-ab22-4088-9c71-e19757c229d8) end-user experience here ## Steps for setup: #### 1. Integrate Cello If you are already using Cello for user referrals, there is no additional technical effort required to enable partners. If you are not yet using Cello, your teams will need to setup a [landing page for referrals](/guides/user-experience/optimizing-landing-pages) and [referral conversion tracking](/attribution/introduction) to automate rewarding. #### 2. Set Reward Structure To incentivize affiliates, influencers, and other partners to share your product, you can offer partners exclusive reward structures. Lifetime rewards and one-off compensation components increase the engagement of your partners and make the program more attractive. You can also see what other customers are doing in [this slide deck](https://pitch.com/v/partner-rewards-nk4f57) #### 3. Invite Partners The Cello [Partner Portal](/guides/partners/partner-portal) provides partners with a full experience that includes details of your program, their personal sharing link, updates on the status of their referrals and rewards. You can invite new partners to your program from the [Manage Partners](/guides/partners/manage-partners) page in the Cello portal. ## Optional steps: For an optimal partner experience, we recommend several best practices to improve performance. You can find more information [here](https://pitch.com/v/h7cf3r/99812f2e-e331-4c58-b84b-009723fc3220). **1. Create a Media Kit (Optional)** We recommend providing [media kits](https://pitch.com/v/h7cf3r/46528f51-d7b5-4e45-a94c-e4521d3b55b1) for partners on your ambassador page. Prewritten messages and branded assets make sharing frictionless for your partners and allows you to ensure brand consistency across all collaborations. **2. Create an Ambassador Landing Page (Optional)** Implementing a dedicated [ambassador landing page](https://pitch.com/v/h7cf3r/467b3ed2-b50f-4dd9-a280-e358ce2e8ea3) for your partners provides clear guidance on how they can get access to your program, what your program offers, and guidelines for collaboration. Moreover, an ambassador landing page can allow you to effortlessly collect applications from potential partners interested in joining your program. ## Transfer an existing program (optional): It's easy to transfer an existing partner program using another product or in-house tools to Cello. Once transferred your existing partners can get rewarded on Cello and use the new links to make referrals. Cello can share details and assist upon request. # Partner Portal Source: https://docs.cello.so/guides/partners/partner-portal The partner portal provides full portal experience for accessing their affiliate link, tracking progress on referrals, and getting rewarded for successful referrals The partner portal gives partners their affiliate link, tracking for their referrals, and a place to get paid for successful referrals. Inviting partners only takes a few clicks ([Manage partners](/guides/partners/manage-partners)). ## Sharing Partners find their link and the offer for new users in the **Share kit** on **Home**. ![Share kit on the partner portal Home with the partner's link and offer](https://mintcdn.com/cello/7eTCc0afkbnHBNzw/guides/partners/partner-share-kit.png?fit=max\&auto=format\&n=7eTCc0afkbnHBNzw\&q=85\&s=d29a2709eccc5a448b74a717f5280444) **Resources** holds the materials you've added for partners ([Partner resources](/guides/partners/partner-resources)). ## Getting Rewarded Partners add or update their payout details from **Manage payouts** on **Home**. ## Partner Analytics **Performance** shows partners how their referrals are doing, with tabs for **Rewards**, **New user signups** and **New user purchases**. ![Partner Performance page with rewards earned, signups, purchases and charts over time](https://mintcdn.com/cello/7eTCc0afkbnHBNzw/guides/partners/partner-performance.png?fit=max\&auto=format\&n=7eTCc0afkbnHBNzw\&q=85\&s=67d9cfa0c32ad2a36d0bbc4c2f6b482d) # Partner Resources Source: https://docs.cello.so/guides/partners/partner-resources This guide is designed to help Partner Managers effectively use the Partner Resources feature to add, manage, and share guides and resources with partners This guide is designed to help Partner Managers effectively use the Partner Resources feature to add, manage, and share guides and resources with partners. ![Partners page with the Resources tab and the Add partner resource button](https://mintcdn.com/cello/LPpA77SIJOCgPpJp/guides/partners/resources-admin.png?fit=max\&auto=format\&n=LPpA77SIJOCgPpJp\&q=85\&s=cacf50af9e25ce0b290171d4125804a5) The **Resources** tab on the **Partners** page is a dedicated space for creating and managing guides and content that can be shared with your partners. It allows you to: 1. Add new guides with detailed descriptions and cover images. 2. Organize resources for easy partner access. 3. Provide links to videos, articles, or pages to help partners promote your products or services. ### Adding a New Guide ![Create partner resource form with title, description, link and cover image](https://mintcdn.com/cello/LPpA77SIJOCgPpJp/guides/partners/resources-add.png?fit=max\&auto=format\&n=LPpA77SIJOCgPpJp\&q=85\&s=dbfbcb2063d455ca0caf61687502715d) If no resources are added yet, you'll see a placeholder message encouraging you to create your first guide. 1. **Click the "Add partner resource" Button**: * Located at the top right of the **Resources** tab. 2. **Fill Out the Form**: * **Title**: Enter a clear and concise title for the guide. * **Description**: Provide a brief description of the guide's purpose (up to 300 characters). * **Link**: Add a URL to direct partners to the guide's content, such as a video, article, or webpage. * **Add cover image**: Upload an image to visually represent the guide. Drag and drop a file or browse files from your machine. 3. **Save the Guide**: * Click **Add partner resource** to save the guide. 💡 **Once added, guide is instantly visible for your partners.** ![Resources page in the partner portal, as partners see it](https://mintcdn.com/cello/7eTCc0afkbnHBNzw/guides/partners/resources-partner-view.png?fit=max\&auto=format\&n=7eTCc0afkbnHBNzw\&q=85\&s=c13f455941ba24649c908f9795d786a1) ### Managing Existing Guides Once guides are added, they appear as individual cards on the **Resources** tab. Each card includes: 1. **Title and Description**: A quick summary of the guide. 2. **Actions**: * Open the **···** menu on a card and choose **Edit** to update the guide's details, or **Delete resource** to remove it. 3. **View resource**: * Partners click a card to open it, then **View resource** to go to the linked content. ## Best Practices for Creating Guides 1. **Use Descriptive Titles and Images**: * Ensure titles are specific and relevant to the guide's content. * Upload visually appealing and professional cover images to attract attention. 2. **Organize by Purpose**: * Group guides by themes, such as "Overview," "Sharing Tips," or "Content Creation Examples," for easier navigation. 3. **Test Links**: * Verify that all links lead to the correct resource and are accessible to partners. ## Example Use Cases ### Case 1: Sharing Partner Links Create a guide titled **"Overview"** with a description like: "Share your partner link with contacts and followers." Include a video tutorial link to help partners understand how to use their referral links. ### Case 2: Promoting Your Product Add a guide titled **"Share"** with instructions on promoting your product. Link to an article that offers best practices for sharing content on social media. ### Case 3: Content Creation Support Provide a guide titled **"Content"** with social media post templates and examples. Link to a page where partners can download assets or view tips. ## Frequently Asked Questions (FAQs) ### Q: Can I reorder the guides? A: Currently, guides are displayed in the order they were added. You may delete and recreate guides to adjust the sequence if necessary. ### Q: What file formats are supported for cover images? A: Common image formats like JPG, PNG, and GIF are supported. ### Q: How do I ensure partners can access the links? A: Use publicly accessible links or grant appropriate permissions to ensure partners can view the resources. *** # Support FAQ Source: https://docs.cello.so/guides/support/faqs Frequently asked questions about integrating, running, and troubleshooting Cello ## Partners & affiliate programs > [accordion] How do I view affiliate stats in the Cello portal? > > Switch to the **Partner Campaign** in the upper-right of the Cello portal. Your dashboard will filter to display the affiliate/partner program numbers. Note: ensure you have the toggle in the upper-left toggled to production. > [accordion] How can I provide marketing materials for the affiliates to use? > > See [Partner resources](/guides/partners/partner-resources). > [accordion] Can we automatically add partners/affiliates via API sync? > > Partners and affiliates are added via the [Cello Portal](https://app.cello.so/partners/users). There is no API endpoint for bulk partner creation today. > > For complex migrations or large partner onboarding, Cello works directly with customers to handle bulk imports. Contact your CSM to coordinate. > [accordion] Is coupon-code-only tracking supported (without an affiliate link)? > > Cello's attribution is link-based - referral links with a `ucc` parameter are the supported tracking method. Standalone coupon-code tracking (where a code is shared and attributed at checkout without a referral link) is not available today. > > If your referrers promote through channels where links aren't practical (podcasts, video, print), consider using a short, memorable referral URL instead. If coupon-code-only tracking is important for your program, share the use case with your CSM. > [accordion] What is the Product User ID when adding a partner, and where do I find it? > > The **Product User ID** is the unique identifier your product already assigns to that user - the same value you pass as `productUserId` when generating the JWT token and booting the Referral Component. It is not a Cello-generated ID. > > To look up an existing user's ID: go to the **Referrals** dashboard in the Cello Portal. The **Referrer Id** column shows the `productUserId` for each referrer. > > You should provide the Product User ID whenever the person you're inviting as a partner is already a user in your product. This links their new partner identity to their existing referrer identity, so their referral link (`ucc`) stays the same and their referral tracking remains unified. If you skip it, Cello creates a new identity and the user ends up with two separate referral links. > [accordion] When I upgrade a user referrer to a partner, do they keep the same referral link? > > In general, Cello is designed to be seamless across **user referrals** and **partner/affiliate referrals**: > > * Users access Cello via the in-product Referral Component. > * Partners can access a separate Cello partner portal, and can also use the in-product Referral Component. > * The same campaign code can be shared across your product and the partner portal. To do so: when adding the partner in the Cello admin portal, ensure the partner is mapped using their `productUserId` so they retain the same UCC/link across your product and the Cello partner portal. > [accordion] When upgrading a referrer to a partner, does historical performance carry over? > > If the partner is mapped correctly to the existing user via `productUserId`, the intent is for the partner to retain their current UCC and associated performance history across your product and the Cello partner portal. > [accordion] When upgrading a referrer to a partner, do commissions change retroactively? > > No. When a referrer is upgraded to a partner campaign, existing signups keep the reward terms from the campaign that was active when they signed up. Only new signups after the upgrade use the new campaign’s reward structure. This grandfathering is handled automatically. > [accordion] Do we need to remove the referral widget when someone becomes a partner? > > No. Partners can still use the Cello widget to access their referral link and rewards experience. > [accordion] I don't see the Partner Users or Partner Resources pages in the Cello portal > > The partner pages are only visible in **Production** mode. Check the **Sandbox / Production** toggle in the upper left of the portal and make sure it is set to **Production**. If the pages are still not visible after switching, contact Cello support to have the necessary permissions enabled on your account. ## Attribution & cookies > [accordion] What is attribution? > > Attribution is the process of tracking and linking new user signups and purchases back to the referrer who originally shared the referral link. It ensures referrers are correctly rewarded and that your referral analytics stay accurate. > > Cello's attribution works in four steps: > > 1. **Referral link sharing** - referrers share links containing a unique referral code (`ucc` parameter) > 2. **Landing page capture** - your website or app captures and stores the `ucc` as a first-party cookie > 3. **Signup tracking** - new user registrations are linked to their referrer via the stored `ucc` > 4. **Purchase tracking** - revenue events are attributed back to the original referrer > > Attribution is available for both web and mobile signup flows. For mobile apps, the referral code is passed through deep-link attribution providers (e.g., Branch.io, AppsFlyer) so it persists through app store redirects and installation. > > **Related docs** > > * [Attribution introduction](/attribution/introduction) > * [Web attribution](/attribution/for-web) > * [Mobile attribution](/attribution/for-mobile) > [accordion] Why is the Attribution Library required? > > The Attribution Library ([Attribution JS](/sdk/client-side/attribution-js-introduction)) is a lightweight JavaScript library that captures the referral code (`ucc`) from referral links and stores it as a first-party cookie. This cookie persists for 3 months, which is critical because users often don’t sign up immediately - they may click a referral link, browse your site, leave, and return days later before converting. > > Without the library, the `ucc` parameter would be lost as soon as the user navigates away from the landing page URL, breaking attribution for these indirect signups. > > Beyond persistence, the library also provides APIs to: > > * **Retrieve the referral code** - `getUcc()` for passing into signup and purchase events > * **Get the referrer’s name** - `getReferrerName()` for personalizing landing pages > * **Access campaign config** - `getCampaignConfig()` for displaying referral discounts > * **Manage cookie consent** - built-in methods for privacy compliance > > You can install it via an [embedded script tag](/sdk/client-side/embedded-script-tag) or [Google Tag Manager](/sdk/client-side/google-tag-manager). > > **Related docs** > > * [Attribution JS introduction](/sdk/client-side/attribution-js-introduction) > * [Web attribution](/attribution/for-web) > [accordion] Do I need the attribution library if I only want cookies stored? > > You could technically store the `ucc` as a cookie yourself, but the Attribution Library ([Attribution JS](/sdk/client-side/attribution-js-introduction)) does significantly more than cookie storage: > > * **Automatic form injection** - the library auto-injects a hidden `ucc` field into signup forms, so attribution works without custom form logic > * **API access** - provides `getUcc()`, `getReferrerName()`, and `getCampaignConfig()` methods for programmatic access to referral data, referrer personalization, and discount display > * **Fraud detection signals** - the script collects telemetry that feeds into Cello's [fraud and self-referral detection](/guides/fraud-detection), which is not possible with a plain cookie > * **Cross-session persistence** - stores the `ucc` as a first-party cookie with a 3-month lifetime, handling delayed and indirect signups automatically > > Skipping the library means you would need to manually parse the `ucc` from the URL, store it, inject it into forms, and lose fraud detection capabilities. For most integrations, using the library is the simpler and more reliable path. > > **Related docs** > > * [Attribution JS introduction](/sdk/client-side/attribution-js-introduction) > * [Attribution JS usage & API](/sdk/client-side/attribution-js-usage) > [accordion] Is the cookie with the Cello UCC available across pages/subdomains? > > Yes. The Attribution Library stores the referral code in first-party cookies (`cello-referral` and `cello-productId`) that are scoped to your root domain. This means: > > * **Across pages** - the cookies are available on every page of your site, as long as the attribution script is installed on each page (recommended in the `` tag site-wide) > * **Across subdomains** - the cookies work across subdomains of the same root domain (e.g., `www.example.com` and `app.example.com`). Cross-subdomain attribution is supported natively > > The cookies persist for 3 months, so they survive across sessions and return visits. > > Note: cookies are **not** shared across different root domains (e.g., `example.net` and `example.app`). If your landing page and product use different root domains, see the FAQ below on cross-domain strategies. > > **Related docs** > > * [Manage cookie consent](/landing-pages/manage-cookies) > * [Attribution JS introduction](/sdk/client-side/attribution-js-introduction) > [accordion] We have different root domains for landing vs product. Will attribution work? > > The Attribution Library stores the `ucc` in a first-party cookie scoped to the root domain where it was set. This means the cookie set on `example.net` is **not** automatically available on `example.app` - browsers enforce this as a security boundary. > > If your landing page and product use different root domains, here are your options (in order of preference): > > 1. **Use the same root domain** (recommended) - host your landing page on a subdomain of your product domain (e.g., `www.example.app` for landing, `app.example.app` for the product). This makes attribution seamless with no extra work, since cookies are shared across subdomains of the same root domain. > > 2. **Persist the `ucc` in URLs across domains** - install the Attribution Library on both domains and ensure all links between them append the `?ucc={ucc}` parameter. This way the `ucc` is recaptured by the Attribution Library when the user arrives on the second domain. > > 3. **Build a custom cross-domain bridge** - implement server-side logic to store and forward the `ucc` when users transition between domains (e.g., pass it through your authentication or redirect flow so it’s available on the product domain at signup time). > > **Related docs** > > * [Web attribution setup](/attribution/for-web) > * [Attribution JS introduction](/sdk/client-side/attribution-js-introduction) > [accordion] Does Cello integrate with cookie consent management platforms (OneTrust, CookieBot, etc.)? > > Yes. Cello's Attribution Library supports integration with cookie consent management platforms so that referral cookies are only stored after the user grants consent. > > **Supported platforms:** > > * **OneTrust** - fully supported. Cello enables the integration on their side; no setup required from you > * **CookieFirst** - coming soon > * **CookieBot** - coming soon > * **Civic Cookie Control** - coming soon > > If your consent platform isn't listed above, you can use the **custom consent method** via the Attribution JS API: > > ```javascript theme={null} > // After user grants consent > window.CelloAttribution('allowCookies'); > > // If user withdraws consent > window.CelloAttribution('deleteCookies'); > ``` > > This gives you full control to integrate Cello's cookie handling with any consent management platform or custom consent flow. > > **Related docs** > > * [Manage cookie consent](/landing-pages/manage-cookies) > * [Attribution JS introduction](/sdk/client-side/attribution-js-introduction) > [accordion] What is direct vs indirect signups? > > * **Direct signup**: user clicks a referral link and signs up immediately. > * **Indirect signup**: user clicks a referral link, navigates around, and signs up later from a different page. > > For both, ensure attribution rules are followed so the referrer’s UCC is tracked and rewards are correctly attributed. > [accordion] Can we track purchases without requiring a prior signup event? > > Yes, but Cello still needs to know *who* the referred user is before attributing a purchase. If you skip the standard signup flow, you'll need to send a `new-signup` or `sign_in` event via the [Cello API](/attribution/tracking-signups) before sending `invoice-paid` events - otherwise the purchase has no user to attribute to. > > A common use case is **existing-user attribution**, where a current user clicks a referral link and you want to credit the referrer for their next purchase. The recommended approach: > > 1. **Check for a `ucc` on login** - not just on signup. Use `getUcc()` from the Attribution Library or read the `ucc` URL parameter directly. > 2. **Validate the `ucc`** - call Cello’s [Referral Codes API](/api-reference/referral-codes/fetch-referral-code-info) to confirm the code is valid and identify the referrer. > 3. **Prevent self-attribution** - compare the referrer’s `productUserId` with the logged-in user’s ID. If they match, ignore the `ucc`. > 4. **Store the `ucc`** - save it in your database linked to the user, so it’s available when sending events. > 5. **Send events to Cello** - send a `sign_in` event (to establish the attribution) followed by `invoice-paid` events as purchases occur. > > **Related docs** > > * [Track signups](/attribution/tracking-signups) > * [Track purchases](/attribution/tracking-purchase) > * [Fetch referral code info](/api-reference/referral-codes/fetch-referral-code-info) > [accordion] How do I manually backfill attribution for a missed signup or purchase? > > If a referral wasn’t automatically attributed - due to a technical issue, missing metadata, or a user dispute - you can manually backfill it. The exact steps depend on your integration type: > > **For Stripe or Chargebee webhook integrations:** > > 1. Get the referrer’s `cello_ucc` from the [Cello Portal](https://app.cello.so) and the new user’s `new_user_id` from your system. > 2. Add `cello_ucc` and `new_user_id` to the new user’s customer metadata in Stripe or Chargebee. > 3. Cello will receive a `customer.updated` (Stripe) or `customer_changed` (Chargebee) event automatically. > 4. If past invoices were already paid, resend the `invoice.paid` (Stripe) or `payment_succeeded` (Chargebee) events from within your payment platform’s dashboard. > > **For Cello API integrations:** > > 1. Get the referrer’s `cello_ucc` and the new user’s ID. > 2. Resend the signup event via the [POST /events API](/api-reference/generic-events/send-event). > 3. Resend any past transaction events via the same API. > > If events cannot be resent via API, Cello Support can accept manual reports - contact [support@cello.so](mailto:support@cello.so) for report templates. > > **Related docs** > > * [Manual Attribution guide](/guides/attribution/manual-attribution) > * [Track purchases](/attribution/tracking-purchase) > * [Stripe webhook](/integrations/webhooks/stripe-webhook) > * [Chargebee webhook](/integrations/webhooks/chargebee-webhook) > [accordion] My flow is purchase first, signup later. Does that work? > > Yes, this is a supported pattern. Cello can handle flows where the payment gateway customer is created at checkout (purchase) rather than at signup, as long as the referral metadata is attached within 7 days of the purchase. > > **How it works with Stripe:** > > 1. User clicks a referral link and the `ucc` is captured by the Attribution Library. > 2. User completes a Stripe Checkout session, which creates a Stripe customer. > 3. After the checkout session completes, update the Stripe customer with `cello_ucc` and `new_user_id` metadata via `customer.update`. > 4. Cello receives the `customer.updated` event and uses it to establish the attribution. > 5. Even if the first `invoice.paid` event arrived before the metadata was added, Cello will retroactively attribute it once the customer is updated. > > **How it works with Chargebee:** > Follow the same pattern - add `cello_ucc` and `new_user_id` to the Chargebee customer metadata after checkout. Cello will receive the `customer_changed` event. > > **How it works with Cello API:** > If your payment gateway is Paddle, Recurly, or another provider, use the [POST /events API](/api-reference/generic-events/send-event) to send a `new-signup` event after the customer is created at purchase. > > **Related docs** > > * [Track signups - Option 3: customer created at purchase](/attribution/tracking-signups#option-3-using-cello-api-post-events-api-endpoint) > * [Stripe webhook](/integrations/webhooks/stripe-webhook) > * [Chargebee webhook](/integrations/webhooks/chargebee-webhook) ## Stripe / Chargebee events & webhooks > [accordion] How can I verify that my events are being received and processed correctly? > > Verify events from two complementary angles: > > * **[Integration health check](/mcp/developers/integration-status)** (the `cello_get_integration_status` tool on the Cello MCP server) gives you a high-level health check across the four core components: Referral component, Attribution library, Signups tracking, and Purchases tracking. Use it to answer "is everything working?". > * **[Developers → Events](https://app.cello.so/developers/events)** shows every incoming event from all sources - Stripe Webhook, Chargebee Webhook, Cello API, and Auto Attribution - with per-field validation. Use it to answer "why did this specific event fail?". > > Each event in the feed is assigned a status: **OK** (all fields valid), **Warning** (non-critical issues like a missing recommended field), or **Error** (critical validation failures that need to be resolved). Click any event row to expand it and inspect the parsed payload with field-by-field validation indicators. > > **Related docs** > > * [Integration status](/mcp/developers/integration-status) > * [Event Feed guide](/guides/support/portal/event-feed) > [accordion] Which signup/purchase source should we pick? > > You can set your signup and purchase sources yourself, and change them while you're still testing. There is no one-size-fits-all source: the correct one depends on factors unique to each integration, and an incorrect source silently breaks attribution rather than failing loudly. If you are unsure which one fits, confirm it with your Customer Success Manager or [support@cello.so](mailto:support@cello.so) before you build against it. > > The factors that decide the source: > > * **Payment provider.** Stripe and Chargebee can use webhooks. Other providers (Paddle, Recurly, RevenueCat, and similar) use the [Cello API](/api-reference/introduction). > * **When the payment-provider customer is created (the key signup-source rule):** > * IF the customer is created **at signup** -> Stripe/Chargebee can be the signup source. > * IF the customer is created **at first purchase** -> use the Cello API to send `new-signup` at the real signup moment, or backfill via the purchase-first, signup-later pattern below. Stripe/Chargebee cannot be the signup source on their own in this case. > * **Reward model.** Recurring vs one-time rewards, free-to-paid conversion, renewals, and refunds. > * **Motion.** Self-serve vs sales-led (e.g. [Salesforce](/integrations/salesforce-apex-triggers)). > * **Auto Attribution.** Can be primary or fallback, and is enabled by Cello only. > > **Related docs** > > * [Changing the configured source](/mcp/developers/integration-status#changing-the-configured-source) > * See also the "My flow is purchase first, signup later" FAQ under **Attribution & cookies** above > [accordion] Do we really need many Stripe events? Would invoice.paid be enough? > > The core events are **customer.created**, **customer.updated**, and **invoice.paid**. Additional events matter for edge cases: **subscription.created** is used when you reward on free-to-paid conversion (e.g. fixed reward per conversion), because invoice.paid can be missing in some flows. **charge.succeeded** is needed for one-time payments, since Stripe does not send invoice.paid for those. Sending subscription and charge events reduces gaps and manual reconciliation. > > **Related docs** > > * [Track signups](/attribution/tracking-signups) > * [Stripe webhook](/integrations/webhooks/stripe-webhook) > [accordion] What are subscription events used for? > > * **created**: detect signups, free-to-paid conversion, and capture subscription details > * **updated**: same as **created**; they additionally detect plan/seat changes, downgrades, expansions, churn > * **deleted** (or **canceled**): detect churn for paid subscriptions > [accordion] Why send subscription events if we already send invoice.paid? > > Subscription events help when invoice flows and subscription state diverge (e.g. pricing changes, discounts, failed payments). They improve reconciliation and reward accuracy. > [accordion] What is invoice.paid used for? > > It is usually the main “payment received” signal: it drives recurring payouts, reward calculation, referral ARR calculation. If a payment fails, you may get subscription events without invoice.paid. For one-time or fixed-amount transactions, invoice.paid may still be the primary event depending on your setup. > [accordion] What is customer.created / customer.updated used for? > > * **customer.created**: typically used as the signup signal when the customer is created at signup > * **customer.updated**: used when you add or change attribution metadata (e.g. `cello_ucc`, `new_user_id`) after the customer already exists (e.g. at first purchase) > [accordion] What is charge.succeeded used for? > > It indicates a payment. For subscriptions, invoice.paid is usually preferred for interval logic. For **one-time payments**, Stripe does not send invoice.paid, so charge.succeeded (or equivalent) is what Cello uses. > [accordion] What is charge.refunded used for? > > It signals refunds/cancellations so Cello can correct attribution and reward outcomes (e.g. cancel or adjust pending rewards). > [accordion] What events do we need if we use Cello API only? > > * Send signup events via API. > * Send at least purchase events (e.g. invoice-paid equivalent) via the Cello API. > * Include amount (in **cents**), currency, and payment frequency (monthly vs annual) where applicable. > * Send renewal purchase events for continuous rewarding and referral ARR computation. > > **Related docs** > > * [API reference](/api-reference/introduction) > * [Track signups](/attribution/tracking-signups) > * [Track purchases](/attribution/tracking-purchase) > [accordion] What events do we need if we use Stripe or Chargebee webhooks only? > > Connect the Stripe or Chargebee webhooks, add `cello_ucc` and `new_user_id` to the **customer object** (on customer.created or customer.updated, depending on when you create the customer). That customer update is the signup signal; subscription and invoice events are then used automatically for rewards. > > **Related docs** > > * [Track signups](/attribution/tracking-signups) > * [Stripe webhook](/integrations/webhooks/stripe-webhook) > * [Chargebee webhook](/integrations/webhooks/chargebee-webhook) > [accordion] What if we use a payment provider other than Stripe/Chargebee? > > Use the **Cello API** from your backend to send conversion events (signups and purchases). You keep full control over which events are sent. First time purchases and renewals have to be shared as purchase events. > > **Related docs** > > * [Integration overview](/integration-overview) > * [API reference](/api-reference/introduction) > [accordion] Which user ID should we send as new_user_id / productUserId? > > Send the **new user (referee)** ID. The referrer is identified via the UCC in the referral link; the referee is identified by this ID. > [accordion] Will connecting Stripe webhooks affect our payment architecture? > > No. Cello only **listens** to webhook events. Your payment flow and architecture stay unchanged. > [accordion] Are accessKeyId and productId the same thing? > > In the **Stripe webhook** context they are used interchangeably. Everywhere else (API, portal, docs) the product identifier is referred to as **productId**. > [accordion] Reward amount is less than expected. What could be wrong? > > Check that amounts are sent in **cents** (or smallest currency unit). For example, 100 USD should be **10000**. If you send 100, Cello treats it as 1.00 USD. > [accordion] Stripe can’t send webhook events to our server. What should we check? > > Verify that the **Webhooks** section of the Cello Portal is populated with the correct Stripe signing secret. Without it, events will fail to authenticate. Ensure the signing secret matches the environment (staging vs prod). In a next step verify in your **Stripe dashboard** if the webhook url is correct and active. In the webhook event feed in Stripe's dashboard you can check if an event resulted in an error. You can also check [Developers → Events](https://app.cello.so/developers/events) in the Cello Portal to see if events are arriving. > [accordion] What events are needed when using Cello API plus Stripe or Chargebee webhooks? > > * Send `new-signup` events via the Cello API. > * Connect Stripe or Chargebee webhooks. > * Add `cello_ucc` and `new_user_id` to the **customer object** (on `customer.created` or `customer.updated`). > * Subscription and invoice events are detected automatically once the above is triggered - no need to add `cello_ucc` and `new_user_id` to subscription or transaction events. > [accordion] Is there deduplication for invoice-paid events (e.g. by invoiceId) when using Cello API? > > There is no fully automated deduplication (similar to idempotency rules) yet. However, Cello has simple deduplication logic based on `new_user_id` + time difference + `invoiceId` (if provided). > > * The current time-difference threshold for detecting duplicate `invoice-paid` events is **one minute**. > * Flagged events go through manual review, and the threshold is adjusted if there are too many false positives. > * There are scenarios where a customer can buy multiple subscriptions within a minute, so the threshold is kept conservative. > * If you can send an `invoiceId`, this significantly improves deduplication accuracy since it becomes the primary identifier for detecting duplicates. ## Rewards, payouts, taxes & billing > [accordion] What payout methods are supported (besides PayPal/Venmo)? > > Currently, payouts are primarily via **PayPal** (and **Venmo** for the US on request). Bank transfer/SEPA are not offered today. > [accordion] How does Cello invoicing work? > > Most customers receive two separate invoices: one for the Platform Fee and one for the Advertising Fee, issued as part of Cello's Advertising Services. Invoices are typically issued monthly, though frequency and timing may vary based on your specific arrangement. For questions about your invoicing setup, contact your Cello representative. > [accordion] When will we receive invoices? > > Invoices are routinely sent around the middle of the month. Timing may differ based on your agreement or customer setup; your Cello contact can confirm the schedule that applies to you. > [accordion] How should we handle refunds and reward clawbacks? > > Cello campaign rules are designed to mitigate refund risk. Rewards are spaced and delayed so that during the delay period no payment is made, and when a subscription is refunded or canceled, future payouts can be automatically stopped. Programs set up with the recommended delay and spacing significantly reduce the risk of incorrect payouts. > > If you believe rewards have been incorrectly issued, contact Cello support to discuss your options. > [accordion] How do we apply the referee discount if we don’t use the Cello↔Stripe discount integration? > > Referee discounts are usually implemented on your side. Many customers use Stripe discounts/coupons for this. > > **Related docs** > > * [New user discounts](/guides/user-experience/new-user-discounts) > [accordion] If a referrer churns from our product, do their rewards stop? > > Referral rewards are tied to the referred customer's activity, not the referrer's subscription status. If a referrer is no longer a user of your product, they can continue to access their referral dashboard and claim rewards through the Cello portal, provided they have access to the email address they used to register for rewards. > [accordion] What happens if a referee cancels and later resubscribes? Does the referrer keep earning? > > If the payment record is the same and the UCC metadata is preserved, rewarding can continue. One-time bonus rewards typically do not repeat. > [accordion] What happens when a referred user cancels an annual subscription? > > If rewards are recurring percentage-based, the monthly reward typically stops when the subscription stops. > [accordion] If a customer prepays annually, is the reward paid on the full year or prorated? > > By default, rewards are prorated with the referrer reward spread over the payment period rather than paid on the full year upfront. Spaced rewards reduce risk and the need to introduce long payout delays, while also driving better referrer engagement through regular, recurring payouts. Some customers opt for front-loading, but this is generally not recommended as it reduces these benefits. > [accordion] Can we cap rewards by time instead of total reward amount? > > Cello's campaign design favors capping based on reward amounts rather than time horizons. User research across referral programs has shown that time-based caps are less well received by referrers and can reduce sharing rates. > > If you have a specific requirement around time-based caps, discuss it with your CSM to explore what configuration options are available. > [accordion] What currencies are supported for campaigns? > > Cello supports multiple currencies for setting a campaign’s primary currency (configured in the portal). > [accordion] What currencies are supported for reward payouts? > > Rewards are typically paid in the local currency supported by the referrer’s PayPal/Venmo account. Additional payout methods may be added in the future. > [accordion] What happens for users from unsupported payout countries? How should we handle them? > > Users from countries not on the [supported payout list](/guides/user-experience/overview#reward-countries-and-payout-methods) (e.g. Mexico, Argentina) will not be able to set up a payout method - their country won't appear in the payout country dropdown. This is due to PayPal-side restrictions and compliance, tax, or regulatory rules. Cello cannot issue payouts to unsupported countries. > > **Two approaches:** > > 1. **Hide the widget for unsupported countries** - pass `productUserCountryCode` in `cello.boot()`. If the country is unsupported, the component won't be shown to that user, preventing a confusing experience where they can share and earn but not receive payouts. > > 2. **Show the widget to everyone** - simpler to implement. Users in unsupported countries can still share and earn, but won't be able to complete payout setup. This avoids incorrectly hiding the widget from users who might actually be eligible. > > **Why the hide approach is imperfect:** `productUserCountryCode` reflects the country in your system, which may differ from the user's actual PayPal payout country. Three scenarios: > > * Product country unsupported, payout country also unsupported → hiding works correctly. > * Product country supported, payout country unsupported → user sees the widget and can share/earn, but can't receive payouts. No way to prevent this upfront. > * Product country unsupported, payout country supported → worst case: user is incorrectly hidden even though they could use Cello and receive payouts. > > The right choice depends on how accurately your system reflects your users' actual locations. > > **Edge case - PayPal account country vs. physical location:** A user may live in an unsupported country (e.g. Argentina) but hold a PayPal account registered in a supported country (e.g. Brazil). They should enter the address matching their PayPal account's registered country in the widget. Cello cannot issue payouts to unsupported countries regardless of physical location. > [accordion] Can we restrict payment countries shown to referrers (e.g. US only)? > > The country list shown to referrers during payout setup is not restricted because referrers and partners can earn rewards from any country they participate in. Restricting the list could prevent eligible referrers from setting up their payout details and receiving rewards. > > If you need to limit who can participate in your referral program, you can control eligibility on your side by restricting which users see the Referral Component (e.g., only booting the Cello SDK for users in eligible regions). > [accordion] Rewards earned shows \$0 in the widget. When does that update? > > The “Rewards earned” indicator reflects how much has been **credited to a PayPal account**. Until a referrer enters valid PayPal credentials, it will show \$0. Attributed rewards still accumulate in the rewards list below. > [accordion] Can end users see a dashboard of their referrals and rewards? > > Referrers can see link views, signup history, and reward history in the **rewards tab** inside the referral widget. > > For a more detailed dashboard, the Partner add-on provides a unified view of user referrals and affiliate programs on a single platform - with no extra technical setup required. > [accordion] Successful referrals are missing from the customer view. What should I check? > > Referral activity should be visible in the Cello Portal dashboards. If data is missing, check the following: > > * Run an [integration health check](/mcp/developers/integration-status) and confirm the relevant tracking component (Signups or Purchases) is **Connected**. If it shows **Connected with warnings** or **Not connected**, that's where the problem is. > * Check [Developers → Events](https://app.cello.so/developers/events) to verify events are arriving with the correct field values and passing validation > * Verify that signup and purchase events are being sent correctly and contain the expected `cello_ucc` and `new_user_id` values > * Confirm that the `productUserId` is consistent - if the same user signs up via different channels with different IDs, attribution may not match > * Check whether there have been any recent code changes that could affect how events are sent to Cello > [accordion] Do referrers handle taxes themselves? Do we need to explain tax implications? > > Referrers are responsible for determining and complying with their own tax obligations. Cello may provide general informational materials and, where applicable, payout statements, credit notes, or similar documentation relating to rewards paid through the platform. Such information and documentation are provided for informational and record-keeping purposes only, are not exhaustive, and do not constitute tax, legal, or financial advice. > [accordion] When exactly are invoices generated, and how do cancellations affect them? > > An invoice may be triggered within the first **3-5 days** after the close of the previous month. For cancellations, the corresponding credit-note rewards are triggered **14 days later**, which means they appear on the following month’s invoice. > > Note: this adjustment only applies to the invoice covering rewards that Cello pays to referrers on your behalf - not to the platform/subscription fee invoice. > [accordion] When referrers add their payment details, when exactly is the reward applied? > > Cello rewards users on a daily basis, barring any additional reward-delay policy you have configured for your program. Because rewarding runs daily, it typically takes only a few days for referrers to receive their reward (assuming they add their payment details promptly). > [accordion] Is the payout always in USD, or can it be in EUR/GBP based on the referrer's preference? > > * Cello allows you to select only **one default currency** for your rewards (configured in the Campaigns tab). > * Cello covers transfer and transaction fees, including currency conversion from the subscription event currency back to your nominated default currency. > * Referrers receive rewards in their PayPal account in your default currency. If they convert to a different currency (e.g. their local one), the exchange rate depends on PayPal's currency exchange and may include additional PayPal fees. > [accordion] I want to move my referrers to a higher revshare or reward, or move a user-led referrer to a higher partner campaign plan > > Grandfathering of the prior campaign when a referrer moves to a new one is handled automatically. > > When a referee signs up through a referral link, the campaign rate at the time of signup is locked in for that referral. If you later move the referrer to a new campaign: > > * **Existing signups** keep the reward structure from the campaign that was active when they signed up > * **New signups** (after the move) use the new campaign's reward structure > > For major campaign updates, coordinate with the Cello team to ensure the transition is configured correctly for your program. > [accordion] I want to move a referrer from one Partner Campaign to another > > Moving a referrer between Partner Campaigns is handled automatically. The referrer keeps the same referral link, and: > > * **Existing signups** retain the reward terms from the original campaign > * **New signups** (after the move) use the new campaign's reward structure > > No data migration or new referral links are required. For major campaign updates, coordinate with the Cello team to ensure the transition is configured correctly for your program. > [accordion] Can we implement a reward cap based on a time threshold AND/OR an amount ceiling? > > Cello's campaign design favors capping based on reward amounts rather than time horizons. User research across referral programs has shown that time-based caps are less well received by referrers and can reduce sharing rates. > > If you have a specific requirement around time-based caps, discuss it with your CSM to explore what configuration options are available. ## Notifications & emails > [accordion] If a referrer earns a reward but hasn’t set up payout details, will they be prompted? > > Yes. Referrers will see an in-product notification prompting them to add payout details. If emails are enabled, they may also receive an email. > > If a reward payment has not been received by one of your users, check that they have added payment details. Verify that account details, country, and other mandatory fields are filled out in the correct format. > [accordion] Can Cello provide sample email notifications? > > All notification templates can be reviewed in the [Cello Portal](https://app.cello.so/user-experience/emails). > [accordion] Can email templates be customized? > > Yes - you can customize email templates self-serve directly in the [Cello Portal](https://app.cello.so/user-experience/emails). Open any email notification row to bring up the preview panel. Editable elements are highlighted on hover - click to change them. > > The following can be customized: > > * **Logo** - upload your company logo > * **Presentation image** - upload a hero image shown prominently in the email body > * **CTA link** - set the URL for the main call-to-action button > > The **Welcome email** has one additional option: a second CTA link, letting you point new users to a specific page alongside the referral program link. > > Changes apply across all email types at once. See [Email template customization](/guides/user-experience/referral-notifications-and-emails#email-template-customization) for full details. > > For changes to email body copy or wording, contact your Customer Success Manager. > [accordion] How do I change the logo or image in my emails? > > Go to **Emails** in the [Cello Portal](https://app.cello.so/user-experience/emails) and click any email row to open the preview panel. Hover over the logo or image - a prompt will appear to click and replace it. Your changes apply across all email types automatically. > [accordion] When are welcome emails triggered? > > Welcome emails are typically sent to existing users after the referral program goes live, as well as to any new user who signs up after the program has gone live.  > > Common behavior: > > * Sent on the 6th day after a new user first signs up to introduce the referral program and its details. > * Includes the referral link. > * Sent only once per user.\ > \ > Please review the [Essential notifications](https://app.cello.so/user-experience/notifications/essential) tab in portal for copy and timing. > [accordion] If a user views the widget in another language (example: French or German), will their emails match that language? > > Email language is generally based on the last language used in the widget. Supported languages include English, German, Spanish, French, Dutch, Italian, Portuguese, Japanese, Danish, Slovak, and Romanian (more may be added on request).\ > \ > Enabling of email text in different languages requires config customization on the Cello side. Please coordinate with your Customer Success Manager for the additional languages required. > [accordion] How do you make sure Cello emails don't end up in spam? Are they authenticated (SPF, DKIM, DMARC)? > > Yes. Cello sends referral emails through SendGrid (EU region) from Cello's own domain, `cello.so`, with your product name (or a custom sender name) as the sender name. `cello.so` is authenticated for sending: every email is DKIM-signed, SPF-aligned through SendGrid's domain authentication, and covered by a DMARC policy. > > Every email also follows the bulk-sender requirements of Gmail and Yahoo: > > * **One-click unsubscribe** - a `List-Unsubscribe` header and an unsubscribe link in the footer > * **Sender details** - Cello's postal address in the footer > * **Context** - a short note explaining why the recipient is getting the email > > Emails only go to your users who take part in your referral program. Apart from the welcome email, they are transactional: they are only sent to update referrers on their referral activity. > [accordion] Why can’t we keep the notification dot always visible? > > The dot is designed as an alerting mechanism to bring users into the widget when there’s something new. By design, it disappears once the user has seen the update.\ > \ > What we have seen work well for other customers are small "NEW" stickers on the right side of the menu items. > [accordion] How do announcements, dots, and welcome/view emails work (typical timing)? > > Typical sequence (often with \~1 day delay): > > * `welcome-dot`: after first boot if user remains inactive > * `welcome-announcement`: a few days after first activity (or after the welcome-dot is displayed) > * `welcome-email`: about one week after first boot. All other emails are transactional, meaning they are only sent in order to update the referrer on their referral activity. > > Note: actual timing can vary with payout delays and fraud/self-referral review. Please review the [Essential notifications](https://app.cello.so/user-experience/notifications/essential) tab in portal for copy and timing. > [accordion] My announcement is not showing even though showAnnouncement returns a fulfilled promise. What's wrong? > > Most common cause: your **Announcement Selector** matches more than one element, and Cello (which uses `document.querySelector`) anchored the announcement to a hidden or zero-sized one. A fulfilled `showAnnouncement` promise only means the SDK accepted the call - it does **not** mean the announcement is visible. > > Run this in the browser console on the page where the announcement should appear: > > ```javascript theme={null} > document.querySelectorAll("") > ``` > > * If the result is **more than one element**: narrow the selector. Cello uses the **first match in DOM order**, which may be a wrapper `
  • ` or `` with no layout box. Use a parent prefix or an `id` to target exactly one visible element. > * If the result is **one element**: check `document.querySelector("").getBoundingClientRect()`. If `width` or `height` is `0`, the class is on a wrapper, not the visible element - move the class/attribute to the icon or button you actually want anchored. > * If the result is **zero elements**: the element doesn't exist when the announcement renders. Confirm it exists before `cello.boot()` and check `#`, `.`, `[]` prefix correctness. > > Update **Announcement Selector** in [User experience → Widget](https://app.cello.so/user-experience/component) once you have a selector that returns exactly one visible element. > > See [Troubleshooting: announcement not showing](/referral-component/custom-launcher#troubleshooting-announcement-not-showing) for the full diagnostic checklist and selector specificity examples. > > If you'd rather not depend on a selector at all, you can [show announcements in your own component](/referral-component/custom-launcher#show-your-own-announcement) instead. > [accordion] How do I hide the notification badge? > > Add `data-cello-badge="false"` to your custom launcher HTML element: > > ```html theme={null} > > ``` > > This hides the badge while keeping the element clickable. See [Configure notification badge](/referral-component/custom-launcher#configure-notification-badge) for all options. > > To show your own badge instead, as a dot or with the number of unread rewards, see [Show your own badge](/referral-component/custom-launcher#show-your-own-badge). > > **Common confusion:** there is no `hideDefaultBadge` boot option - this does not exist in the Cello JS SDK. The `hideDefaultLauncher` boot option is different - it hides the **entire default Cello button**, not just the badge. > [accordion] How can I draw my own badge and announcement instead of using Cello's default ones? > > Use the cello.js callbacks to get the unread counts and the active announcement, then render them in your own components. Unlike Cello's default badge and announcement, which are drawn on your launcher through the Portal selectors, your own components don't need to exist before Cello initializes or match a selector. > > **Badge** > > * Pass [`onUnreadCountChanged`](/sdk/client-side/cello-js-usage#cello-boot-options) to `cello.boot()`. > * For a dot, use `shouldShowBadge`. For a number, use `badgeCount`: the number of unread rewards, otherwise `1` for another unread notification, at most 99. Cello's own badge is always a dot, so the number is only available this way. > * If Cello still opens the Referral Component from that element, add `data-cello-badge="false"` so Cello doesn't draw its badge as well. > > **Announcement** > > * In [User experience → Widget](https://app.cello.so/user-experience/component), leave the **Announcement Selector** empty and turn off the Cello button, so Cello doesn't draw its own announcement. > * Pass [`onAnnouncementChanged`](/sdk/client-side/cello-js-usage#cello-boot-options) to `cello.boot()`. It receives the active announcement (heading, text, icon and call-to-action) or `null`. > * Open the Referral Component from the call-to-action with `window.Cello("open", announcement.ctaDestination)`, and call [`dismissAnnouncement()`](/sdk/client-side/cello-js-usage#dismissannouncement) from your close button. > > Both callbacks run at boot and again whenever something changes. When the user opens the Referral Component, Cello clears the counts and the announcement, so your badge and announcement hide on their own. Components that mount after boot can read the current state with [`getActiveAnnouncement()`](/sdk/client-side/cello-js-usage#getactiveannouncement) and [`getUnreadEventCounts()`](/sdk/client-side/cello-js-usage#getunreadeventcounts). > > The Referral Component is still required: your launcher opens it with [`open()`](/sdk/client-side/cello-js-usage#open-destination), and Cello still provides the announcement text, translated and personalized for each user. > > **Related docs** > > * [Build your own badge and announcement](/referral-component/custom-launcher#build-your-own-badge-and-announcement) > * [Cello JS SDK - usage](/sdk/client-side/cello-js-usage) > [accordion] The notification badge position is incorrect. How do I fix it? > > You can test the notification badge by opening your own referral link. Common causes of incorrect positioning: > > * The badge is added on the menu level instead of the menu-item level. > * The badge is positioned `absolute` but lacks a `relative` parent. Set the menu-item container to `position: relative`. > [accordion] How are notifications managed overall? What is the notification logic? > > Cello notifications fall into two categories: > > 1. **In-product**: alerts inside the widget, the badge dot on your launcher, and announcements, shown as toasts, banners or anchored to your launcher. You can also [draw the badge and announcements in your own components](/referral-component/custom-launcher#build-your-own-badge-and-announcement). > 2. **External**: emails (welcome, reward earned, first-view, etc.). > > These notifications and their triggers are designed to work alongside your existing product engagement touchpoints in a seamless way. > [accordion] How can we subscribe to Cello release notes and new features? > > Cello does not currently send out emails for new features or release notes. Reach out to your Cello contact for the latest updates.\ > \ > If we have major updates, we often post about them directly in a shared slack channel. We also have this section in our docs for updates: [Changelog](https://docs.cello.so/changelog) ## Fraud, self-referrals & abuse > [accordion] What is the self-referral policy? > > Cello provides automated capabilities to detect and mitigate self-referrals and fraudulent behavior. You can review marked referrals in our Cello Portal. > > **Related docs** > > * [Fraud detection](/guides/fraud-detection) > [accordion] Can a rejected referral be reversed? > > Yes. Reversals are done manually; coordinate with Cello support. > [accordion] How do you handle abuse/self-referrals? > > Cello uses multiple signals (including data you provide, e.g. emails) and behavioral patterns to detect likely self-referrals. High-certainty cases can be auto-rejected; others are flagged for review in the portal, where you can accept or reject. > > **Related docs** > > * [Fraud detection](/guides/fraud-detection) > [accordion] Do you use hashed IP/fingerprinting to detect abuse? > > Cello uses anonymized signals and patterns to detect suspicious behavior (e.g. matching anonymous identifiers across referrer and referee journeys). Exact methods may change over time. > > **Related docs** > > * [Fraud detection](/guides/fraud-detection) > [accordion] If an account is suspended for fraud, will the referrer see that in the widget? > > Currently, the widget may not show a detailed reason. In some cases, communication may happen via the referrer’s payout email (PayPal/Venmo). > [accordion] How does the self-referral detection system work? > > If a new user converts to a paying user, Cello looks at multiple data points before issuing a reward. These data points are checked for both sides: > > 1. The **new user** (referred person). > 2. The **referrer** based on the **UCC** the new user used. > > These datapoints are compared to detect cases where the referrer and referred user are the same person or repeating pattern is used to abuse the program. ## Integrations, SDKs & implementation > [accordion] What is the Cello Referral Component? > > The Referral Component is an embeddable UI that integrates directly into your application, giving logged-in users a complete referral experience. It is powered by the [Cello JS SDK](/sdk/client-side/cello-js-introduction) and is separate from [Attribution JS](/sdk/client-side/attribution-js-introduction), which handles referral tracking on landing pages. > > The component provides: > > * **Referral link sharing** - users can copy their link, share via social media, email, or QR code > * **Progress tracking** - real-time dashboard showing clicks, signups, and earned rewards > * **Reward payouts** - automated payouts via PayPal, Venmo, and other methods > * **Notifications** - in-app and email alerts for referral activity and milestones > * **Multi-language support** - 10+ languages with automatic detection > * **Dark mode** - light and dark themes with configurable colors per theme > > It can be added as a floating button or integrated into your existing navigation using a [custom launcher](/referral-component/custom-launcher). Native SDKs are available for web, iOS, Android, and React Native. > > Integration requires three steps: load the SDK, generate a JWT token server-side, and boot the component with the user’s details. > > **Related docs** > > * [Referral Component introduction](/referral-component/introduction) > * [Quickstart](/referral-component/quickstart) > * [Custom launcher](/referral-component/custom-launcher) > [accordion] Which programming languages/frameworks are supported? > > Cello is framework-agnostic. The [Cello JS SDK](/sdk/client-side/cello-js-introduction) is a browser-based JavaScript library that works with any web framework whose output is HTML/JavaScript, including: > > * **React**, **Next.js**, **Vue**, **Angular**, **Svelte**, and vanilla JavaScript > > For **server-side rendering** frameworks (e.g., Next.js), Cello interactions must occur client-side - the SDK runs in the browser and cannot be initialized server-side. For **Angular** specifically, avoid using `` as your AppRoot element to prevent a race condition with Cello’s DOM injection (see the [Angular notes in the quickstart](/referral-component/quickstart#do-you-support-angular)). > > For **mobile apps**, native SDKs are available: > > * [iOS SDK](/sdk/mobile/ios) - Swift/Objective-C with Swift Package Manager and CocoaPods > * [Android SDK](/sdk/mobile/android) - Kotlin/Java with Gradle > * [React Native SDK](/sdk/mobile/react-native) - cross-platform mobile > * [Flutter SDK](/sdk/mobile/flutter) - cross-platform mobile > > **Related docs** > > * [Cello JS SDK introduction](/sdk/client-side/cello-js-introduction) > * [Quickstart](/referral-component/quickstart) > * [Mobile SDK introduction](/sdk/mobile/introduction) > [accordion] Can we remove the Cello branding? > > No - Cello branding on the Referral Component is required and cannot be removed. This is primarily a trust and compliance requirement, not advertising. > > When referrers receive reward payouts, the transaction appears on their bank or PayPal account as a payout **from Cello**. The branding in the widget ensures users understand that the referral program is powered by Cello before they receive a payout. Without it, users may not recognize the payment and could flag it as fraud or issue chargebacks - which can harm both your referral program and your referrers. > > The branding is designed to be non-intrusive. While the Cello logo cannot be removed, the Referral Component inherits your app’s theming - including separately configurable light and dark mode colors - and many other aspects of the UI can be customized through the [Cello Portal](/guides/user-experience/overview). > [accordion] Can we customize widget text and UI? > > The Referral Component splits into two buckets: visual configuration that you do self-serve in the [Cello Portal](https://app.cello.so), and copy/text changes that are managed by Cello on request. > > **Self-serve in the Portal:** > > * **Brand colors** - primary color, Cello button color, Fab icon color, and notification badge color, with separate values for light and dark mode > * **Button style and position** - choose from 3 styles, set screen position, or use a [custom launcher](/referral-component/custom-launcher) integrated into your own menu > * **Component type** - display as a pop-up or a modal, with configurable position > * **Sharing options** - enable/disable link copy, social sharing (Twitter, LinkedIn, email), and QR codes > * **Payment methods** - configure PayPal, Venmo, or other payout options for referrers > * **Announcement display style** - choose between toasts, banners, or anchored announcements > * **Language switching at runtime** - language enablement itself is configured by Cello, but the SDK exposes [`language`](/sdk/client-side/cello-js-usage#cello-boot-options) and [`changeLanguage`](/sdk/client-side/cello-js-usage#changelanguage-language) to switch between enabled languages > > **Requires a request to Cello (not self-serve):** > > * **Widget text** - onboarding steps, offer description, button labels, and any other in-widget copy > * **New User Banner copy** - banner message and CTA wording > * **Announcement text content** > * **Email body copy** > * **Translated copy in any enabled language** - Cello maintains translations centrally; customers do not edit translation strings directly > * **Default language for your product** - English by default; contact support to change it > * **Enabling additional languages** beyond what's already enabled for your product > > Why this split exists: Cello maintains consistent copy across 10+ languages and many reward structures, so copy changes are reviewed and rolled out by the Cello team. To request a copy change, email [support@cello.so](mailto:support@cello.so) or message your CSM with the surface, the current text, and the proposed new text (and the language(s) it should apply to). > > **Related docs** > > * [Configuring Referral Component](/guides/user-experience/configuring-referral-component) > * [User experience overview](/guides/user-experience/overview#texts-and-language) > * [Setting up campaigns](/guides/campaigns/setting-up-campaigns) > [accordion] Can we update or customize copy anywhere in Cello (widget, banner, announcements, emails)? > > No - copy updates are **not self-serve** in Cello. This applies to **all** user-facing text: the Referral Component (widget) onboarding and offer description, the New User Banner message, announcement text, and email body copy. Cello maintains consistent copy across customers to support 10+ languages and multiple reward structures. > > What you **can** configure self-serve in the Portal: > > * **Enable or disable** specific notification types (alerts, announcements, emails) - in [Essential notifications](https://app.cello.so/user-experience/notifications/essential) > * **Choose announcement display style** - toasts, banners, or anchored to your launcher > * **Configure the activation campaign** - recurring announcements to re-engage inactive referrers > * **Set reward amounts and program details** - which flow into the standardized email templates automatically > * **Email template visual elements** - logo, hero/presentation image, and CTA link, in [Emails](https://app.cello.so/user-experience/emails) (see [Email template customization](/guides/user-experience/referral-notifications-and-emails#email-template-customization)) > * **Enable/disable** the New User Banner and adjust any styling options exposed in the Portal > > What requires Cello involvement: > > * **Widget text** - onboarding steps, offer description, button labels, in-widget copy > * **New User Banner copy** - banner message and CTA wording > * **Announcement text content** > * **Email body copy** (e.g., "How It Works" page, reward email wording) > * **Translated wording** in any enabled language - translations are managed centrally by Cello > > If you draw announcements in your own component, you control how they look, but Cello still provides the heading and text, translated and personalized for each user. See [Show your own announcement](/referral-component/custom-launcher#show-your-own-announcement). > > To request a copy change, email [support@cello.so](mailto:support@cello.so) or message your CSM with the surface (widget / banner / announcement / email), the current text, the proposed new text, and the language(s) the change should apply to. > > Based on Cello’s experience across hundreds of programs, modifications to email or announcement copy have minimal impact on referral performance. The biggest drivers of success are creating more impactful in-product touchpoints, such as Moments of Delight and deeper mobile app integration. > > **Related docs** > > * [Referral notifications and emails](/guides/user-experience/referral-notifications-and-emails) > * [Configuring Referral Component - text and copy](/guides/user-experience/configuring-referral-component#customize-text-and-copy) > * [User experience overview](/guides/user-experience/overview#texts-and-language) > [accordion] Can we change placement/style of the landing/referral messages? > > Yes - the referral landing page experience is highly customizable. You control the landing page itself, and Cello provides several approaches for the referee signup flow: > > 1. **Dedicated landing page** (recommended) - build a custom page optimized for referral conversions. Dedicated pages have shown up to **2x higher conversion rates**. You have full control over layout, design, messaging, and CTAs. > > 2. **Home page with inline personalization** - use your existing home page and add referral-specific personalization (referrer name, discounts) directly into your headline and CTA using the Attribution JS API (\`getReferrerName()\`, \`getCampaignConfig()\`). > > 3. **Home page with New User Banner** (no code) - add the Cello attribution script and enable the New User Banner in the [Cello Portal](https://app.cello.so/user-experience/landing-page). The banner automatically displays personalization and discount info to visitors arriving via referral links. > > For the **Referral Component** (the in-app widget for logged-in referrers), you can configure its placement (floating button position or [custom launcher](/referral-component/custom-launcher)), display type (pop-up or modal), and brand colors in the Portal. > > For adjustments beyond what’s available in the Portal, contact your CSM or the Cello product team with screenshots and the desired behavior. > > **Related docs** > > * [Optimizing referral landing pages](/guides/user-experience/optimizing-landing-pages) > * [Personalizing referrals](/guides/user-experience/personalizing-referrals) > * [Configuring Referral Component](/guides/user-experience/configuring-referral-component) > [accordion] How do we validate a UCC? > > Use the Referral Codes API endpoint `GET /referral-codes/{code}` to validate a UCC and identify the referrer it belongs to. > > The API returns: > > * `valid` - whether the UCC is a legitimate, active referral code > * `productUserId` - the referrer’s user ID in your system > * `campaignId` - the campaign the UCC is associated with > > Example response for a valid code: > > ```json theme={null} > { > "code": "UIPIWa2Hnnr", > "productUserId": "12345678", > "valid": true, > "campaignId": "campaign_partners_1" > } > ``` > > Common use cases for UCC validation: > > * **Self-referral prevention** - compare the returned `productUserId` (referrer) with the logged-in user’s ID; if they match, ignore the UCC > * **Existing-user attribution** - validate the UCC on login before storing it for future purchase attribution > * **Tampered URL detection** - if someone modifies the `ucc` query parameter, the API will return `valid: false` > * **Discount eligibility** - validate the UCC before applying a new-user discount to ensure the code hasn’t been tampered with > > **Related docs** > > * [Fetch referral code info](/api-reference/referral-codes/fetch-referral-code-info) > * [API authentication](/api-reference/authentication/get-token) > [accordion] Can we grab the UCC directly from the URL instead of calling getUcc()? > > Yes - the `ucc` is always present as a query parameter in the URL when a user clicks a referral link (e.g., `https://yoursite.com/?ucc=ABC123`). You can parse it directly from the URL using standard JavaScript: > > ```javascript theme={null} > const ucc = new URLSearchParams(window.location.search).get('ucc'); > ``` > > However, using `getUcc()` from the [Attribution JS](/sdk/client-side/attribution-js-introduction) library is recommended because it: > > * **Falls back to cookies** - if the user navigated away and the `ucc` is no longer in the URL, `getUcc()` retrieves it from the stored cookie > * **Handles async loading** - waits for the attribution script to initialize before returning data > * **Works across sessions** - cookies persist for 3 months, covering indirect signups where the user returns later > > If you read the `ucc` from the URL yourself, make sure to store it in your database linked to the user at signup, so it’s available when sending [signup](/attribution/tracking-signups) and [purchase](/attribution/tracking-purchase) events to Cello. > > **Related docs** > > * [Attribution JS usage & API](/sdk/client-side/attribution-js-usage) > * [Web attribution](/attribution/for-web) > [accordion] Does Cello integrate with Salesforce? > > Yes. Cello integrates with Salesforce via **Apex triggers** that call the Cello API when specific conditions are met in your Salesforce workflow. This is the recommended approach for sales-led referral attribution. > > A typical setup uses an Apex trigger on the Opportunity object to send events to Cello when: > > * An Opportunity reaches a specific stage (e.g., "Proposal/Price Quote") > * The Opportunity has a `cello_ucc` custom field populated > > This allows you to attribute deals and revenue back to the referrer who generated the lead. The trigger calls the Cello API to send demo-attended or purchase events based on your sales flow. > > The integration is not a native Salesforce app - it uses standard Apex triggers and HTTP callouts to the Cello API, giving you full control over which events are sent and when. You can also send events directly via the [Cello API](/api-reference/generic-events/send-event) if you prefer not to use Apex triggers. > > **Related docs** > > * [Salesforce Apex triggers guide](/integrations/salesforce-apex-triggers) > * [Cello API - send events](/api-reference/generic-events/send-event) > [accordion] Turbo (turbo-rails / Hotwire) hides the widget iframe on navigation. Any guidance? > > This happens because Turbo replaces the page’s DOM during navigation, but the Cello widget iframe persists in an orphaned state. The fix is to shut down the widget before Turbo transitions, then re-initialize it on the new page. > > Add an event listener to call `shutdown` before Turbo navigates: > > ```javascript theme={null} > document.addEventListener("turbo:visit", () => { > window.Cello("shutdown"); > }); > ``` > > Or alternatively, just before Turbo renders new content: > > ```javascript theme={null} > document.addEventListener("turbo:before-render", () => { > window.Cello("shutdown"); > }); > ``` > > `turbo:visit` (recommended) fires at the start of navigation before any network requests, giving the cleanest teardown. `turbo:before-render` fires later, just before the new page content replaces the DOM. > > After shutdown, Cello needs to be re-initialized on the new page. If your Cello boot script is in the page layout, it will run automatically after Turbo renders. If not, listen for `turbo:load` to re-boot: > > ```javascript theme={null} > document.addEventListener("turbo:load", () => { > window.cello.cmd.push(async function (cello) { > await cello.boot({ /* your boot config */ }); > }); > }); > ``` > > **Related docs** > > * [Cello JS SDK](/sdk/client-side/cello-js-introduction) > * [Quickstart](/referral-component/quickstart) > [accordion] We integrated React Native (Expo) and see APIError error 1 on init. What should we check? > > This error (`InitializationError`) typically means the SDK is connecting to the wrong environment. When using Expo, the `env` property defaults to `prod` - if your credentials are for the sandbox environment but `env` is not explicitly set, initialization will fail. > > Verify that the `env` value is correctly nested under the `@getcello/cello-react-native` Expo plugin in your `app.json`: > > ```json theme={null} > { > "expo": { > "plugins": [ > [ > "@getcello/cello-react-native", > { > "env": "sandbox" > } > ] > ] > } > } > ``` > > After changing the plugin configuration, you must rebuild the native app: > > ```bash theme={null} > npx expo prebuild --clean > ``` > > Also check: > > * **Credentials** - ensure `productId` and `token` match the environment you selected (`sandbox` vs `prod`) > * **Not using Expo Go** - the Cello SDK requires a custom native build and will not work in Expo Go (you’ll see a `LINKING_ERROR` instead) > > **Related docs** > > * [React Native SDK](/sdk/mobile/react-native) > [accordion] Our signup discount isn’t applied when the referee reaches payment stage. Why? > > Referral discounts are applied by **your** subscription platform (Stripe, Chargebee, etc.) during subscription creation - Cello does not apply them automatically. If the discount isn’t showing up, check the following in order: > > 1. **Is the `ucc` available at checkout?** - verify the referral code was preserved from signup to the payment flow. Check your Stripe/Chargebee customer metadata for `cello_ucc`, or call `getUcc()` from the Attribution Library. If it’s missing, the attribution cookie may have been lost (e.g., cookie consent blocked it, or the user is on a different domain). > > 2. **Is the user eligible for a discount?** - use the [New User Reward API](/api-reference/new-users/get-reward) to validate eligibility, or check for `cello_ucc` in the customer object in your payment platform. Note that `eligible: false` can also be returned if the user signed up with **their own UCC** or the signup was flagged as a **self-referral** by Cello's [fraud detection](/guides/fraud-detection) - self-referrals do not qualify for new-user discounts. > > 3. **Is the coupon applied during subscription creation?** - discounts must be passed at the time the subscription is created (e.g., via `discounts` array in Stripe or `coupon_ids` in Chargebee). They cannot be attached after the fact through the API. > > 4. **Is the coupon valid?** - verify the coupon ID exists in your payment platform, hasn’t expired, and matches the plan type being purchased. > > **Related docs** > > * [Apply discounts guide](/attribution/apply-discounts) > * [New User Reward API](/api-reference/new-users/get-reward) > * [Web attribution](/attribution/for-web) > [accordion] I added the CDN script in index.html and sometimes the page errors on load. Why? > > This typically happens because the Cello script downloads and executes before the `` element is available in the DOM. Cello appends its UI to ``, so if `` doesn’t exist yet, initialization fails. > > **Recommended fix:** Ensure the script tag includes `type="module"` and `async`, and is placed in the ``: > > ```html theme={null} > > ``` > > The `type="module"` attribute defers execution until after the DOM is parsed, which prevents the race condition. If you’re still seeing issues: > > * **Use the command queue pattern** - initialize Cello through the queue so commands are buffered until the script is ready: > ```javascript theme={null} > window.cello = window.cello || { cmd: [] }; > window.cello.cmd.push(async function (cello) { > await cello.boot({ /* your config */ }); > }); > ``` > * **Move the script to the end of ``** - as a fallback, placing the ` ``` **2. Enable banner in Cello Portal** 1. Go to [User experience → Landing page → Personalization tab](https://app.cello.so/user-experience/landing-page) 2. Turn on the "New User Banner" option 3. In the Portal you can toggle the banner on/off and adjust any styling options that are exposed there ![Banner configuration in portal](https://uploads.developerhub.io/prod/d316/awxkm4mylat17jaor7g640wv97ylpeq29lg7brg2lvef4c6zlidh63eoe0a559ii.png) > [!NOTE] > > The Portal controls whether the banner is shown and surfaces visual styling. The banner **copy** (message text, CTA wording) is managed by Cello and is not editable self-serve - contact your CSM or [support@cello.so](mailto:support@cello.so) to request copy changes. The same applies to widget onboarding text, offer descriptions, announcements, and email body copy. See [Texts and copy](/guides/user-experience/configuring-referral-component#customize-text-and-copy). **3. Configure personalization** Ensure personalization is enabled in your user experience configuration and you are sending the name of the referrer in the productUserDetails when booting the widget, so referrer name appear in the banner. ## Option 2: Custom Landing Page Personalization Recommended for full control For complete control over the user experience, implement custom personalization using Attribution JS methods. > [!NOTE] > > **Client-side vs. server-side rendering:** `getCampaignConfig()` from the Attribution JS SDK is the recommended way to retrieve and display discount info - it runs in the browser with no extra backend round-trip. If your app is **server-side rendered** (e.g., PHP, Next.js SSR) and you need discount details available before the page loads, you can use the [New User Reward API](/api-reference/new-users/get-reward) from your server instead. For most apps, the JS approach is simpler. ### Setup steps **1. Add Attribution Script Queue** First, add this code before any Attribution calls to handle asynchronous loading: ```javascript theme={null} // Queue function to handle script loading window.CelloAttribution=window.CelloAttribution||function(t,...o){if("getReferral"===t)throw new Error("getReferral is not supported in this context. Use getUcc instead.");let e,n;const i=new Promise((t,o)=>{e=t,n=o});return window.CelloAttributionCmd=window.CelloAttributionCmd||[],window.CelloAttributionCmd.push({command:t,args:o,resolve:e,reject:n}),i} ``` **2. Retrieve referral and discount information** Use Attribution JS methods to retrieve referral and campaign configuration data: * `window.CelloAttribution("getUcc")` * `window.CelloAttribution("getReferrerName")` * `window.CelloAttribution("getCampaignConfig")` **3. Display discount on the landing page** Display the discount inline on your landing page (e.g., a banner or callout). The values come from the campaign configuration retrieved in the previous step. The `getCampaignConfig()` method returns discount data in this format: ```javascript theme={null} // Example campaign config response { newUserDiscountPercentage: 0.25, // 25% discount (decimal format) newUserDiscountMonth: 3 // For 3 months } ``` ## FAQ ### Can I add different discounts for different campaigns? Cello supports multiple campaigns with different discount structures, allowing you to offer varied incentives based on the referral source or campaign type. # Optimizing Referral Landing Page Source: https://docs.cello.so/guides/user-experience/optimizing-landing-pages This guide focuses on optimizing landing pages for referrals, a critical step in the user journey This guide focuses on optimizing landing pages for referrals, a critical step in the user journey. A referee's first interaction with your product occurs when they follow an invite link, making the page they land on a key determinant in the success of your referral program. ### In this guide This guide walks you through the key building blocks of a referral-optimized landing page to ensure referees smoothly transition from interested to signing up. There are a few approaches you can take when designing your referee signup flow: * [Using a dedicated landing page](#dedicated-landing-page) Recommended * [Using your home page as the landing page with inline personalization](#home-page-as-the-landing-page-with-inline-personalization) * [Using your home page as the landing page with our new user banner for personalization](#home-page-as-the-landing-page-with-new-user-banner) No code ## Dedicated landing page A dedicated page that the referee lands on when clicking on the invite link has shown to have up to **x2 higher conversion rate** if done right. Below, you can find examples of the landing pages we like along with the key building blocks to make a dedicated landing page perform. ![Dedicated landing page examples](https://uploads.developerhub.io/prod/d316/92tx1a1qsfnf337yzr7sjyzs7uf9gyd3pr7fck534lvkxpn4lor3hl1rd3fm4swu.png) ### Key building blocks #### Headline: Personalized Exclusivity Craft a headline that feels exclusive and personal. [Use personalization](#add-personalization) for additional social proof like adding the referrer's name, and highlight [any special discount or reward](#add-a-new-user-discount-or-reward). This approach creates a sense of trust and urgency. #### Key Value Proposition: Clarity in One Sentence Distill your product's core benefit into a single, compelling sentence. This should quickly inform the visitor whether your product meets their needs, making their decision process easier and faster. #### Content: Concise and Informative Streamline your content compared to your main homepage. Provide just enough detail to help visitors understand your product and how it can work for them, without overwhelming them or necessitating navigation away from the page. #### CTA Focus: Direct and Offer-Centric Make your Call-to-Action (CTA) clear and direct, with an emphasis on the action you want the referee to take. If there's a special offer or discount, ensure your CTA highlights this to maximize conversion. #### Social Proof: Credibility through Endorsements Include social proofs such as G2/Capterra badges, Trustpilot ratings, customer logos, and quotes. These elements build trust and credibility, showing potential users that others have had positive experiences with your product. #### FAQs: Contextual Information Integrate a section for Frequently Asked Questions (FAQs) to address common queries. This helps provide referees with all the necessary information on the same page, reducing the likelihood of them leaving the page without signing up. If they return later, they can still be tracked towards the referral, but the best time to capture a new user is the first time they click the referral link. ### Add a new user discount or reward Offering discounts to referees effectively boosts signup conversion by fostering urgency, encouraging active promotion, reducing cost concerns, and giving a competitive advantage when similar incentives aren't available from competitors. [Learn more about adding discounts 👉](/guides/user-experience/adding-discounts) If your program offers discounts or rewards to referees, make sure to highlight it in the Headline and CTA. ![Landing page with discount highlighting](https://uploads.developerhub.io/prod/d316/cs4uw2kz1toa5jnwebt9oisrlu85hv98enz36ov1xgf94pso868eh216xo5g2rz4.png) 💡 Our research shows that **symmetric rewards** (i.e. the referrer and the referred have incentives of similar values) are more effective. This happens because referrers invest their social capital when recommending a product; having similar incentives makes the referral look fair to both parties involved. **Examples of dedicated landing pages** 🔗 [Heyflow stand-alone landing page](https://get.heyflow.app/referral-lp?productId=go.heyflow.app\&utm_source=cello\&utm_medium=referral\&utm_campaign=Cello-RS20-C1000-D50\&ucc=2dRGoRjgP7A#start) 🔗 [Cello stand-alone landing page with direct signup](https://cello.so/invitation/) ### Add personalization *"The most credible advertising comes straight from the people we know and trust. More than eight-in-ten global respondents (88%) say they completely or somewhat trust the recommendations of friends and family." Nielsen Global Trust in Advertising Report, 2021* Personalization and social proof, like using the referrer's name on the landing page, can contribute to converting referees into users. The personalization establishes trust and credibility, makes the offer more relevant and engaging, leverages an existing relationship, fosters a sense of community and belonging, reduces perceived risk, and has an emotional appeal. These elements together make the referral more compelling, encouraging referees to sign up. [Learn more about personalization 👉](/guides/user-experience/personalizing-referrals) ![Personalized landing page example](https://uploads.developerhub.io/prod/d316/ld9jqwhsa10n6sumlaxqg6zbx8mrl0toxnv1y64zxf5ewj03ll09rg0ufjge9gae.png) 💡 **Leveraging existing assets -** Do you already have an optimized landing page for ads? You don't need to start from scratch. Reuse the layout and some of the content to build a dedicated referral landing page. **Examples of personalized landing pages** 🔗 [VEED stand-alone landing page with personalization](https://veed.cello.so/x23zCRNtZqx) ![VEED referral landing page showing the referrer's name and the new user discount in the headline](https://mintcdn.com/cello/O1w8LHFkXSb5-7As/images/veed-personalized-landing-page.jpg?fit=max\&auto=format\&n=O1w8LHFkXSb5-7As\&q=85\&s=e553cf7a4e46edaa235b6be8d5caf959) ## Home page as the landing page with inline personalization Use your existing home page as landing page and [add a discount](/guides/user-experience/new-user-discounts) and [personalization](/guides/user-experience/personalizing-referrals) into your home page Headline and CTA. ![Home page with inline personalization](https://uploads.developerhub.io/prod/d316/o5i70ntrpqx12x57vhhkzjrlwhso1lgzsu3j5stw5hsajn3unuorprbgobjmcwvv.png) ## Home page as the landing page with New User Banner The [New User Banner](/guides/user-experience/personalizing-referrals) is easily added to your landing page by integrating the [Cello attribution script](/sdk/client-side/attribution-js-introduction). Visitors who follow the Cello invite link will have a banner that includes the discounts, tailored CTA, and personalization on your home page. ![Home page with new user banner](https://uploads.developerhub.io/prod/d316/1kwrkslooz73pf38ewoporvru2vesdzcvu4rj3e75nuesgwjvtm4k50n4yiugw1d.png) **Examples of landing pages with new user banner** 🔗 [MeetGeek Website with personalized new user banner](https://meetgeek.ai/go/refer?productId=app.meetgeek.ai\&ucc=vTlj7ne4Fkf\&n=VG9iaWFz) ## Get started now Once your referral landing page is ready to go, go to you product dashboard [User experience → Landing page](https://app.cello.so/user-experience/landing-page) and switch to **Custom landing page**. In **Custom landing page URL** field, add the URL to your new landing page and **Save**. ![Custom landing page setup in Cello Portal](https://uploads.developerhub.io/prod/d316/9kw7mh7m2tdputcmannhie0dcryqg4ofqmer2f6flg1lp9o2iyg8sir77xi0zjw7.png) # Overview Source: https://docs.cello.so/guides/user-experience/overview The Referral Component is an all-in-one referral experience, easily added to your web application with just a few lines of code The Referral Component is an all-in-one referral experience, easily added to your web application with just a few lines of code. It takes care of things like referrer first-time experience, enabling users to share links, updating them on progress, and handling rewards. This functionality helps to keep your users happy and engaged with your referral program. Let's review some of the key capabilities 👉 ## Adding the component to your product Adding the Referral Component to your product is straightforward. You can get it up and running in your test environment in just a few minutes. Simply follow the instructions or the [Referral Component Quickstart](/referral-component/quickstart). Cello provides a few different options to add the component to your product. You can use either the default Cello button (FAB) or integrate Cello into a menu via the [Custom Launcher](/referral-component/custom-launcher). Either option can open with the component appearing as a pop-up or modal view. ![Referral Component Pn](https://mintcdn.com/cello/6Zr08teY9AER0ncF/referral-component/referral-component.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=73321c0f80997dd009c289bd91a0513c) ## First-time experience The Cello Referral Component provides an onboarding experience for first-time users of the program. It's a way to get users excited about the opportunity and explain how the program works in 3 easy steps. All the texts of the onboarding experience can be customized to better explain your unique value proposition. ![First-time experience onboarding](https://uploads.developerhub.io/prod/d316/209t09uch2dp1qo2e56dnam7xwinogghl1cydjc6lrrd10s82jbl8ozt6gz2w65q.gif) ## Your offer, front and center The referral program text and offer are fully customizable and can be translated into multiple languages. ![Customizable referral offer display](https://uploads.developerhub.io/prod/d316/2w804cm63iubzidf6al6i3n613tlj4t5uz82tawk0utw7ds36hi68u6z5ryfocmq.png) ## Easy sharing Cello provides many sharing options to choose from. Simple link copy, social sharing including Twitter, Facebook, LinkedIn, and email, and transfer to mobile by using a QR-code where a user can forward the invite using all the options provided directly from their mobile device. ![Multiple sharing options including social media and QR code](https://uploads.developerhub.io/prod/d316/0hwigziouorrzshepv4vz0cssyv4ipjtdys20r1o7d3fhww9uftywhjiubvl0ptx.png) ## Engaging users with announcements The Cello Referral Component provides a robust announcement feature to activate first-time referrers, keep the referral program top of mind, encourage repeat behaviour, and keep your users up to date with important updates. ![Announcement feature examples](https://uploads.developerhub.io/prod/d316/ctsxd2yb6srflbb9e4aejnc85yabjrh8lzuhw2cw9xf5i03m9czkjbh3pm59vh1e.png) Announcements can be customized based on the Referral Component integration option you have chosen. [Anchor announcements to a specific menu item](/referral-component/custom-launcher#add-announcement-selector) or choose to have them appear as toasts or banners. ![Different announcement display options](https://uploads.developerhub.io/prod/d316/lz8i57i55vw0dvugc9jwzxgmz8b3u6e04hjm2xa23e84w2wod8wl0imadppjud57.png) ## Keeping users update with emails Referral programs thrive on timely engagement. Knowing instantly when there's activity tied to a referrals means your users can celebrate successes and continue to share more effectively. Whether it's their first successful share, a brand-new signup or unlocking a new reward, email notifications ensure they never miss a beat in the referral journey. ![Email notification examples](https://uploads.developerhub.io/prod/d316/iat8pc4vxl45dfdq1u2lso0z7of2algsmkejqv0rppeicttn5fhgxrgnrmufqq9s.png) ## Getting Rewarded When users receive their first reward, they will be prompted to provide payment details and can select how they would like to receive their reward. They may also be asked to provide additional information if required to receive a payment in their specific country. ![Reward payment setup interface](https://uploads.developerhub.io/prod/d316/ytqunsc2z33ljcfng5uy9kfkts0z3g1xjszpv2bwkujewc1xsoukpoql09bd2pqa.png) ## Reward Countries and Payout Methods Cello supports a growing list of countries\* where users can receive reward payments. Cello plans to continue expanding support for additional countries based on user feedback. Users from countries not on the supported list cannot set up a payout method - their country will not appear in the payout country dropdown. This is due to PayPal-side restrictions and compliance, tax, or regulatory requirements. There are two approaches for handling users in unsupported countries: * **Hide the widget** - pass `productUserCountryCode` during `cello.boot()`. If the country is not supported, the Referral Component will not be shown to that user. This prevents a confusing experience where a user can share and earn rewards but cannot receive a payout. * **Show the widget to everyone** - users in unsupported countries can still share and earn rewards, but will not be able to receive payouts. This is simpler to implement and avoids the risk of incorrectly hiding the widget from eligible users. **Important limitation of the hide approach:** `productUserCountryCode` is the country your product has on file for the user, which may differ from the country of their PayPal account (their actual payout country). This creates edge cases: * If a user's product country is unsupported but their PayPal account is in a supported country, they will be incorrectly hidden from the widget even though they could receive payouts. * If a user's product country is supported but their PayPal account is in an unsupported country, the widget will be shown but they won't be able to complete payout setup. There is currently no way to know a user's payout country upfront. The right approach depends on how accurately your system reflects your users' actual locations. > [!NOTE] > > **Edge case - PayPal account country vs. physical location:** A user may be physically located in an unsupported country (e.g. Argentina) but hold a PayPal account registered in a supported country (e.g. Brazil). In this case, they should enter the address matching their PayPal account's country in the widget so the payout details align. Cello cannot issue payouts to countries not on the supported list regardless of physical location. Cello allows users to receive rewards via PayPal or Venmo payments. Additional payment options are planned based on user feedback. ![Payment method selection](https://uploads.developerhub.io/prod/d316/ymrfo0vnio1vs6kle34aej39yic3ts07egifhldpiv4bgafypdqbykgdodxu45zj.png) All users are subject to the Cello [Terms of Service](https://cello.so/terms-of-service/) and [Privacy Policy](https://cello.so/privacy-policy-cello-platform/) and can access details through the links that are provided. When linking a payout method, users provide their payout country and basic address details so Cello can issue credit notes and payout statements with the correct VAT and documentation treatment. Users can claim rewards as an individual or as a business; business claims may require a VAT number where applicable. Any additional tax or identity verification is handled by PayPal or Venmo as part of their own onboarding and compliance requirements. Users can download credit notes / payout statements directly from the Cello Referral Component. If they have at least one reward, they will see a "Tax Information" link from the rewards tab under "Update Payment Details". Users who no longer have access to the component can contact [support@cello.so](mailto:support@cello.so) to receive their credit notes through a standard support process. ![Tax information and credit notes interface](https://uploads.developerhub.io/prod/d316/91dpt90z4eej9opsqbg7cpiy7npq2fs4sc3hzvtwh0zum4ogx2olhuyxx77dsr53.png) *Supported Reward Countries: Australia, Austria, Bahrain, Belgium, Bermuda, Botswana, Brazil, Bulgaria, Canada, Cayman Islands, Chile, Croatia, Czechia, Denmark, Dominican Republic, Estonia, Faroe Islands, Finland, France, Georgia, Germany, Gibraltar, Greece, Greenland, Guatemala, Hong Kong SAR, Hungary, Iceland, India, Ireland, Israel, Italy, Japan, Latvia, Lesotho, Liechtenstein, Lithuania, Luxembourg, Malta, Mauritius, Mozambique, Netherlands, Nicaragua, Norway, Oman, Philippines, Poland, Portugal, Qatar, Romania, San Marino, Saudi Arabia, Senegal, Slovakia, Slovenia, South Africa, Spain, Sweden, Switzerland, United Kingdom, United States, Uruguay.* ## Texts and language The Referral Component is fully translated and supports 10+ languages: English, German, Spanish, French, Dutch, Italian, Portuguese, Japanese, Danish, Slovak, and Romanian. **Defaults** * **English is enabled by default** for every product and acts as the **fallback** whenever an unenabled language is requested. **Editing wording or enabling more languages is not self-serve** Cello manages translations centrally to keep copy consistent across all customers and reward structures. To make any of the following changes, contact your CSM or [support@cello.so](mailto:support@cello.so): * Enable additional languages on top of English for your product * Change your product's default language to one of the enabled languages * Update the wording of any text (in any language) in the widget, New User Banner, announcements, or emails The Portal exposes runtime configuration (e.g., the `language` SDK parameter), but it does **not** expose translation strings - customers cannot write or edit translated copy themselves. **Selecting language at runtime** The component auto-detects the user's language, or you can set it explicitly via [`cello.boot()`](/sdk/client-side/cello-js-usage#cello-boot-options) and [`changeLanguage()`](/sdk/client-side/cello-js-usage#changelanguage-language). > [!WARNING] > > The `language` parameter only works for languages that have been enabled for your product on the Cello side. If you pass a language that hasn't been enabled, the component falls back to your product's default language (English unless you've requested a different default). If a language setting appears not to work, confirm with Cello support that the language is enabled for your account. # Personalizing Referrals Source: https://docs.cello.so/guides/user-experience/personalizing-referrals Add personalized messages to your landing pages to increase conversion rates ![Personalization Overview](https://uploads.developerhub.io/prod/d316/0we89adhuij3xea270ik5soyle1qptyv8m8uwm8v4hbjeq6og89afwhe8ch61wge.png) In this guide we will go through: * The benefits of personalization * How to add personalization to your landing pages: * [Inline](#add-personalization-to-the-headline-or-other-page-element) Recommended * [Using the new user banner](#add-personalization-with-new-user-banner) No code ## Why personalization? Personalization and social proof, such as including the referrer's name in the landing page headline, are crucial for converting referees into signed-up users due to several key reasons: 1. **Enhanced Trust and Credibility:** Seeing a familiar name like "Bob has gifted you a free month to try Moonly" immediately establishes a sense of trust. The referee recognizes the referrer, which lends credibility to the offer. 2. **Increased Relevance and Engagement:** Personalization makes the offer feel more tailored and relevant to the referee. A message that appears to be handpicked for them can create a stronger emotional connection and engagement with the content, increasing the likelihood of a positive response. 3. **Leveraging Existing Relationships:** Utilizing the referrer's name capitalizes on the existing relationship between the referrer and the referee. This relational dynamic can be a powerful motivator, as referees often value and trust the opinions and choices of their friends or contacts. 4. **Creating a Sense of Community and Belonging:** Personalized messages can give referees the feeling of being part of an exclusive group or community, especially when the message implies a gift or a special offer from someone they know. This sense of belonging can be a strong incentive to join and participate. 5. **Reducing Perceived Risk:** For new users, trying a new service involves some level of perceived risk or uncertainty. A personalized referral reduces this perceived risk, as it comes with an implicit endorsement from someone the referee trusts. 6. **Emotional Appeal:** Personalized messages can evoke an emotional response. Knowing that a friend or acquaintance has thoughtfully extended an offer can create feelings of appreciation and reciprocity, further encouraging the referee to sign up. > [!NOTE] > > To show the referrer name to the new user, you need to make sure that their user details are passed in the [referral component](/referral-component/quickstart). ## Add personalization to the Headline or other page element Recommended ![Personalized headline example](https://uploads.developerhub.io/prod/d316/kvl9a48szpc0rfo9kb1sumxjlcr2zywfxx1q5j2ux5p1echhjzpy2dkied6f3ujy.png) To add the referrer's name to an element on the page that the new user lands on when following an invite link, you need to follow these steps: ### Turn personalization on for your product Go to [User experience → Landing page → Personalization tab](https://app.cello.so/user-experience/landing-page) and add personalization. ![Personalization settings in portal](https://uploads.developerhub.io/prod/d316/lfelg8gr4m3oozbuwhzdv6mvw5n3bet6x4gictgq2fu76odldu3tpu2t7qhvltkf.png) When personalization is turned on, an extra parameter will be added to the URL of your landing page, e.g. `celloN=VGFuamE` ```html theme={null} https://getmoonly.com/?productId=getmoonly.com&ucc=pNRB1aYqArN&celloN=VGFuamE ``` ### Use the attribution script methods to get referrer information [Attribution script](/sdk/client-side/attribution-js-usage#getreferrername) provides a JS method `getReferrerName()` to fetch the name of the referrer. ```javascript theme={null} const referrerName = await window.CelloAttribution("getReferrerName"); console.log('Referrer name:', referrerName); ``` > [!TIP] > > You can also get the referrer name from the `celloN` URL parameter. Value of parameter `celloN` is an base64 encoded name of the referrer. In this example, `VGFuamE` is decoded to `Tanya` . You can try it yourself [here](https://www.base64decode.org/). By accessing this parameter from the URL and decoding in, you can add it to any element on any landing pages which are relevant. #### Complete Integration Example Use attribution script methods to get referral data: ```javascript theme={null} async function initializeReferralLandingPage() { try { // Wait for attribution script to load await new Promise(resolve => setTimeout(resolve, 1000)); // Get all attribution data using script methods (recommended) const ucc = await window.CelloAttribution("getUcc"); const referrerName = await window.CelloAttribution("getReferrerName"); const campaignConfig = await window.CelloAttribution("getCampaignConfig"); // Use the data for personalization personalizePageContent(referrerName, campaignConfig, ucc); } catch (error) { console.error('Failed to initialize referral landing page:', error); // Proceed without personalization personalizePageContent(null, null, null); } } function personalizePageContent(referrerName, campaignConfig, ucc) { // Update headline with referrer name const headline = document.getElementById('headline'); if (headline && referrerName) { headline.innerHTML = `${referrerName} has invited you to try our platform!`; } // Show discount information const discountBanner = document.getElementById('discount-banner'); if (discountBanner && campaignConfig) { const discountPercent = campaignConfig.newUserDiscountPercentage * 100; const discountMonths = campaignConfig.newUserDiscountMonth; discountBanner.innerHTML = `🎉 Special offer: ${discountPercent}% off for your first ${discountMonths} months!`; discountBanner.style.display = 'block'; } // Update call-to-action button const ctaButton = document.getElementById('cta-button'); if (ctaButton) { if (referrerName && campaignConfig) { const discountPercent = campaignConfig.newUserDiscountPercentage * 100; ctaButton.textContent = `Claim ${discountPercent}% Discount`; } else if (referrerName) { ctaButton.textContent = `Accept ${referrerName}'s Invitation`; } } // Store UCC for form submission if available if (ucc) { // This will be handled automatically by attribution script // but you can also manually add to forms: const forms = document.querySelectorAll('form'); forms.forEach(form => { if (!form.querySelector('input[name="ucc"]')) { const uccInput = document.createElement('input'); uccInput.type = 'hidden'; uccInput.name = 'ucc'; uccInput.value = ucc; form.appendChild(uccInput); } }); } } // Initialize when DOM is ready document.addEventListener('DOMContentLoaded', initializeReferralLandingPage); ``` ## Add personalization with the New user banner No code ![New user banner example](https://uploads.developerhub.io/prod/d316/u1pc17wx1cb9jedtt7ukm2kft0i5hvhj1dhhlg395qp1s52h7yqt4hc9j3dnmvfg.png) The banner is easily added in a few steps: * Add [Cello attribution script](/sdk/client-side/embedded-script-tag) to your landing page. * Go to [User experience → Landing page → Personalization tab](https://app.cello.so/user-experience/landing-page) and turn the banner on. ![Banner configuration in portal](https://uploads.developerhub.io/prod/d316/awxkm4mylat17jaor7g640wv97ylpeq29lg7brg2lvef4c6zlidh63eoe0a559ii.png) Visitors who follow the Cello invite link will have a banner displayed with an offer and the name of their referrer. > [!NOTE] > > The Portal toggles the banner on/off and exposes any visual styling options. The banner **copy** (message text, CTA wording) is managed by Cello and is not editable self-serve - contact your CSM or [support@cello.so](mailto:support@cello.so) to request copy changes. The same applies to widget onboarding text, offer descriptions, announcements, and email body copy. See [Texts and copy](/guides/user-experience/configuring-referral-component#customize-text-and-copy). ### Testing the Banner Implementation To verify the banner works correctly: ```javascript theme={null} // Test banner functionality async function testPersonalizationBanner() { // Check if attribution script loaded if (typeof window.CelloAttribution !== 'function') { console.error('Attribution script not loaded - banner won\'t work'); return; } // Test with sample referral data const testUrl = `${window.location.origin}${window.location.pathname}?productId=test&ucc=testUcc123&celloN=VGVzdFVzZXI=`; console.log('Test this URL for banner:', testUrl); // Check current page data const ucc = await window.CelloAttribution("getUcc"); const referrerName = await window.CelloAttribution("getReferrerName"); const campaignConfig = await window.CelloAttribution("getCampaignConfig"); console.log('Current page attribution data:', { ucc, referrerName, campaignConfig, bannerShouldShow: !!(ucc && (referrerName || campaignConfig)) }); } // Run test after page load setTimeout(testPersonalizationBanner, 2000); ``` # Referral Notifications and Emails Source: https://docs.cello.so/guides/user-experience/referral-notifications-and-emails Cello provides notifications that are seamlessly integrated with your product experience to inform, activate and continuously engage users with the referral program Cello provides notifications that are seamlessly integrated with your product experience to inform, activate and continuously engage users with the referral program. This page provides details on the notifications types and how to customize based on your needs. ## Notifications types and triggers Notifications the we support fall into 2 categories: **in-product** announcement and alert and **external** like email. These notifications and their associated triggers are designed to work in conjunction your existing product engagement touch points in a seamless way. ### Alert and Badge **Alert** is a notification that appears under Rewards tab. It is accompanied with a **badge**. ![New reward alert](https://uploads.developerhub.io/prod/d316/wzufn8xw627p0mvthxp48une8gwby82c718mfxr1jb3zy2g83jonavodouyj5x3h.png) A **badge** is a small colored dot displayed on the launcher opening the widget (Cello button or [Custom Launcher](/referral-component/custom-launcher)) to draw attention to the activity with the referral program without being too distracting from your core product experience. ![Badge examples with Cello Button and Cello Custom Launcher](https://uploads.developerhub.io/prod/d316/fe2vyoz0ncewwupgi0oyrhzmjhf5xhthd8w82enr6ke8lcem0tqz710rs6eixdlb.png) | Type | Description | | - | - | | "New referrer activation" alert | Displayed after referrer has used the product more then 1 day after signs up to bring subtle attention to the referral program. | | "Successful share" alert | Displayed every time referrer has a new link view. | | "New reward" alert | Displayed every time the referrer receives a new signup or reward. | ### Announcement Announcements are callout style message that appears anchored to the launcher, either Cello button or [Custom Launcher](/referral-component/custom-launcher). Announcements can be dismissed by clicking on them or their "X" dismiss button. ![Announcement examples anchored Cello Button or Cello Custom Launcher](https://uploads.developerhub.io/prod/d316/zrkmyalf4bqkeap8lqpeo5rjfmfo0tei9aiotdeosqb12znuft2ezcasd3d1xta5.png) | Type | Description | | - | - | | "New referrer activation" announcement | Sent 3 days after a ["New referrer activation" alert](#alert-and-badge) is sent and the user has not acted on it. | | "New reward" announcement | Sent if the user has not entered their payment details after 7 days of receiving the first reward. | ### Email Emails are a way to keep your users aware and engage with the referral program without them needing to log into the application. By default, Cello will send emails about the key events in the referral lifecycle. ![Standard email template examples](https://mintcdn.com/cello/exsJfd7wvZFYUJmJ/images/Cello-email-templates-welcome-email-successful-share-new-reward.png?fit=max\&auto=format\&n=exsJfd7wvZFYUJmJ\&q=85\&s=cac9a84ad74b070e62e55756eda1eb9d) > [!NOTE] > > Don't forget to add user email to the [boot command of the Referral component](/sdk/client-side/cello-js#3-initialize-the-library) to start sending emails to your users. | Type | Description | | - | - | | "Welcome" email +10% activation | By default is sent on the 6th day after new referrer first signs up to introduce the referral program and its details. | | "Successful share" email | Sent once when the referrer gets a first successful share, i.e. someone has viewed their link, to keep the momentum and encourage more sharing. | | "New reward" email | Sent every time the referrer receives a new reward. When referrer gets a first monetary reward this email contains information on how to claim the rewards. | | "Unclaimed rewards" email | Sent if the user has not entered their payment details after 7 days of receiving the first reward. | ## Default notification journey Below is an illustration of the default new referrer's journey with key milestones and how Cello uses different types of notifications to keep them informed and engaged. ![Default notification journey](https://uploads.developerhub.io/prod/d316/at41hnhzvn4nytinw2emmltsrdimxnm2tcnrpmnjbeyp6n8nhtkyhp85b4ww0gub.png) ## Activation campaign In addition to the default notification journey, you can run **an activation campaign** with Cello to activate users for your referral program with recurring announcements. ![Default activation campaign sequence](https://uploads.developerhub.io/prod/d316/5w3a355er95x3bpwl0zojtks25pfkv1g3j92iq0a9d1k2wqzvlc8pvjluwe0exyy.png) **How it works:** 1. Activation campaign starts 30 days after ["New referrer activation" announcement](#announcement) is sent and the user has not acted on it. 2. The recurring announcements will be only send if the user full-fills a certain activity pattern in the product like: * Referrer has used the app at least once after reading the last announcement. * Last activation announcement was read. * Referrer didn't share in the last 30 days. ## Notification settings You can preview and configure which notifications you want Cello to send in your [Cello Portal](https://app.cello.so/user-experience/notifications/essential). ![Cello Portal notifications settings](https://uploads.developerhub.io/prod/d316/ggs0vibypp72j23retxz0c1ulfms994igbbt398l7f53j7mmjw6ewcfmvw04ucng.png) Cello distinguishes between **Essential** and **Engagement** notifications. Essential notifications are **always on** as they are required for the program to run successfully. You can choose to turn off Engagement notifications, however, they do give a significant performance improvement. ## Email template customization You can customize the look and feel of your email templates directly in the [Cello Portal](https://app.cello.so/user-experience/emails). Open any email notification row to bring up the preview panel - editable elements are highlighted on hover. ![Email template customization in Cello Portal](https://mintcdn.com/cello/exsJfd7wvZFYUJmJ/images/cello-email-upload-logo-change-cta-upload-presentation-image.png?fit=max\&auto=format\&n=exsJfd7wvZFYUJmJ\&q=85\&s=dbd25fb1cfc0cdddae904739d564595d) > [!NOTE] > > Customizations apply to **all email types** at once. You can open any individual email preview to see how your changes look across different templates. ### Customizable options | Option | Description | | - | - | | Logo | Upload your company logo. Hover over the logo in the preview and click to replace it. | | Presentation image | Upload a hero image displayed prominently in the email body. Hover over the image in the preview and click to replace it. | | CTA link | Set the URL for the main call-to-action button. Hover over the button in the preview and click to edit. | The **Welcome email** has one additional option: a **second CTA link**, letting you direct new users to a specific page alongside the referral program link. ### How to customize 1. Go to **Emails** in the [Cello Portal](https://app.cello.so/user-experience/emails). 2. Click any email notification row to open its preview panel. 3. Hover over the logo, image, or CTA button - a prompt will appear to click and edit. Changes are applied across all email templates automatically. # Setup Overview Source: https://docs.cello.so/integration-overview Connect MCP, build your integration in pre-launch, verify it, then launch your program Integrating Cello is a path you own end to end: connect the MCP server, build against your real product while your account is still in pre-launch, watch the steps verify themselves, then launch your program. This page covers the whole path. ## Start here ### Connect the Cello MCP server Connect the [Cello MCP server](/mcp/introduction) to your editor before you write any code. Your coding tool then has live access to Cello's docs, your integration's health, and best-practice recommendations, so it can tell you what to build next and flag what's still missing. It is also where your integration status lives, so connecting it is how you check your work as you go, not just how you build faster. > [card] [MCP introduction](/mcp/introduction) > [card] [Connect your client](/mcp/connect) ### Know where you're building Everything below happens in your **production** account, while it is still in **pre-launch phase**. Events are recorded as test data, nothing is paid out, and notifications don't send until you launch your program. You don't need a sandbox for any of it. If integrating in a separate environment suits your development process better, a sandbox is available under **My account** in the portal, and everything there stays test data as well. ### Select your event sources Cello can't recognise your events until a **signup source** and a **purchase source** are both set in the portal. Until they are, nothing you build will flip to verified. > [!NOTE] > > Stripe or Chargebee can only be your signup source if your payment-provider customer is created **at signup**. If the customer is created **at first purchase**, use the Cello API to send `new-signup` at the real signup moment instead. ## Build your integration Effort: \~1 day with MCP connected ![Cello setup overview 4 steps](https://mintcdn.com/cello/9JNJovQSvwIBkkI9/images/cello-setup-overview.png?fit=max\&auto=format\&n=9JNJovQSvwIBkkI9\&q=85\&s=de7a09d4356f5387ddd4dd46d8a23bde) These four steps mirror the tasks on the Technical integration page in the portal, and each one flips to **Verified from your setup** on its own once Cello sees it working in your product. Complete them regardless of your tech stack or payment gateway. With the MCP server connected, your coding tool writes most of this and checks its own work as it goes, so the four steps together are typically about a day of coding. Without it, expect longer. The portal labels the same work slightly differently: Add the referral widget, Add attribution library, Track signups, Setup purchase event tracking, and Add discount code. **1. Integrate the referral component** Add referral functionality to your web application with Cello's embeddable Referral Component. > [card] [Referral Component Quickstart](/referral-component/quickstart) You can also integrate the Cello Referral Component into your mobile apps. Choose the appropriate SDK for your platform: > [card] [iOS SDK](/sdk/mobile/ios) > [card] [Android SDK](/sdk/mobile/android) > [card] [React Native SDK](/sdk/mobile/react-native) **2. Capture referral codes on landing pages** Set up a [Referral Landing Page](/guides/user-experience/optimizing-landing-pages) and capture referral codes (`ucc`) when users click referral links. For Web signup flow, follow this guide: > [card] [Web signup flow](/attribution/for-web) Or choose the appropriate guide for your flow: > [card] [Mobile signup flow](/attribution/for-mobile) > [card] [HubSpot forms](/attribution/hubspot) > [card] [Typeform forms](/attribution/typeform) **3. Track signups** When users sign up or express interest in your product, attribute these events to their referrer for potential future rewards. Choose your preferred method to send signup events to Cello: > [card] [Track signups](/attribution/tracking-signups) > > Complete guide for tracking signup events > [card] [POST /events endpoint](/api-reference/generic-events/send-event) > > API reference for sending events **4. Track purchases** Complete the conversion tracking by sending purchase events to Cello when users make payments. Choose your integration method based on your payment gateway: > [card] [Track purchases](/attribution/tracking-purchase) > > Complete guide for tracking purchase events > [card] [Apply discounts](/attribution/apply-discounts) > > Apply discounts to referred users when creating a subscription > [card] [Stripe Webhook](/integrations/webhooks/stripe-webhook) > > Stripe webhook integration for purchase events > [card] [Chargebee Webhook](/integrations/webhooks/chargebee-webhook) > > Chargebee webhook integration for purchase events ## Integration Guides Ready-to-use webhook integrations for Stripe and Chargebee provide the **fastest path** to track referral conversions automatically. > [!TIP] > > These guides are **optimized for the typical freemium scenario with Stripe or Chargebee**. > > Use one of these guides if you: > > * Create a Stripe or Chargebee customer on signup > * Use the Stripe or Chargebee webhook to send Cello referral conversion events > [card] [Stripe Webhook Quickstart](/attribution/use-cases/stripe) > [card] [Chargebee Webhook Quickstart](/attribution/use-cases/chargebee) ## Performance enhancements Recommended, not required The portal also shows **recommendations** (if they're enabled for your account): enhancements scored across activation, sharing and conversion. See [Performance Recommendations](/guides/attribution/recommendations) for how the score works. They don't block **Launch program**, but they are **what separates a program that performs from one that merely works**. A referral program users can't find doesn't get used, however correct the integration behind it is. These are as much user-experience decisions as technical ones, so they may take some alignment before you build - worth starting that early. They're also much easier to fold in while you're already in the code, since they touch your navigation, your product's key moments and your checkout. > [!NOTE] > > Shipping a minimal integration first and adding these later is a legitimate plan - just expect your performance numbers to stay low until they're done. > [!TIP] > > **Ask your coding tool about recommendations.** With the Cello MCP connected, ask *"what recommendations apply to my program, and which of them need code changes rather than portal configuration?"* You get your own scored list, with the code work separated from what's only portal configuration. ## Verify and launch Work through the pre-launch testbook while you build, and again at the end. It covers the manual, front-end checks Cello can't see for you: whether the referral component sits well in your UI, whether the new-user banner reads correctly, and whether the discount math is right on both monthly and yearly plans. > [card] [Pre-launch Testbook](/guides/integration/pre-launch-testbook) The **Go live** card in the portal stays locked while anything is outstanding. Once every task is complete, **Launch program** opens a short pre-launch checklist asking you to confirm you have tested: * The referral widget loads and opens for signed-in users * Notifications work: badge, announcement, email * New users land on the correct page from a referral link * The new-user discount shows correctly at checkout * Signups and purchases are attributed correctly > [!WARNING] > > Launching takes your account out of pre-launch and **can't be undone**. From that point rewards pay out, notifications reach real referrers, fraud checks run, the payout delay applies, and all new data is treated as live. To test changes after launch, use a sandbox. # Introduction Source: https://docs.cello.so/integrations/introduction Connect Cello to your payment gateway, CRM, and other systems Cello provides flexible integration options to connect with any payment provider, CRM, or custom system. Choose the approach that best fits your architecture. ## Integration Methods ### Pre-built Webhooks Ready-to-use webhook integrations for popular payment providers. These provide the fastest path to track referral conversions automatically. > [card] [Stripe Webhook](/integrations/webhooks/stripe-webhook) > > Automatically track Stripe payments > [card] [Chargebee Webhook](/integrations/webhooks/chargebee-webhook) > > Track Chargebee subscriptions ### Cello REST API Did not find an integration for your system? Send conversion events from any system using our REST API. Perfect for connecting payment gateways (e.g. Paddle, Recurly, etc.), CRMs (e.g. Hubspot, Salesforce, etc.), or in-house built CRMs or billing systems. > [card] [Setup Overview](/integration-overview) > > The full path to a live program with any CRM or payment gateway: build in pre-launch, verify, then launch > [card] [Cello API](/api-reference/introduction) > > Send conversion events, validate referral codes, and manage referral links programmatically ### Debugging & Monitoring Once your integration is set up, check your **integration status** for a high-level health view, and use the **event feed** to drill into individual events when you need to troubleshoot validation issues. > [card] [Integration health check](/mcp/developers/integration-status) > > Get an at-a-glance health view across the four core integration components, from your editor > [card] [Event Feed Guide](/guides/support/portal/event-feed) > > Inspect every incoming event with per-field validation ## Next steps Choose your integration based on your setup: > [accordion] I use Stripe or Chargebee and customer is created in payment gateway at signup > > Follow one of our quickstart guides for **pre-built webhook integrations** for the fastest setup. > > > [card] [Stripe Webhook Quickstart](/attribution/use-cases/stripe) > > > [card] [Chargebee Webhook Quickstart](/attribution/use-cases/chargebee) > [accordion] I use Stripe or Chargebee and customer is created in payment gateway at purchase > > Use the **Cello API** to send signup events and **Stripe or Chargebee webhook** to send purchase events from your payment provider. > > > [card] [Cello API](/api-reference/introduction) > > > > Send signup events > > > [card] [Stripe Webhook](/integrations/webhooks/stripe-webhook) > > > > Automatically track Stripe payments > > > [card] [Chargebee Webhook](/integrations/webhooks/chargebee-webhook) > > > > Track Chargebee subscriptions > [accordion] I have a different payment gateway (not Stripe nor Chargebee) > > **Cello API** gives you full control over when and how to track conversions. Send events from your backend whenever a signup or purchase occurs. > > > [card] [Setup Overview](/integration-overview) > > > > The full path to a live program with any CRM or payment gateway: build in pre-launch, verify, then launch > > > [card] [Cello API](/api-reference/introduction) > > > > Send conversion events, validate referral codes, and manage referral links programmatically > [!NOTE] > > All integration methods support both sandbox and production environments, allowing you to test thoroughly before going live. # Salesforce Apex Triggers + Cello API Source: https://docs.cello.so/integrations/salesforce-apex-triggers This documentation guides you through the process of setting up Apex triggers in Salesforce to handle specific conditions related to Opportunities This documentation guides you through the process of setting up Apex triggers in Salesforce to handle specific conditions related to Opportunities. The exemplary trigger will be designed to execute when an Opportunity meets two criteria: 1. The opportunity moved to the stage `Proposal/Price Quote` 2. It has a value in the custom field `cello_ucc` > [!NOTE] > > Adjust according to your individual Salesforce setup and referral requirements > > Customize the code as needed based on your individual Salesforce setup. Cello requires at least a "demo done" event as well as a the revenue transactions of won opportunities. ### Apex Trigger Configuration ### 1. Create an Apex Trigger Find detailed documentation on [Apex triggers in the Salesforce docs](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers.htm). Navigate to Setup in Salesforce and follow these steps,: * In the Quick Find box, type "Triggers" and select "Apex Triggers." * Click "New Trigger" to create a new trigger. ```apex theme={null} trigger OpportunityTrigger on Opportunity (after update) { OpportunityHandler.handleOpportunityUpdate(Trigger.new); } ``` ### 2. Create an Apex Class Now, create an Apex class to handle the logic and API call. Implement the call to the [Cello API](/api-reference/introduction) in the placeholder method `makeApiCall` in the below code. This configuration ensures that the Cello API is triggered when an Opportunity meets the specified criteria. Customize the code as needed based on your individual Salesforce setup, API requirements and endpoint. ```apex theme={null} public class OpportunityHandler { public static void handleOpportunityUpdate(List updatedOpportunities) { for (Opportunity opp : updatedOpportunities) { // Check criteria: Opportunity in Proposal/Price Quote stage and cello_ucc value if (opp.StageName == 'Proposal/Price Quote' && opp.Cello_UCC__c != null) { // Make the API call makeApiCall(opp.Id, opp.Cello_UCC__c); } } } private static void makeApiCall(Id opportunityId, String celloUccValue) { // Your code to make the API call using HTTP methods, e.g., HttpRequest and HttpResponse // Example: // HttpRequest req = new HttpRequest(); // req.setEndpoint('your API endpoint'); // req.setMethod('POST'); // req.setHeader('Content-Type', 'application/json'); // req.setBody('{"opportunityId": "' + opportunityId + '", "celloUccValue": "' + celloUccValue + '"}'); // HttpResponse res = new Http().send(req); } } ``` ### 3. Test and Deploy * Test your trigger and class in the sandbox environment to ensure proper functionality. * Reach out to the Cello team to confirm that provided event data is correct. * Deploy the trigger and class to your production environment once testing is successful. > [!NOTE] > > Important Notes > > * **Bulk Processing**: Ensure that your Apex trigger can handle bulk updates, as Salesforce triggers operate in bulk. > * **Error Handling**: Implement appropriate error handling in your Apex class to manage API call failures. # Cello + Supabase integration Source: https://docs.cello.so/integrations/supabase How to add user referrals to your app built on Supabase Add a fully automated referral program to your Supabase app using **Auth metadata**, **Database Webhooks**, and **Edge Functions**. ![Cello + Supabase integration](https://mintcdn.com/cello/fRrhh-kMKt2ac_Xc/coding-apps/supabase_cello.png?fit=max\&auto=format\&n=fRrhh-kMKt2ac_Xc\&q=85\&s=8328df795f2c3823c761b88ba6b923df) ## Prerequisites Before integrating Cello, ensure the following: * Your app uses **Supabase Auth** for user signup and authentication * Your app has a **Stripe** subscription or payment flow (for purchase tracking) * You have a **Cello account** with your **Product ID**, **Product Secret**, and **API access keys** from [Developers → Access keys](https://app.cello.so/developers/access-keys) > [!NOTE] > > You can integrate directly on production - your account stays in **pre-launch phase** until you launch, so all events are recorded as test data and nothing is paid out. A sandbox is optional if you prefer a separate environment. ## Connect the Cello MCP Connect the [Cello MCP server](/mcp/introduction) to your AI coding tool - it gives your tool access to Cello's docs, your integration status, and best practices so your AI can handle the implementation and check its own work. > [card] [Cello MCP Server](/mcp/connect) > > Setup instructions for Cursor, VS Code, and Lovable # Step 1: Capture referral codes on your landing page Add the [Cello attribution script](/sdk/client-side/attribution-js-introduction) to your referral landing page to capture the referral code (`ucc`) when users click referral links: 1. Install the attribution script. Choose the option best suited for your setup: > [card] [Embedded Script Tag](/sdk/client-side/embedded-script-tag) > [card] [Google Tag Manager](/sdk/client-side/google-tag-manager) 2. Verify the installation > [!TIP] > > To verify, follow these steps: > > 1. Add `?productId=test` and `?ucc=test` to your website URL > > ```html theme={null} > https://yourwebsite.com/?productId=test&ucc=test > ``` > 2. Make sure that these values are saved in the cookies as `cello-product-id` and `cello-referral` > 3. Navigate to your signup page and try to access the ucc using the `getUcc()` method from the browser console > > ```javascript theme={null} > window.CelloAttribution('getUcc') > ``` > > This method should return a promise with value `test` > > ```javascript theme={null} > Promise {: 'test'} > ``` > > **If this check passes, the script is installed correctly.** # Step 2: Track signups with Supabase Auth + Edge Functions This is the Supabase-specific step. You will pass the referral code through Supabase Auth, then use a Database Webhook and Edge Function to send the signup event to Cello. ## 2a. Pass the referral code through Supabase Auth signup During signup, retrieve the `ucc` and store it in the user's `raw_user_meta_data`: ```js theme={null} import { createClient } from '@supabase/supabase-js' const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY) const ucc = await window.CelloAttribution('getUcc') const { data, error } = await supabase.auth.signUp({ email: 'user@example.com', password: 'password', options: { data: { ucc: ucc ?? null, }, }, }) ``` ## 2b. Deploy an Edge Function to send signup events to Cello Create an Edge Function that receives the Database Webhook payload and sends a `new-signup` event to the Cello [`POST /events`](/api-reference/generic-events/send-event) API. All Cello referral events use `eventName: 'ReferralUpdated'` - the `trigger` field inside `context.event` specifies the event type (`new-signup`, `invoice-paid`, etc.). ```bash theme={null} supabase functions new cello-track-signup ``` > [accordion] supabase/functions/cello-track-signup/index.ts > > ```typescript theme={null} > import { serve } from 'https://deno.land/std@0.177.0/http/server.ts' > > async function getCelloAccessToken(): Promise { > const response = await fetch('https://api.cello.so/token', { > method: 'POST', > headers: { 'Content-Type': 'application/json' }, > body: JSON.stringify({ > accessKeyId: Deno.env.get('CELLO_ACCESS_KEY_ID'), > secretAccessKey: Deno.env.get('CELLO_SECRET_ACCESS_KEY'), > }), > }) > > if (!response.ok) { > throw new Error(`Failed to get Cello token: ${await response.text()}`) > } > > const { accessToken } = await response.json() > return accessToken > } > > serve(async (req: Request) => { > const payload = await req.json() > const record = payload.record > > const ucc = record.raw_user_meta_data?.ucc > const userId = record.id > const email = record.email > > if (!ucc) { > return new Response('No referral code - skipping', { status: 200 }) > } > > const accessToken = await getCelloAccessToken() > > const response = await fetch('https://api.cello.so/events', { > method: 'POST', > headers: { > 'Authorization': `Bearer ${accessToken}`, > 'Content-Type': 'application/json', > }, > body: JSON.stringify({ > eventName: 'ReferralUpdated', > payload: { > ucc, > newUserId: userId, > }, > context: { > newUser: { > id: userId, > email, > }, > event: { > trigger: 'new-signup', > timestamp: new Date().toISOString(), > }, > }, > }), > }) > > if (!response.ok) { > console.error('Cello signup tracking failed:', await response.text()) > return new Response('Error', { status: 500 }) > } > > return new Response('OK', { status: 200 }) > }) > ``` Set your Cello API access keys. You can find these in your [Cello Portal](https://app.cello.so/developers/access-keys): ```bash theme={null} supabase secrets set CELLO_ACCESS_KEY_ID=your_access_key_id supabase secrets set CELLO_SECRET_ACCESS_KEY=your_secret_access_key ``` Deploy the function: ```bash theme={null} supabase functions deploy cello-track-signup --no-verify-jwt ``` > [!NOTE] > > The `--no-verify-jwt` flag is required because the function is called by a Database Webhook, not by an authenticated user. ## 2c. Create a Database Webhook on auth.users In your [Supabase Dashboard](https://supabase.com/dashboard), go to **Database → Webhooks** and create a new webhook: | Setting | Value | | - | - | | Name | `cello-track-signup` | | Table | `auth.users` | | Events | `INSERT` | | Type | Supabase Edge Functions | | Edge Function | `cello-track-signup` | Click **Create webhook**. > [!TIP] > > Every time a new user signs up via Supabase Auth, the Edge Function fires automatically and sends the referral attribution to Cello. # Step 3: Connect Stripe Webhook for purchase tracking To send Cello purchase events, connect your Stripe Webhook to Cello. When creating a Stripe Customer, pass the referral metadata so Cello can attribute conversions: ```js theme={null} const customer = await stripe.customers.create({ email: 'user@example.com', metadata: { cello_ucc: ucc, // referral code stored during signup new_user_id: supabaseUserId, // must match the productUserId used to boot the widget new_user_organization_id: orgId, // optional - for organization-level referrals }, }) ``` > [!TIP] > > Cello uses the `customer.created` event to link the Stripe customer to the referral attribution captured in Step 2. Subsequent `invoice.paid` events trigger purchase tracking and reward calculation. Follow this guide to connect the webhook: > [card] [Stripe Webhook](/integrations/webhooks/stripe-webhook) > > Send events using Stripe Webhook # Step 4: Integrate the Referral Component Integrate the Cello Referral Component into your web app so your users can share their referral link. The component is installed using Cello JS - our client-side SDK. You can install it by: 1. Adding a script tag to the `` of your application 2. Generating a JWT token for user authentication 3. Booting the component with the provided token and user details Follow this installation guide: > [card] [Referral Component Quickstart](/referral-component/quickstart) > [!WARNING] > > Cello requires a **server-side JWT token** signed with your `PRODUCT_SECRET` - this is **not** the Supabase session token (`session.access_token`). You must generate a separate token on your backend. See [User Authentication](/sdk/client-side/user-authentication) for details. ## Verify your integration Use [Developers → Events](https://app.cello.so/developers/events) in the Cello Portal to confirm that signup and purchase events are arriving correctly and all required fields pass validation. See the [Event Feed guide](/guides/support/portal/event-feed) for details on what to check. ## Next steps > [card] [Referral Component](/referral-component/introduction) > > Customise how the referral widget looks and behaves in your app > [card] [Track Purchases](/attribution/tracking-purchase) > > Set up purchase conversion tracking via Stripe webhooks > [card] [Apply Discounts](/attribution/apply-discounts) > > Offer new user discounts as part of your referral program > [card] [Cello MCP Server](/mcp/introduction) > > Connect Cursor or Lovable to Cello for AI-assisted integration # Chargebee Webhook Source: https://docs.cello.so/integrations/webhooks/chargebee-webhook Send signup and purchase events to Cello using Chargebee Webhook Cello makes it easy to **connect securely to your Chargebee payment provider** to automate transaction events, attribution, and payouts. Transactions are monitored and used to pay out referrers based on your campaign reward rules. # Overview A notification event is securely sent to Cello through the webhook endpoint every time a customer makes a purchase or a customer record is created or updated. Cello checks these events to perform the following actions: * Determine if a reward for the referrer needs to be created and paid out * Inform the referrer about new signups and rewards * Cancel recurring rewards if a subscription is cancelled > [!WARNING] > > If the automation of Cello detects unclear cases the automation will be paused and Cello will reach out to you to clarify the case. > [!TIP] > > After setting up the webhook, ask your coding tool for a Cello [integration health check](/mcp/developers/integration-status) to confirm Cello is receiving events from Chargebee. If a component shows a warning or error, open [Developers → Events](https://app.cello.so/developers/events) to drill into individual events and see which fields are failing validation. # Endpoint URLs You will find the webhook endpoint URL for both **Sandbox** and **Production** environments in [Developers → Webhooks](https://app.cello.so/developers/webhooks). # Securing the webhook To secure the webhook in Step 5, you will find credentials for both **Sandbox** and **Production** environments in [Developers → Webhooks](https://app.cello.so/developers/webhooks). # Connecting Chargebee ## Prerequisites Before configuring webhooks, ensure your Chargebee customers include the required Cello attribution fields. These information enables proper attribution and reward tracking. > [!NOTE] > > **When to add additional fields:** > > * If you create Chargebee customers at signup → You would have already added metadata or custom fields to the customer during the [Setup Step "Track Signups"](/attribution/tracking-signups) > * If you create Chargebee customers at purchase → Make sure to add metadata or custom fields when creating the customer ### Required Chargebee Customer attribution fields > [!NOTE] > > You can also choose to use **Chargebee custom fields (CF\_)** to add referral data to the event. Learn more about custom fields in the [**Chargebee documentation**](https://www.chargebee.com/docs/billing/2.0/site-configuration/custom_fields) Pass the following fields during checkout in the [Customer Object](https://apidocs.chargebee.com/docs/api/customers) to `meta_data` attribute or as a `cf_` custom field. | Field | Description | Chargebee Object | | - | - | - | | `cello_ucc` | Referral code identifying the referrer | [Customer Object](https://apidocs.chargebee.com/docs/api/customers) to `meta_data` attribute or as a `cf_` custom field | | `new_user_id` | Your system's unique user ID. Same as `productUserId` used in [Referral Component](/referral-component/introduction) when booting the SDK | [Customer Object](https://apidocs.chargebee.com/docs/api/customers) to `meta_data` attribute or as a `cf_` custom field | | `new_user_organization_id` | Organization ID (optional). Required only for organization-level referrals and rewards | [Customer Object](https://apidocs.chargebee.com/docs/api/customers) to `meta_data` attribute or as a `cf_` custom field | | `coupon` | New user discount code. Learn how to apply discounts in this [guide](/attribution/apply-discounts). | [Customer Object](https://apidocs.chargebee.com/docs/api/customers) to `meta_data` attribute or as a `cf_` custom field | ## Steps You will add a webhook to your Chargebee configuration to connect Chargebee and Cello. This can be done in both test and production environments separately. ![Chargebee webhook configuration in Cello Portal](https://mintcdn.com/cello/6Zr08teY9AER0ncF/integrations/webhooks/integrations-chargebee-webhook-1.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=5145a0ff810ec3c0b2433c927380fb6d) **1. Log into your Chargebee Dashboard** **2. Add a new Webhook** From the sidebar, select Settings > Configure Chargebee and click on "Webhooks". Next Click on "+ Add Webhook". **3. Enter the Endpoint URL** Choose the Endpoint URL corresponding to the environment you are setting up: **Sandbox** or **Production**. **4. Select the events to send** Select the events you want to send under "Events to Send": 1. `Customer Created`, `Customer Changed`, `Customer Deleted` 2. `Payment Succeeded`, `Payment Refunded`, `Payment Failed` **5. Secure the webhook** Select "Protect webhook URL with basic authentication" and add the `product_id` and `secret` provided in the Cello Portal. > [!WARNING] > > Be sure to select **Exclude card Information from webhook call** **6. Click "Create" to enable the webhook** Webhook created! # Stripe Webhook Source: https://docs.cello.so/integrations/webhooks/stripe-webhook Send signup and purchase events to Cello using Stripe Webhook Cello makes it easy to **connect securely to your Stripe payment provider** to automate transaction events, attribution, and payouts. Transactions are monitored and used to pay out referrers based on your campaign reward rules. # Overview A notification event is securely sent to Cello through the webhook endpoint every time a customer makes a purchase or a customer record is created or updated. Cello checks these events to perform the following actions: * Determine if a reward for the referrer needs to be created and paid out * Inform the referrer about new signups and rewards * Cancel recurring rewards if a subscription is cancelled > [!WARNING] > > If the automation of Cello detects unclear cases the automation will be paused and Cello will reach out to you to clarify the case. > [!TIP] > > After setting up the webhook, ask your coding tool for a Cello [integration health check](/mcp/developers/integration-status) to confirm Cello is receiving events from Stripe. If a component shows a warning or error, open [Developers → Events](https://app.cello.so/developers/events) to drill into individual events and see which fields are failing validation. # Endpoint URLs You will find the webhook endpoint URL in [Developers → Webhooks](https://app.cello.so/developers/webhooks). # Connecting Stripe ## Prerequisites Before configuring webhooks, ensure your Stripe customers include the required Cello metadata. This metadata enables proper attribution and reward tracking. > [!NOTE] > > **When to add metadata:** > > * If you create Stripe customers at signup → You would have already added metadata to the customer during the [Setup Step "Track Signups"](/attribution/tracking-signups) > * If you create Stripe customers at purchase → Make sure to add metadata when creating the customer ### Required Stripe Customer Metadata Pass the following fields during Stripe Checkout in the [Customer Object](https://docs.stripe.com/api/customers/object?api-version=2024-09-30.acacia#customer_object-metadata) and [Checkout Session object](https://docs.stripe.com/api/checkout/sessions/object?api-version=2025-07-30.basil) | Field | Description | Stripe Object | | - | - | - | | `cello_ucc` | Referral code identifying the referrer | Stripe [Customer Object](https://docs.stripe.com/api/customers/object?api-version=2024-09-30.acacia#customer_object-metadata), attribute:`metadata` | | `new_user_id` | Your system's unique user ID. Same as `productUserId` used in [Referral Component](/referral-component/introduction) when booting the SDK | Stripe [Customer Object](https://docs.stripe.com/api/customers/object?api-version=2024-09-30.acacia#customer_object-metadata), attribute:`metadata` | | `new_user_organization_id` | Organization ID (optional). Required only for organization-level referrals and rewards | Stripe [Customer Object](https://docs.stripe.com/api/customers/object?api-version=2024-09-30.acacia#customer_object-metadata), attribute:`metadata` | | `coupon` | New user discount code. Learn how to apply discounts in this [guide](/attribution/apply-discounts). | Stripe [Checkout Session object](https://docs.stripe.com/api/checkout/sessions/object?api-version=2025-07-30.basil), attribute: `discount` | ## Steps You will add a webhook to your Stripe configuration to connect Stripe and Cello. This can be done in both test and production environments separately. **1. Log into your Stripe Dashboard** **2. Go to Developer Mode** Select Developers from the upper right menu. ![Stripe webhook endpoint configuration in Stripe Dashboard](https://mintcdn.com/cello/6Zr08teY9AER0ncF/integrations/webhooks/integrations-stripe-webhook-1.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=9e16e9e07b1615123ba6c99ebcd0be50) **3. Add a Webhook endpoint** You can find Webhooks at the left menu. Next click Add an endpoint. ![Adding Cello webhook endpoint URL in Stripe Dashboard](https://mintcdn.com/cello/6Zr08teY9AER0ncF/integrations/webhooks/integrations-stripe-webhook-5.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=261056d50c0753b6e9d93b2264d047a4) **4. Enter the Endpoint URL** Choose the Endpoint URL corresponding to the environment you are setting up: **Sandbox** or **Production**. ![Stripe webhook event selection for customer.created events](https://mintcdn.com/cello/6Zr08teY9AER0ncF/integrations/webhooks/integrations-stripe-webhook-4.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=2ca7792c64f23e42a4f59242e3e2a713) **5. Select the events to send** To select events, do the following steps: 1. Select "Events on your account" 2. Select your latest API version 3. Choose events to send: 1. `charge.refunded`, `charge.succeeded`, `charge.updated` 2. `customer.created`, `customer.deleted`, `customer.updated` 3. `customer.subscription.created`, `customer.subscription.deleted`, `customer.subscription.updated` 4. `invoice.paid` ![Stripe webhook signing secret for authentication](https://mintcdn.com/cello/6Zr08teY9AER0ncF/integrations/webhooks/integrations-stripe-webhook-3.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=e155189ecb1b7020104af183792249f4) **6. Click "Add endpoint"** Webhook created! **7. Secure the Webhook** To secure the connection, you need to add the “Signing secret” to [Stripe Webhook Configuration in Cello Portal](https://app.cello.so/developers/webhooks). > [!NOTE] > > Stripe Webhook Signing secret starts with `whsec_` 1. Click “Reveal” and copy the Signing secret 2. Add the Signing secret to Stripe webhook settings in the [Cello portal](https://app.cello.so/developers/webhooks). ![Cello Portal webhook configuration for Stripe integration](https://mintcdn.com/cello/6Zr08teY9AER0ncF/integrations/webhooks/integrations-stripe-webhook-2.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=c70cdacf5708ef3d3efed75c4fa2abd0) # Introduction Source: https://docs.cello.so/introduction Learn how to turn your users into your most valuable growth channel [Loom video player](https://www.loom.com/embed/b28d6e90e6634bac96aaeba0c70ea564) [Cello](https://cello.so/) is a referral platform for building user and partner referral programs. Cello enables you to: * Embed referral components directly in your application * Track and attribute user signups and purchases * Process payouts in 10+ countries and currencies # How it works You own the integration from first event to launch. You build against your real product while your account is still in pre-launch, verify as you go, and launch the program yourself when everything is in place. **1. Connect the MCP server** Point your AI coding tool at Cello's MCP server first. It has live access to these docs and to your integration's health, so it both builds most of the integration for you and tells you what is still missing. **2. Build on production, in testing mode** You don't need a sandbox. Your account stays in **pre-launch phase** while you integrate: events are recorded as test data, and nothing is paid out or sent to your referrers. **3. Watch the steps verify themselves** Once your signup and purchase event sources are set, each integration step flips to verified on its own as Cello sees it working in your product. The few Cello can't detect, you tick off yourself. **4. Verify with the testbook** Work through the pre-launch testbook while you build, and again at the end. **5. Launch your program** When every step is complete, you launch. Pre-launch ends, and from then on referrals are processed and paid out. # Key Features Cello provides the following capabilities: * [Integrated Referral Component for Web and Mobile apps](/referral-component/quickstart) * [MCP server for AI coding tools and program insights](/mcp/introduction) * [In-product and Email notifications](/guides/user-experience/referral-notifications-and-emails) * [Analytics Dashboard](https://app.cello.so/performance/referrer-activity) * [Partner Program](/guides/partners/partner-overview) * [Integrations and Webhooks](/integrations/introduction) * [Cello API](/api-reference/introduction) # Getting Started Start with the MCP server. Your coding tool then handles most of the integration for you, and it's also how you check your work. > [card] [Integrate faster with AI](/mcp/connect) > > Connect the Cello MCP server to your editor > [card] [Setup Overview](/integration-overview) > > The full path: build in pre-launch, verify, then launch > [card] [Pre-launch Testbook](/guides/integration/pre-launch-testbook) > > Validate your integration end to end before you go live > [card] [Cello SDKs](/sdk/introduction) > > Referral component for your web and mobile applications # Key Concepts Source: https://docs.cello.so/key-concepts Essential terms and concepts for understanding Cello's referral platform and attribution system ## Quick Reference | Term | Description | | - | - | | [**Referrer**](#referrer) | Existing user who shares their unique referral link | | [**New User**](#new-user-referred-user-referee) | Person who receives and uses a referral link | | [**Referral Code (UCC)**](#referral-code-or-ucc-unique-campaign-code) | Unique 11-character identifier for tracking referrals | | [**Partner**](#partner) | Professional referrer with exclusive rewards and dedicated portal | | [**Landing Page Attribution**](#landing-page-attribution-referral-attribution) | Process of capturing and storing referral codes | | [**Referral Conversion Tracking**](#referral-conversion-tracking) | Tracking when referred users complete target actions | | [**Attribution Script**](#attribution-script-attribution-js) | JavaScript library for detecting referral parameters | | [**Referral Component**](#referral-component-cello-js) | Embeddable UI component for referrers | | [**Payment Gateway**](#payment-gateway-or-payment-provider) | Third-party payment processors integrated with Cello | | [**Pre-launch Phase**](#pre-launch-phase-testing-mode) | The state your account is in while you integrate, where all data is test data | | [**Launching Your Program**](#launching-your-program) | Taking your account out of pre-launch so referrals are processed and paid out | | [**Sandbox**](#sandbox) | Optional isolated environment with its own credentials | | [**Event Sources**](#event-sources) | Where Cello expects your signup and purchase events to come from | | [**Recommendations and Score**](#recommendations-and-score) | Enhancements that drive program performance, and how far along you are | *** ## Referrer The existing user (or customer) who initiates the referral by sharing their unique referral link. The referrer is the source of the referral traffic and is typically eligible to receive rewards when the referred user (new user) completes the desired action (e.g., signup, purchase). *** ## New User (Referred User / Referee) The person who receives the referral invitation or link from the referrer and engages with it. They are considered a "new user" if they have not previously registered or purchased. Often called the **referee** in referral programs. *** ## Partner A professional referrer who promotes your product as part of a formal partnership. Unlike regular user referrers, partners typically receive: * **Special reward structures** - Different campaigns from user referrals; can include higher rates, reward caps, or even lifetime rewards * **Dedicated Partner Portal** - Professional dashboard for tracking referrals, conversions, and earnings * **Marketing resources** - Media kits, branded assets, and pre-written promotional content Partners can include affiliates, influencers, agencies, consultants, or other businesses that systematically refer customers. Cello unifies both user referrals and partner programs in a single platform, requiring no additional technical integration beyond the standard referral setup. Learn more about [managing partners](/guides/partners/partner-overview). *** ## Referral Code or UCC (Unique Campaign Code) A unique identifier tied to the referrer. It is a unique set of 11 alphanumeric characters, composed of numbers, uppercase and lowercase letters. It always appears at the end of the referral link. When a new user uses the referral link with a referral code, it allows the system to attribute their actions back to the referrer. **Referral Code** is a more general term for the code shared by the referrer. **UCC (Unique Campaign Code)** refers to the same code but is a specific Cello term which will be used throughout this documentation and in API references. * ucc: `pNRB1aYqArN` * referral link: `moonly.cello.so/pNRB1aYqArN` *** ## Landing Page Attribution / Referral Attribution The process of **capturing and storing the referral code** (`ucc`) when a referred user lands on a [website](/attribution/for-web) or [mobile app](/attribution/for-mobile) via the referral link. This step ensures the system knows **which referrer** brought the user, so later actions (signups, purchases) can be attributed correctly. This step also involves storing the code in a cookie or user record until the user completes a tracked action. *** ## Referral Conversion Tracking The stage where a new user completes the targeted action defined by the referral program. This can include: * [Signups / Tracking Signups](/attribution/tracking-signups): When a new user successfully creates an account. The system links this signup to the referrer. * [Purchases / Tracking Purchases](/attribution/tracking-purchase): When a new user makes a purchase, often the ultimate revenue-driving conversion. *** ## Attribution Script / Attribution JS [Attribution JS is a JavaScript library](/sdk/client-side/attribution-js-introduction) embedded on landing pages that automatically detects referral parameters (`ucc`, `productId`, `referrerName`), stores them in cookies for indirect signups, and provides JS methods to easily retrieve these parameters for further conversion events. *** ## Referral Component / Cello JS The embeddable component provided by the Cello referral platform to handle referral-related functionality for the referrer in your [web or mobile application](/referral-component/introduction). *** ## Payment gateway or payment provider Third-party services that handle payment processing and billing for your application. These platforms (such as Stripe, Chargebee, Paddle, Recurly, etc.) integrate with Cello to enable automatic tracking of referral-driven purchases and revenue attribution. When a referred user makes a purchase through your payment provider, Cello can automatically detect and attribute that conversion back to the original referrer, enabling seamless reward distribution and revenue tracking. *** ## Pre-launch Phase / Testing Mode The state your account is in from the moment you sign up until you launch your program. You integrate and test against your real production account while it is in pre-launch, and everything is treated as test data: events still appear on your dashboards and under **Developers → Events**, marked as testing, but they are not counted in analytics calculations or billing. Rewards are not paid out, the payout delay does not apply, and fraud checks do not run. Notifications still send, reaching your test users when the activity that triggers them happens, so you can test them before you go live. This is why you do not need a separate environment to build in. *** ## Launching Your Program The point where you take your account out of pre-launch. Once every task in your setup checklist is complete, the **Go live** card in the portal unlocks and **Launch program** switches your account to live: rewards pay out, notifications reach real referrers, the payout delay applies, fraud checks run, and all new events are treated as live data. Launching cannot be undone. *** ## Sandbox An optional, fully isolated environment with its own credentials and its own data, available under **My account** in the portal. You do not need one to integrate, because pre-launch already gives you safe test data on production. A sandbox is useful if working in a separate environment suits your development process, or for testing changes after you have launched. *** ## Event Sources Where Cello expects your signup and purchase events to come from, for example the Cello API, a Stripe webhook, a Chargebee webhook, or Auto Attribution. Both a signup source and a purchase source have to be set before Cello can recognise your events, which is what allows your integration tasks to verify themselves. See the [Setup Overview](/integration-overview) for how to choose them. *** ## Recommendations and Score Enhancements the portal suggests to improve how your program performs, grouped into activation, sharing and conversion, and shown if they are enabled for your account. Your **score** summarises how many you have adopted, rated Poor, Okay or Good. Recommendations are separate from your setup tasks and never block launching, but they are what drives program performance once you are live. Some need code, so it is worth knowing which ones apply before you build. See [Performance enhancements](/integration-overview#performance-enhancements) for the developer view, and [Performance Recommendations](/guides/attribution/recommendations) for how the score works. # Manage cookie consent Source: https://docs.cello.so/landing-pages/manage-cookies To ensure compliance with privacy regulations, customers handle cookies and respond to user consent preferences with care and transparency. It is your responsibility to prompt website visitors to specify their preferred tracking level. > [!WARNING] > > Cookie consent is a complex legal subject, varying across different jurisdictions. While the Attribution Library offers tools for managing cookie consent, it is the responsibility of your organization to consult with legal experts to ensure compliance with specific regional laws and regulatory requirements. # Understanding referral cookies The [Attribution JS](/sdk/client-side/attribution-js-introduction) employs a specific first-party cookie to enable returning user to claim their referral discount. This cookie functions as a strictly necessary or essential cookie by default, but **should be configured based on your privacy guidelines**. It's important to note that these cookies **do not directly monitor the identity of returning users.** Instead, it records the referral code, also known as the \[Unique campaign code (`ucc`), originating from the invitation link provided by a referrer and additional parameters to support returning users. > [!NOTE] > > Cookies are not required to directly attribute referrals in Cello. They are used to assist in attributing a referral when a new user leaves and returns to the signup. ## List of first-party referral cookies that are set | Cookie | Purpose | Persistent or Session | Lifespan | Default type | | - | - | - | - | - | | cello-referral | Cello uses `cello-referral` cookie to identify the referrer and campaign. These let us link the referrer and new users who sign up, and help us apply rewards and discounts based on the campaign terms. | Persistent | 3 months | Strictly necessary or essential cookies | | cello-productId | Cello uses `cello-productId` cookie to identify the product (account) using Cello on this page. | Persistent | 3 months | Strictly necessary or essential cookies | | cello-cookie-consent | Cello uses `cello-cookie-consent` cookie to store consent to managing cookies | Persistent | 3 months | Strictly necessary or essential cookie for custom cookie handling | # Methods for Handling Consent The [Attribution JS](/sdk/client-side/attribution-js-introduction) provides several methods for handling user consent efficiently: ## 1. Custom Method > [!NOTE] > > Custom method only works if your account has been configured to use custom cookie handling. Contact Cello Support to enable it. Utilize the [Attribution JS](/sdk/client-side/attribution-js-introduction) JavaScript API to dynamically inform it when a visitor has consented to cookie storage. This method offers full control over the timing of cookie storage, allowing you to align it with your user consent process. ### allowCookies To allow the storage of the referral code cookie: ```javascript theme={null} window.CelloAttribution('allowCookies'); ``` ### deleteCookies To halt the storage of the referral code cookie and clear it: ```javascript theme={null} window.CelloAttribution('deleteCookies'); ``` ## 2. Consent System Method For users of popular cookie management and consent platforms such as OneTrust, CookieBot, and Civic Cookie Control, the [Attribution Library](/sdk/client-side/attribution-js-introduction) offers built-in support for seamless integration. Our Cello support team can assist you in configuring the right tool for your specific needs, eliminating the need for coding. ### Supported Tools * OneTrust New * CookieFirst Coming Soon * CookieBot Coming Soon * Civic Cookie Control Coming Soon These methods allow you to handle cookie consent effectively when utilizing the [Attribution JS](/sdk/client-side/attribution-js-introduction) to track returning referees seamlessly. # Integrate with AI Source: https://docs.cello.so/llm-quickstart Connect the Cello MCP server to your coding tool, then let it build and verify your integration Your AI coding tool can do most of a Cello integration for you. Connect the Cello MCP server first: it gives your tool live access to your integration's health and your incoming events, plus the ability to search Cello's documentation - including the pre-launch testbook - so it knows both what to build and whether what it built is working. ## Connect the Cello MCP server Open **My account → MCP Server** in the [Cello Portal](https://app.cello.so/mcp), turn the server on, and use the one-click connect for your tool - or the generic option if it doesn't have its own card yet. There is no token to generate or paste. > [card] [MCP introduction](/mcp/introduction) > [card] [Connect your client](/mcp/connect) Once connected, your tool can search the docs, check your integration status, and inspect individual events without you pasting anything into the chat. See the [developer tools reference](/mcp/developers/tools) for what it can do. ## See it in action: Cursor + Cello Watch a walkthrough of adding user referrals to your app with Cursor - from referral widget and attribution to signup tracking and Stripe conversion. > [accordion] Watch the walkthrough > > [Cello + Cursor integration walkthrough](https://www.loom.com/embed/70f4b664bb6e44a69510b44110a55d5c?autoplay=0) For the full prompt, steps, and acceptance criteria, see the [Cursor integration guide](/coding-apps/cursor-integration). ## Pick your tool guide Each guide covers the same end-to-end integration for a specific tool: **referral widget**, **public attribution**, **signup tracking** and **Stripe conversion tracking**, with acceptance criteria and the known gotchas (JWT claims, script URLs, event payload shape, Stripe metadata). > [card] [Claude Code](/coding-apps/claude-integration) > [card] [Cursor](/coding-apps/cursor-integration) > [card] [Lovable](/coding-apps/lovable-integration) > [card] [Replit](/coding-apps/replit-integration) > [card] [Bolt](/coding-apps/bolt-integration) > [card] [Codex](/coding-apps/codex-integration) ## Verify what your tool built Ask your coding tool for your integration status as you go, and work through the pre-launch testbook before you launch. The testbook covers the manual, front-end checks that neither Cello nor your AI tool can see for you. > [card] [Pre-launch Testbook](/guides/integration/pre-launch-testbook) ## If your tool doesn't support MCP Some tools can't connect to an MCP server. In that case, give your AI the documentation as plain context instead: ``` https://docs.cello.so/llms-full.txt ``` Copy/paste starter message: ``` Use the Cello documentation from this URL as the source of truth: https://docs.cello.so/llms-full.txt Follow the docs exactly and avoid guessing common patterns. If something is ambiguous, ask clarifying questions before coding. ``` For tools that can't fetch URLs either, open [llms-full.txt](https://docs.cello.so/llms-full.txt), select all, and paste it in as context before your questions. > [!WARNING] > > This is a documentation snapshot, not a live connection. Your AI gets the guides, but no integration status, no event inspection, and no testbook, so you will need to verify your integration yourself in the portal. The file is also large (\~73,000 tokens), so it needs a tool with a big context window. ## Troubleshooting | Issue | Solution | | - | - | | MCP not being used | Verify MCP is enabled in the tool, confirm the server is added, and restart the tool if needed | | MCP authentication errors | Disconnect and reconnect the server to refresh authorization, and check MCP is enabled for your account under **My account → MCP Server** | | AI doesn't fetch URL | Paste the documentation in as context instead | | Token limit exceeded | Connect MCP instead, or focus on specific sections of the docs | ## Need Help? AI sometimes makes mistakes. If you get stuck, reach out to your Customer Success Manager or our support team at [support@cello.so](mailto:support@cello.so). # Connect your client Source: https://docs.cello.so/mcp/connect Set up the Cello MCP server in Claude, Claude Code, Cursor, VS Code, Windsurf, Lovable, and other MCP clients The Cello MCP server uses **OAuth**. When you connect, your client opens a browser window to sign in to Cello and authorize access. There's no token to generate or paste, and your client refreshes the connection automatically. ```text theme={null} https://mcp.cello.so/mcp ``` > [!NOTE] > > Make sure MCP is **enabled for your account** and grab your **MCP Server URL** first. > > ![Cello Portal MCP Server page showing the Enable MCP toggle, the MCP Server URL field, and quick-add cards for Cursor, Claude, VS Code, Lovable, Replit, and Other AI tools](https://mintcdn.com/cello/4C7XEZmkMsMYyA_d/mcp/mcp-settings.png?fit=max\&auto=format\&n=4C7XEZmkMsMYyA_d\&q=85\&s=8e0a5d2d10c52ee7994cfaa9329486a8) ## Claude Connect Cello to the **Claude desktop or web app** as a custom connector. (For the Claude Code CLI, see [Claude Code](#claude-code) below.) 1. Go to **Settings → Connectors** 2. Click **Add custom connector** 3. Enter the following: * **Name**: `Cello` * **Remote MCP server URL**: `https://mcp.cello.so/mcp` 4. Click **Add**, then **Connect**.
  • ` and an inner `` share the same class), Cello will use the first one, which may be invisible. Either narrow the selector with a parent prefix or use an `id`. See [Troubleshooting: announcement not showing](#troubleshooting-announcement-not-showing) for the same diagnostic flow applied to announcements. > [accordion] Dynamic elements in SPAs > > **Problem:** In single-page applications, elements are dynamically added/removed. > > **Solution:** Keep the launcher element persistent in the DOM, use CSS to control visibility instead of conditional rendering. > > **Alternative:** Open the Referral Component from your own click handler, so the element can mount and unmount freely. See [Open the Referral Component from your own launcher](#open-the-referral-component-from-your-own-launcher). ## Add reward in launcher 1.5x activation rate 3.5x sharing rate Increase the sharing activity of your users by highlighting the reward directly in the referral launcher inside your menu item. ![Custom launcher displaying reward amount directly in menu item](https://mintcdn.com/cello/6Zr08teY9AER0ncF/referral-component/referral-component-custom-launcher-reward-in-launcher.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=e0cf4e96b23cbe8ccd7e9f435b51330a) You can get the text for the menu launcher from [cello.js](/sdk/client-side/cello-js-usage#getlabels). Text will be localized to the [referrer's language](/guides/user-experience/overview#texts-and-language) and the reward amount is based on the [referrer's campaign](/guides/campaigns/setting-up-campaigns). ```javascript theme={null} const labels = await window.Cello("getLabels") const myCustomLauncherLabel = labels.customLauncher ``` ## Disable Cello button **Cello button** is a floating action button or bookmark style button provided as a default Referral Component launcher. When integrating a Customer Launcher, you may choose to disable the Cello button or keep it as an additional launcher. ![Default Cello floating action button launcher](https://mintcdn.com/cello/6Zr08teY9AER0ncF/referral-component/referral-component-custom-launcher-cello-button.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=74ec433ad1b4bf6753a56cb65de816f1) You can choose to disable the default launcher, the Cello button. Go to [User experience → Widget](https://app.cello.so/user-experience/component) settings in Cello Portal and **uncheck** "Show Cello Button". ![Configuration to disable default Cello button and use custom launcher](https://mintcdn.com/cello/6Zr08teY9AER0ncF/referral-component/referral-component-custom-launcher-disable-cello-button.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=b9139513f53b3c7dea15fc4048967cae) ## Configure notification badge ![Notification badge attached to custom launcher showing unread updates](https://mintcdn.com/cello/6Zr08teY9AER0ncF/referral-component/referral-component-custom-launcher-notification-badge.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=99e2d0249c714d5374e1d4adaf4dceb5) You can control the behaviour of the [notification badge](/guides/user-experience/referral-notifications-and-emails#alert-and-badge), which is attached to your Custom Launcher Selector by default: > [accordion] Default behavior (clickable with badge) > > This is the default behavior - the element opens the Referral Component on click and shows notification badges. > > ```html theme={null} > > > > > ``` > [accordion] Clickable without badge > > Add `data-cello-badge="false"` to hide the notification badge while keeping the element clickable. > Use this when you have multiple launchers but only want badges on some of them. > > ```html theme={null} > > ``` > [accordion] Badge only, non-clickable > > Add `data-cello-click="false"` to show the notification badge but prevent clicks from opening the panel. > Use this to show badge notifications on parent menu items for better visibility. > > ```html theme={null} >
    class="menu-section" > data-cello-click="false" > style="position: relative;" > > > > Settings Menu >
    > ``` > [accordion] Your own badge, with or without a count > > Draw the badge in your own component instead, as a dot or with the number of unread rewards. Cello's own badge is always a dot. > If Cello still opens the Referral Component from this element, add `data-cello-badge="false"` to hide Cello's badge. > See [Show your own badge](#show-your-own-badge). > [!NOTE] > > The `data-cello-badge` and `data-cello-click` attributes are **optional modifiers**. If you want the default behavior (clickable with badge), you don't need these attributes at all. > [!TIP] > > **Testing notification badge position** > > To trigger a notification badge to be shown on your Custom Launcher simply visit the referral link, of the same user you are testing with, e.g. `moonly.cello.so/pNRB1aYqArN` . A link visit will trigger a [view notification](/guides/user-experience/referral-notifications-and-emails#alert-and-badge) and a badge will be displayed. ## Add announcement selector ![Announcement callout anchored to custom launcher element](https://mintcdn.com/cello/6Zr08teY9AER0ncF/referral-component/referral-component-custom-launcher-announcement-selector.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=18d52b952cfe75d1febe8b5713a6bdd3) Announcement are callout style notifications used to [communicate important information](/guides/user-experience/referral-notifications-and-emails#announcement) to the user if we need to grab their attention and direct them to the Referral Component. > [!TIP] > > To show announcements in your own component instead of Cello's callout, skip the Announcement Selector and see [Show your own announcement](#show-your-own-announcement). > [!NOTE] > > If the Cello button is disabled, the announcement needs to be anchored to one of your Custom Launchers. Depending on the implementation, the Announcement Selector can be the same as for Custom Launcher, i.e. you can use exactly the same class ID, attribute selector or element ID. Add this identifier as Announcement Selector under [User experience → Widget in Cello Portal](https://app.cello.so/user-experience/component). > [!WARNING] > > **Critical requirements for Announcement Selector:** > > * The selector **MUST resolve to exactly one element** when passed to `document.querySelector`. Cello uses the **first match** in DOM order and does not fall back to siblings. > * The matched element **MUST be visible and have a non-zero bounding box** at announcement time. `display: none`, `visibility: hidden`, or `width: 0 / height: 0` will cause the announcement to render against an invisible anchor. > * If multiple elements share the same class or attribute (e.g. a wrapper `
  • ` and an inner `` both have `.my-launcher`), narrow the selector with a parent prefix or use an `id`. > * Verify in the browser console: `document.querySelectorAll("")` should return exactly one element with non-zero size. See [Troubleshooting: announcement not showing](#troubleshooting-announcement-not-showing). ![Cello Portal configuration for announcement selector and positioning](https://mintcdn.com/cello/6Zr08teY9AER0ncF/referral-component/referral-component-custom-launcher-portal-announcement-selector.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=0434a02b46f88982f149c069c1567ca1) Here you can also configure where you want announcement to be shown relative to the Announcement Selector by specifying **Announcement position** and **Announcement position offset.** > [!TIP] > > **Testing Announcement position** > > While choosing Announcement Selector and choosing its position, you will want to see how it looks and make necessary adjustments. You can trigger an [announcement](/guides/user-experience/referral-notifications-and-emails#announcement) using [Cello JS](/sdk/client-side/cello-js-usage#showannouncement-announcement) `showAnnouncement(announcement)` method. > > Example below will trigger the default welcome announcement: > > ```javascript theme={null} > window.Cello("showAnnouncement", { "type": "welcome-announcement-1" }) > ``` > > A fulfilled promise from `showAnnouncement` only means the SDK accepted the request. It does **not** mean the announcement is visible. If you see `Promise {: undefined}` in the console but no announcement on the page, see [Troubleshooting: announcement not showing](#troubleshooting-announcement-not-showing). ## Build your own badge and announcement By default, Cello draws the [notification badge](/guides/user-experience/referral-notifications-and-emails#alert-and-badge) and [announcements](/guides/user-experience/referral-notifications-and-emails#announcement) on your launcher, using the selectors you set in Cello Portal. You can draw them in your own components instead. [cello.js](/sdk/client-side/cello-js-usage) tells you when the unread counts or the active announcement change, and you decide how they look. This is useful when: * Your launcher can't be in the DOM before Cello initializes, for example in a single-page app. * You want the badge and announcement to match your own design system. * You want to show the number of unread rewards. Cello's own badge is always a dot. Each part below works on its own, so you can replace only the badge, only the announcement, or the whole launcher. ### Open the Referral Component from your own launcher Call [`open()`](/sdk/client-side/cello-js-usage#open-destination) from your launcher's click handler. Without a destination, the Referral Component opens on the invite tab. Pass `"rewards"` to open it on the rewards tab instead, for example when your badge shows unread rewards. ```javascript theme={null} document.getElementById("my-referral-button").addEventListener("click", () => { window.Cello("open"); }); ``` Cello doesn't need to find this element, so it doesn't have to exist before Cello initializes, and it doesn't need `position: relative` or a Custom Launcher Selector. If you don't want the [Cello button](#disable-cello-button) as an extra launcher, turn it off. To show the reward in your launcher text, use [`getLabels()`](#add-reward-in-launcher). ### Show your own badge Add [`onUnreadCountChanged`](/sdk/client-side/cello-js-usage#cello-boot-options) to the options of your `cello.boot()` call from [Step 3](#step-3-initialize-cello). It receives two values you can draw your badge from: * `badgeCount`: the number of unread rewards, otherwise `1` for another unread notification such as an unseen alert, otherwise `0`. It's at most 99. Cello's own badge doesn't show a number, so this is only available through cello.js. * `counts.shouldShowBadge`: `true` whenever Cello's own badge would show. Unlike `badgeCount`, it also covers new referral link views. Show a dot, or a number: ```javascript Dot theme={null} const badge = document.getElementById("my-referral-badge"); await cello.boot({ // ... other configuration onUnreadCountChanged: (badgeCount, counts) => { badge.hidden = !counts.shouldShowBadge; }, }); ``` ```javascript Number theme={null} const badge = document.getElementById("my-referral-badge"); await cello.boot({ // ... other configuration onUnreadCountChanged: (badgeCount) => { badge.hidden = badgeCount === 0; badge.textContent = badgeCount; }, }); ``` Cello calls `onUnreadCountChanged` right at boot with every count at `0`, again once notifications have loaded, and then every time a count changes. It can also be called again with the same values. Both examples handle this, because they only set the badge from the values they get. Start with the badge hidden, so the first call with `0` doesn't change anything. When the user opens the Referral Component, Cello clears the counts and calls `onUnreadCountChanged` again, so your badge hides without extra code. If your badge mounts after boot, read the current counts with [`getUnreadEventCounts()`](/sdk/client-side/cello-js-usage#getunreadeventcounts). It returns the same values as `counts`, including `badgeCount`, so you can draw the dot or the number right away. If Cello still opens the Referral Component from this element through the Custom Launcher Selector, add `data-cello-badge="false"` to the element, so Cello doesn't draw its own badge as well. See [Configure notification badge](#configure-notification-badge). ### Show your own announcement In [User experience → Widget in Cello Portal](https://app.cello.so/user-experience/component), leave the **Announcement Selector** empty and turn off the [Cello button](#disable-cello-button), so Cello has nowhere to draw its own announcement. Then add [`onAnnouncementChanged`](/sdk/client-side/cello-js-usage#cello-boot-options) to the options of your `cello.boot()` call. Cello calls it with the active announcement, or with `null` when there's nothing to show: ```javascript theme={null} const box = document.getElementById("my-announcement"); const ctaButton = document.getElementById("my-announcement-cta"); const toPlainText = (html) => new DOMParser().parseFromString(html, "text/html").body.textContent; const renderAnnouncement = (announcement) => { box.hidden = !announcement; if (!announcement) return; document.getElementById("my-announcement-heading").textContent = announcement.heading; document.getElementById("my-announcement-text").textContent = toPlainText(announcement.text); ctaButton.hidden = !announcement.ctaLabel; ctaButton.textContent = announcement.ctaLabel || ""; ctaButton.onclick = () => window.Cello("open", announcement.ctaDestination); }; document.getElementById("my-announcement-close").addEventListener("click", () => { window.Cello("dismissAnnouncement"); }); await cello.boot({ // ... other configuration onAnnouncementChanged: renderAnnouncement, }); ``` * The call-to-action opens the Referral Component on the page in `ctaDestination`. That marks the announcement as read, and Cello calls `onAnnouncementChanged` with `null`. * The close button calls [`dismissAnnouncement()`](/sdk/client-side/cello-js-usage#dismissannouncement), which marks the announcement as read without opening the Referral Component. Cello then calls `onAnnouncementChanged` with `null`. * `icon` is an optional icon name, `Heart`, `Success` or `Gift`, that you can map to your own icons. Cello calls `onAnnouncementChanged` with `null` right at boot, then with the announcement once it has loaded, if there is one. It's called again when a new announcement arrives and when its text changes, for example after [`changeLanguage`](/sdk/client-side/cello-js-usage#changelanguage-language). If your announcement component mounts after boot, read the active announcement with [`getActiveAnnouncement()`](/sdk/client-side/cello-js-usage#getactiveannouncement): ```javascript theme={null} renderAnnouncement(await window.Cello("getActiveAnnouncement")); ``` > [!NOTE] > > `text` can contain `` tags. The example above shows it as plain text. To keep the bold parts, sanitize `text` first, then insert it as HTML. You place the announcement yourself, so the Announcement Selector requirements and [Troubleshooting: announcement not showing](#troubleshooting-announcement-not-showing) don't apply. ### Full example Both versions connect the launcher, a numbered badge and the announcement to one `cello.boot()` call. The React version keeps the latest values from Cello in a small store, so components that mount after boot show the current badge and announcement straight away. > [tab] HTML > > ```html theme={null} > > > > > > ``` > [tab] React > > ```jsx theme={null} > import { useSyncExternalStore } from "react"; > > // Keeps the latest values from Cello, so components that mount later can read them > let celloState = { badgeCount: 0, announcement: null }; > const listeners = new Set(); > > const setCelloState = (update) => { > celloState = { ...celloState, ...update }; > listeners.forEach((listener) => listener()); > }; > > const subscribe = (listener) => { > listeners.add(listener); > return () => listeners.delete(listener); > }; > > const getSnapshot = () => celloState; > > const useCelloState = () => useSyncExternalStore(subscribe, getSnapshot, getSnapshot); > > // Call once, after the user logs in > export function bootCello(token) { > window.cello = window.cello || { cmd: [] }; > > window.cello.cmd.push(async (cello) => { > try { > await cello.boot({ > productId: "YOUR_PRODUCT_ID", > token, > onUnreadCountChanged: (badgeCount) => setCelloState({ badgeCount }), > onAnnouncementChanged: (announcement) => setCelloState({ announcement }), > }); > } catch (error) { > console.error("Failed to initialize Cello:", error); > } > }); > } > > const toPlainText = (html) => > new DOMParser().parseFromString(html, "text/html").body.textContent; > > export function ReferralButton() { > const { badgeCount } = useCelloState(); > > return ( > > ); > } > > export function ReferralAnnouncement() { > const { announcement } = useCelloState(); > if (!announcement) return null; > > return ( >
    > {announcement.heading} >

    {toPlainText(announcement.text)}

    > {announcement.ctaLabel && ( > > )} > >
    > ); > } > ``` ### Test your components > [!TIP] > > **Testing your badge and announcement** > > * **Badge:** visit the referral link of the user you're testing with, e.g. `moonly.cello.so/pNRB1aYqArN`. The view sets `shouldShowBadge` to `true`, so a dot badge shows. Views don't add to `badgeCount`, so a numbered badge stays hidden until the user has an unread reward or alert. > * **Announcement:** run `window.Cello("showAnnouncement", { "type": "welcome-announcement-1" })` in your browser console. Cello calls `onAnnouncementChanged` with the welcome announcement. > * **Clearing:** open the Referral Component from your launcher. Cello clears the counts and the announcement, so both disappear. ## Troubleshooting: announcement not showing **Short answer:** The most common cause is that your **Announcement Selector** matches more than one element, and the first match in DOM order is invisible (zero-sized, hidden, or off-screen). Cello uses `document.querySelector`, which always picks the first match. Narrow the selector until `document.querySelectorAll()` returns exactly one visible element. If you'd rather not depend on a selector at all, [show announcements in your own component](#show-your-own-announcement) instead. Cello doesn't position those, so none of this section applies. ### How announcement positioning works * Cello calls `document.querySelector()` once when an announcement is rendered. * `document.querySelector` returns the **first matching element in DOM order**, not the most visible one. * The matched element must be present in the DOM, have non-zero width and height, and not be `display: none` or `visibility: hidden` at the moment the announcement renders. * A fulfilled `showAnnouncement` promise means the SDK accepted the request. It does **not** mean the announcement is visible to the user. * Cello does not retry, fall back to siblings, or rescan the DOM if the matched element is invisible. ### Symptom: `showAnnouncement` returns a fulfilled promise but nothing appears If your browser console shows: ``` > window.Cello("showAnnouncement", { "type": "welcome-announcement-1" }) < Promise {} [[PromiseState]]: "fulfilled" [[PromiseResult]]: undefined ``` ...this only means the SDK accepted the call. The announcement may still be invisible because of the selector resolving to a hidden or zero-sized element. ### Symptom map | Symptom | What to run in DevTools | What it means | Fix | | - | - | - | - | | `showAnnouncement` returns fulfilled promise but no announcement appears | `document.querySelectorAll("").length` | If `> 1`, your selector is too broad. Cello picked the first match, which is likely invisible. | Use a more specific selector (add a parent class, or use an `id`). Update **Announcement Selector** in [User experience → Widget](https://app.cello.so/user-experience/component). | | Announcement renders at the top-left of the viewport (0,0) | `document.querySelector("").getBoundingClientRect()` | If width/height is `0`, the matched element has no layout box. | Move the class/attribute to the visible element (icon/button), not a wrapper `
  • ` or ``. | | Announcement renders but is cut off or off-screen | Same as above; check `top` / `left` values | The matched element is off-screen or inside a scrolled container. | Anchor to an in-viewport element, or adjust **Announcement position offset** in the Portal. | | `querySelectorAll` returns `0` matches | n/a | Element does not exist when the announcement renders, or the selector has a typo. | Confirm the element exists before `cello.boot()`; check `#`, `.`, `[]` prefixes match your element. | | `querySelectorAll` returns `1` and the element is visible, but still no announcement | Inspect computed styles | The matched element may be missing `position: relative`. | Add `position: relative` to the matched element. | ### Related questions this section answers * Why does `showAnnouncement` resolve but no announcement appears? * Why is my Cello announcement invisible? * Why does my Cello announcement render at the top-left of the screen? * How do I fix "announcement selector matches multiple elements"? * Why does Cello pick the wrong element for my announcement? * Cello announcement not working / not showing / not appearing # Introduction Source: https://docs.cello.so/referral-component/introduction Add a referral program to your application with Cello's embeddable referral component The Cello Referral Component is an all-in-one referral experience that integrates directly into your web and mobile applications with just a few lines of code, enabling users to share referral links, track progress, and receive rewards. ![Cello Referral Component interface showing sharing options and rewards tracking](https://mintcdn.com/cello/6Zr08teY9AER0ncF/referral-component/referral-component-introduction.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=9c03d3d1a094bede1cdb9db53d2ed967) ## What is the Referral Component? The Referral Component provides a complete referral experience within your product through: * **First-time onboarding** that explains how your referral program works * **Multiple sharing options** including link copy, social media, email, and QR codes * **Progress tracking** showing clicks, signups, and earned rewards in real-time * **Automated reward payouts** via PayPal, Venmo, and other payment methods * **In-app and Email notifications** to keep users engaged with referral activity Learn more about the [complete user experience](/guides/user-experience/overview). ## Key Features * **Easy Integration** - Add as a floating button to launch the Referral Component or integrate into your existing menu with [custom launcher](/referral-component/custom-launcher) * **Customizable Offer** - [Configure reward amounts, text, and program details](/guides/campaigns/setting-up-campaigns) * **In-app Notifications** - [Alerts and announcements](/guides/user-experience/referral-notifications-and-emails) to keep users engaged with updates, promotions, and milestones * **Email Notifications** - [Automated emails for signups, rewards, and milestones](/guides/user-experience/referral-notifications-and-emails) * **Multi-language Support** - Available in 10+ languages with automatic detection * **Cross-platform** - Native SDKs [for Web](/sdk/client-side/cello-js), [iOS, Android, and React Native](/sdk/mobile/introduction) * **Dark mode** - Support for light and dark theme to match your app’s interface ## Installation Options > [card] [Cello JS](/referral-component/quickstart) > > JavaScript library for React, Vue, Angular, and vanilla JS applications > [card] [iOS SDK](/sdk/mobile/ios) > > Native Swift/Objective-C SDK with Swift Package Manager and CocoaPods support > [card] [Android SDK](/sdk/mobile/android) > > Native Kotlin/Java SDK with Gradle integration > [card] [React Native](/sdk/mobile/react-native) > > Cross-platform mobile SDK for React Native apps ## How to Use ### Basic Implementation 1. **Load the SDK** - Add Cello script or SDK to your application 2. **Generate JWT Token** - Create server-side authentication token 3. **Initialize Component** - Boot with your product ID and user details ### Quick Example (Web) ```javascript theme={null} // Load and initialize Cello window.cello.cmd.push(async function (cello) { await cello.boot({ productId: "YOUR_PRODUCT_ID", token: "JWT_TOKEN", productUserDetails: { email: "user@example.com", firstName: "John" } }); }); ``` ## Next Steps Get started with the [Quickstart guide](/referral-component/quickstart) to integrate the Referral Component in under 15 minutes. # Quickstart Source: https://docs.cello.so/referral-component/quickstart Learn how to install Cello Referral Component into your web application > [!TIP] > > This guide follows basic steps to **integrate Referral Component into your web application** using [Cello JS SDK](/sdk/client-side/cello-js-introduction). [Cello JS SDK](/sdk/client-side/cello-js-introduction) is a browser-based JavaScript library compatible with all web frameworks that output HTML/JavaScript, including React, Next.js, Vue, and Angular. > [!NOTE] > > For server-side rendering frameworks like Next.js, Cello interactions must occur client-side, not server-side. ## Prerequisites First, you'll need your `productId` and `PRODUCT_SECRET` from your Cello dashboard's [Developers → Access keys](https://app.cello.so/developers/access-keys) for the right environment (Production or Sandbox) ![Portal Credentials Access Keys productId and PRODUCT_SECRET for Referral Component Cello JS](https://mintcdn.com/cello/6Zr08teY9AER0ncF/sdk/client-side/cello-sdk-cello-js-user-authentication-portal-credentials-accesskeys-productId-productSecret.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=3b5be72ede62019ba00873e5bbf8d8b0) ## Installation Steps Follow these steps to integrate the Referral Component: 1. Load the Cello script from our CDN 2. Generate a JWT token server-side for user authentication 3. Initialize the component with the token to connect your user session ## Step 1: Load the script Add the Cello script to your HTML. The script loads asynchronously to avoid blocking page rendering and can be included anywhere on your website. This approach is recommended for optimal SEO performance. Add this script to the `head` tag of your HTML: > [tab] Production URL > > ```javascript theme={null} > > ``` > [tab] Sandbox URL > > ```javascript theme={null} > > ``` Once loaded, the script: 1. Registers `window.Cello` for communication between your page and Cello 2. Processes any queued commands from `window.cello.cmd` and maintains the command interface ## Step 2: Generate a JWT token Create a JWT token to securely connect your user's session to Cello. The token authenticates your application and provides user identity for generating unique referral links. > [!CAUTION] > > Generate JWT tokens server-side only. Never create tokens in the browser. See [User Authentication](/sdk/client-side/user-authentication) for complete JWT token generation instructions. ## Step 3: Initialize the library Initialize Cello with a single function call that includes your **product ID**, **JWT token**, and configuration options. > [!WARNING] > > User details (email, first name) are required for fraud detection and features like email notifications and personalized messaging. ```javascript JavaScript theme={null} window.cello = window.cello || { cmd: [] }; window.cello.cmd.push(async function (cello) { try { await cello.boot({ productId: "CELLO_PRODUCT_ID", token: "REPLACE_ME", language: "en", productUserDetails: { firstName: "Bob", lastName: "Bobsky", fullName: "Bob B Bobsky", email: "bob@gmail.com", }, }); } catch (error) { console.error("Failed to boot cello:", error); // Handle the error appropriately } }); ``` This implementation works with asynchronous script loading. For complete configuration options, see [SDK Reference](/sdk/client-side/cello-js-usage#cello-boot-options). After initialization, the library: 1. Adds a Cello button to your page or [connects to your custom element](https://docs.cello.so/referral-component/custom-launcher) 2. Creates a session to handle configured callbacks > [!TIP] > > **Congratulations!** You have successfully integrated Cello Referral Component! Next, you can integrate Referral Component into your mobile applications: > [card] [iOS SDK](/sdk/mobile/ios) > [card] [Android SDK](/sdk/mobile/android) > [card] [React Native SDK](/sdk/mobile/react-native) *** ## Controlling access to Referral component If you want to enable the Cello referral component only to selected users or control its visibility dynamically, we provide the following options: > [accordion] Option 1: Named user whitelist > > During the new referral program rollout with Cello, you may want to pilot with a small cohort of selected users. This can be achieved using our Named user whitelist. > > All you need to do is to provide a list of selected users UIDs (productUserIds) to Cello. After they are added to the whitelist, only these users will have access to the Referral component until you are ready to rollout to your entire user base. > [accordion] Option 2: Show/Hide Referral Component conditionally > > To control dynamically when and who sees the Referral component, you can use `show()` and `hide()` methods. > > For example, you may decide to only show the Referral component after the user has completed onboarding. In that case, when a user first logs in, boot the component with `hideDefaultLauncher = true` configuration option. Then, when the onboarding is complete, use `cello.show()` to show the Cello button. ## Opening the Referral Component with a Link You can automatically open the Referral Component with a link to your product by adding a `cello-open=true` param to your URL. For example, add a link to the referral component to your email communication to help your users access the sharing options directly from the email. > [!WARNING] > > Cello reads this param when it boots, so boot Cello as soon as a logged-in user loads the page, not when they click the launcher. Otherwise the link opens your product but not the Referral Component. > [!TIP] > > If a user is redirected between URLs on login, make sure to re-attach this param to the final URL the user lands on in order to automatically open the Cello Referral Component. You may also pass one of `invite`, `rewards` and `edit-payments` values to the param for the Referral Component to open a specific tab automatically e.g.: ```html theme={null} https://your-product.com?cello-open=edit-payments ``` ## Troubleshooting ### `Error 1200: Invalid Tenant` The main cause for this error is that the used URL for the referral component, the product ID, and the Product Secret do not fit together. Make sure that you are using all three components of the same environment. ### `Error 1100: Invalid JWT token` This means that the token is not valid and the main cause is that some of the attributes for constructing the token are not correct. You can decode your token using [https://jwt.io/](https://jwt.io/). After decoding, please check all the attributes against the requirements in User Authentication, specifically make sure that productUserId is a string, iat is valid, algorithm is H512 and the secret is the correct one for the environment you are using (Sandbox or Production) ### `Failed to load resource: the server responded with a status of 401 () [Cello]: "User is not authorized to load the widget"` Most likely, the created JWT token is not valid. Common causes for this error are: * The use of an incorrect `PRODUCT_SECRET`. * The `productUserId` is not passed as a `string` in the payload for the JWT token creation. * The use of an incorrect `productId`. * `issuedAt` (`iat`) date cannot be older than 24h or set in the future. ### `Error: User is not authorized to load the widget` Most likely you are not passing the `productUserId` as a `string` into the payload for the JWT token creation. ### `[Cello]: Cannot read properties of null (reading ‘__H')` Most likely, you are using `http` in your script’s source: `src="http://assets.cello.so/app/latest/cello.js"` . Please use `https`. ### The widget doesn't load and the console shows `Content Security Policy` errors If your browser console shows errors like these, your site's Content Security Policy (CSP) is blocking Cello resources: ```text theme={null} Refused to execute inline script because it violates the following Content Security Policy directive: "script-src ..." Refused to load the script 'https://assets.cello.so/app/latest/cello.js' because it violates the following Content Security Policy directive: "script-src ..." Fetch API cannot load https://share.cello.so/api/products/.../initialize/v2. Refused to connect because it violates the document's Content Security Policy. Refused to load the image because it violates the following Content Security Policy directive: "img-src ..." Refused to apply inline style because it violates the following Content Security Policy directive: "style-src ..." Refused to load the font because it violates the following Content Security Policy directive: "font-src ..." ``` Any error containing `violates the following Content Security Policy directive` or `violates the document's Content Security Policy` means your CSP headers need to be updated: add the Cello domains to your policy. The directive named in the error (`script-src`, `connect-src`, `img-src`, `style-src`, `font-src`) tells you which one is missing. See [Content Security Policy (CSP)](/sdk/client-side/cello-js-usage#content-security-policy-csp) for the full list of required sources. Remember that sandbox environments use `*.sandbox.cello.so` domains. If the widget loads but has no styling and the errors mention `style-src` with a `'nonce-...'` source, adding `'unsafe-inline'` does not help: browsers ignore it next to a nonce. Pass the nonce to `boot` as described in [Nonce-based policies](/sdk/client-side/cello-js-usage#nonce-based-policies). ## Frequently asked questions ### How much effort on tech side is the integration of Cello? The complexity of integrating Cello can vary greatly, depending on your individual setup. Integration generally consists of frontend integration and user authentication. For our typical customer, setting up these components on a development environment requires hours, not days. The integration of attribution and reward automation is also relatively straightforward, though it depends on your existing setup. ### The Cello Floating Action Button is overlaying or covering another component within my product. What can I do? Sometimes, the Cello Floating Action Button or the Referral Component might overlay another component in your product. Here's what you can do: * **Adjust the z-index**: Cello can modify the z-index of the Floating Action Button or the Referral Component. This ensures that your other components can cover the Cello elements. * **Hide the element**: Using the `cello.hide()` function, you can hide the Floating Action Button or the Referral Component when other components are open. Implement this function in your frontend. You can also use the `cello.hide()` function to hide the Cello Floating Action Button on specific pages. ### Is it possible to hide the Cello Floating Action Button on certain pages? You can hide the Cello Floating Action Button using the [cello.hide()](/sdk/client-side/cello-js-usage#hide) function when other components open. The implementation has to be done in your frontend. ### What exactly is the `productUserId` that is required in the user authentication? The `productUserId` is the internal user id that you are using inside your product to uniquely identify users. ### Do you support server-side rendering? Yes, for server-side rendering frameworks like Next.js, Cello interactions must occur client-side, not server-side. ### Do you support Angular? As mentioned before, the Cello Referral Component is being loaded independently from your angular app and appends itself to `` tag. That being said, you need to just make sure that the injected HTML code is not being overridden by your angular app. This can be achieved in various ways. The safest choice would be not to use `` as your AppRoot element as it would create a race condition. ```typescript theme={null} @Component({ selector: 'app-root', ... }) ``` ```html theme={null} ``` The other option that we have seen customers implement is to load the cello javascript dynamically from your angular app, making sure that it is being loaded after angular is finished rendering its own components. Here is an example that has been provided by one of our customers: ```typescript theme={null} export interface CelloReferralPayload { productId: string; token: string; showOnBoot: boolean; productUserId: string; language: string; iat: string; } @Injectable({ providedIn: 'root' }) export class CelloReferralAdapter { constructor(@Inject(DOCUMENT) private document: Document, @Inject(WINDOW) private window: Window) {} async init(payload: CelloReferralPayload, isProd: boolean){ await this.loadScript(isProd ? 'https://assets.cello.so/app/latest/cello.js' : 'https://assets.sandbox.cello.so/app/latest/cello.js'); await this.wait(1000); (this.window as Window & {Cello: any}).Cello('boot', payload); } async wait(timeout: number) { // due to a race condition a timeout is needed after initializing the script. return new Promise(resolve => setTimeout(() => resolve(), timeout)); } async loadScript(src: string): Promise { return new Promise(resolve => { const script = this.document.createElement('script'); script.onload = () => resolve(); script.type = 'module'; script.src = src; this.document.head.appendChild(script); }); } } ``` *** ### What about other frameworks? Since Cello is a Javascript library running on browser, then it works naturally with all frameworks that end up resulting in a standard HTML/Javascript application. That includes React, Angular, Vue and all similar JS/TS libraries. # Introduction Source: https://docs.cello.so/sdk/client-side/attribution-js-introduction JavaScript library for capturing and tracking referral codes throughout the conversion funnel ## What is Attribution JS? Attribution JS is a lightweight JavaScript library that captures referral codes (`ucc`) from landing pages and maintains attribution throughout the user journey. When users click referral links and land on your website, this library ensures their referral source is properly tracked through signup and purchase events. The library automatically: * Detects referral code (`ucc`) query parameters from referral links * Stores referral code (`ucc`) as first-party cookies for persistent tracking * Attaches referral code (`ucc`) to signup forms * Provides APIs to retrieve referrer information for personalization ## Installation Options Choose your preferred installation method: > [card] [Embedded Script Tag](/sdk/client-side/embedded-script-tag) > > Add directly to your HTML pages with a script tag > [card] [Google Tag Manager](/sdk/client-side/google-tag-manager) > > Deploy through GTM without code changes ## Key Capabilities Attribution JS enables you to: ### Referral Tracking * **Capture referral codes** - Automatically detect and store `ucc` parameters from referral links * **Retrieve referral data** - Access referral codes programmatically with `getUcc()`. Returns data from URL parameters or stored cookies (persisted for 3 months) * **Form integration** - Auto-inject hidden referral fields into signup forms for seamless attribution ### Personalization & Campaigns * **Get referrer names** - Display personalized messages using `getReferrerName()` to retrieve the name of the person who sent the referral * **Access campaign config** - Use `getCampaignConfig()` to retrieve discount percentages (in decimal format: 0.1 = 10%) and duration in months for referred users * **Dynamic discount display** - Show referral incentives based on campaign parameters with proper percentage conversion for user display ### Cookie Management * **Privacy compliance** - [Manage cookie consent](/landing-pages/manage-cookies) with built-in methods * **Allow cookies** - Enable cookie storage after user consent * **Delete cookies** - Remove stored data when consent is withdrawn * **Custom handling** - Implement your own consent flow with full API control ## How It Works 1. **User clicks referral link** - Link contains referral code (`ucc`) parameter (e.g., `yoursite.com?ucc=ABC123`) 2. **Script captures code** - Attribution JS detects referral code (`ucc`) and makes it accessible via `window.CelloAttribution("getUcc")` method 3. **Code persists** - Stored as first-party cookie for 3 months to handle return visits and cross-session attribution 4. **Methods available** - All attribution methods (`getUcc`, `getReferrerName`, `getCampaignConfig`) become available asynchronously after script initialization 5. **Signup attribution** - Referral code (`ucc`) is automatically attached to forms or retrieved programmatically for user registration 6. **Referral conversion tracking** - Pass the referral code (`ucc`) to Cello when tracking signups and purchases for complete attribution ## Next Steps **1. Install the Library** Choose between [embedded script](/sdk/client-side/embedded-script-tag) or [GTM installation](/sdk/client-side/google-tag-manager) **2. Verify Installation** Test that referral codes are being captured correctly **3. Explore the API** Review all [available methods](/sdk/client-side/attribution-js-usage) for advanced functionality ## API Method Calls All Cello Attribution methods use the unified `CelloAttribution` function syntax: ```javascript theme={null} const ucc = await window.CelloAttribution("getUcc"); const referrerName = await window.CelloAttribution("getReferrerName"); const campaignConfig = await window.CelloAttribution("getCampaignConfig"); ``` > [!NOTE] > > Attribution JS works alongside [Cello JS](/sdk/client-side/cello-js-introduction) for complete referral program functionality. While Attribution JS handles tracking and data retrieval, Cello JS provides the referral component interface. # Usage Source: https://docs.cello.so/sdk/client-side/attribution-js-usage Below is the full list of commands to call the Cello Attribution JS SDK with. ## Script Initialization and Timing The attribution script loads asynchronously. To avoid race conditions between script loading and your application calls, you have two options: ### Option 1: Queue Function (Recommended) Add this JavaScript code before any calls to the library to queue commands until the script loads: ```javascript expandable theme={null} window.CelloAttribution=window.CelloAttribution||function(t,...o){if("getReferral"===t)throw new Error("getReferral is not supported in this context. Use getUcc instead.");let e,n;const i=new Promise((t,o)=>{e=t,n=o});return window.CelloAttributionCmd=window.CelloAttributionCmd||[],window.CelloAttributionCmd.push({command:t,args:o,resolve:e,reject:n}),i} ``` ### Option 2: Wait for Script Initialization Alternatively, wait for the script to load before making calls: ```javascript theme={null} document.addEventListener('DOMContentLoaded', async function() { // Wait for script initialization await new Promise(resolve => setTimeout(resolve, 1000)); if (typeof window.CelloAttribution === 'function') { // Now safe to call methods const ucc = await window.CelloAttribution("getUcc"); console.log('UCC:', ucc); } else { console.error('Cello Attribution script failed to load'); } }); ``` ## `attachTo(formElement)` Attaches hidden input to the passed `HTMLFormElement` node, or array of nodes. ```javascript theme={null} window.CelloAttribution("attachTo", formElement); ``` ### Accepts **formElement** `HTMLFormElement | HTMLFormElement[]` *required* Form(s) to attach the hidden input to ### Example ```javascript theme={null} window.CelloAttribution("attachTo", document.querySelector("form")); ``` *** ## `getCampaignConfig()` Returns campaign configuration for new users, including discount information. ```javascript theme={null} const campaignConfig = await window.CelloAttribution("getCampaignConfig"); ``` ### Returns **campaignConfig** `object` The campaign config object: **properties** **newUserDiscountMonth** `number` Duration of discount in months (e.g., 12 for 12 months) **newUserDiscountPercentage** `number` Discount as decimal format (0.1 = 10%, 0.25 = 25%) ### Complete Example ```javascript theme={null} const config = await window.CelloAttribution("getCampaignConfig"); console.log(config); // Output: // { // newUserDiscountPercentage: 0.1, // 10% discount // newUserDiscountMonth: 12 // For 12 months // } // Convert to display format: const displayPercentage = config.newUserDiscountPercentage * 100; // 10 const message = `${displayPercentage}% off for ${config.newUserDiscountMonth} months`; console.log(message); // "10% off for 12 months" // Use in your UI: document.getElementById('discount-banner').innerHTML = `🎉 Special offer: ${displayPercentage}% off your first ${config.newUserDiscountMonth} months!`; ``` ## `getReferrerName()` Returns the referrer's name, if provided in the referral link. ```javascript theme={null} const name = await window.CelloAttribution("getReferrerName"); ``` ### Returns **name** `string | undefined` Referrer's name or `undefined` ## `getUcc()` Retrieves the referral code `ucc` from the URL or the cookie (if cookies are enabled). ```javascript theme={null} const ucc = await window.CelloAttribution("getUcc"); ``` ### Returns **ucc** `string` Unique campaign code/referral code ## ~~`attachAll()`~~ > ⚠️ **Deprecated**: forms are now auto-detected and the hidden `ucc` input is injected automatically. > Use [`attachTo(formElement)`](#attachto-formelement) for targeted cases instead. **more** ```javascript theme={null} window.CelloAttribution("attachAll"); ``` *** ## Troubleshooting ### Attribution Script Not Loading ```javascript theme={null} // Check if script loaded correctly if (typeof window.CelloAttribution !== 'function') { console.error('Cello Attribution script failed to load'); // Implement fallback logic // For example, proceed without attribution or show error message } ``` ### Methods Returning undefined or null **Common causes:** * Script not fully initialized - wait for DOM load or use the queue function * Incorrect method syntax - ensure you use `window.CelloAttribution("methodName")` * No referral data available - user didn't come from a referral link **Solutions:** ```javascript theme={null} // Always check return values const ucc = await window.CelloAttribution("getUcc"); if (ucc) { console.log('Referral code found:', ucc); } else { console.log('No referral code - user came directly'); } // Handle missing referrer names gracefully const referrerName = await window.CelloAttribution("getReferrerName"); const greeting = referrerName ? `Welcome! ${referrerName} referred you` : 'Welcome to our platform'; ``` ### Testing Attribution Methods Test all methods in your browser console: ```javascript theme={null} // Test UCC retrieval await window.CelloAttribution("getUcc"); // Returns: string (referral code) or null // Test referrer name await window.CelloAttribution("getReferrerName"); // Returns: string (referrer name) or undefined // Test campaign config await window.CelloAttribution("getCampaignConfig"); // Returns: { newUserDiscountPercentage: number, newUserDiscountMonth: number } ``` ### Network and Loading Issues ```javascript theme={null} // Check if attribution script is blocked fetch('https://assets.cello.so/attribution/latest/cello-attribution.js') .then(response => { if (!response.ok) { console.error('Attribution script blocked or unavailable'); } }) .catch(error => { console.error('Network error loading attribution script:', error); }); ``` ### Common Integration Patterns ```javascript theme={null} // Safe attribution check with fallbacks async function initializeWithAttribution() { try { // Wait for script if needed let retries = 0; while (typeof window.CelloAttribution !== 'function' && retries < 10) { await new Promise(resolve => setTimeout(resolve, 500)); retries++; } if (typeof window.CelloAttribution === 'function') { const ucc = await window.CelloAttribution("getUcc"); const referrerName = await window.CelloAttribution("getReferrerName"); const campaignConfig = await window.CelloAttribution("getCampaignConfig"); return { ucc, referrerName, campaignConfig }; } else { throw new Error('Attribution script not available'); } } catch (error) { console.warn('Attribution initialization failed:', error); return { ucc: null, referrerName: null, campaignConfig: null }; } } // Use in your application initializeWithAttribution().then(({ ucc, referrerName, campaignConfig }) => { // Proceed with or without attribution data if (ucc) { console.log('Referral detected:', { ucc, referrerName, campaignConfig }); } }); ``` *** ## ~~`getReferral()`~~ > ⚠️ **Deprecated**: use [`getUcc()`](#getucc) instead. **more** ```javascript theme={null} const ucc = window.CelloAttribution("getReferral"); ``` ### Returns **ucc** `string` Unique campaign code/referral code # Introduction Source: https://docs.cello.so/sdk/client-side/cello-js-introduction JavaScript SDK for embedding the Cello Referral Component in web applications ![Referral Component Pn](https://mintcdn.com/cello/6Zr08teY9AER0ncF/referral-component/referral-component-introduction.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=9c03d3d1a094bede1cdb9db53d2ed967) ## What is Cello JS? Cello JS is a browser-based JavaScript SDK that enables you to embed a fully-featured referral component directly into your web application. It provides a seamless way for your users to share referral links, track their performance, and receive rewards - all without leaving your product. The SDK works with any web framework that outputs HTML/JavaScript, including: * React, Next.js, and Gatsby * Vue and Nuxt * Angular * Vanilla JavaScript applications * Server-rendered applications (with client-side initialization) ## Getting Started Follow our quickstart guide to integrate Cello JS in under 15 minutes: > [card] [Quickstart Guide](/referral-component/quickstart) > > Step-by-step instructions to add the Referral Component to your web app ## Key Capabilities With Cello JS, you can: ### Core Functionality * **Initialize the component** - Boot with user authentication and configuration * **Manage visibility** - Show, hide, or programmatically open the component * **Handle user sessions** - Update user details and manage authentication tokens ### Customization & Control * **Change language** - Switch languages dynamically without re-initialization * **Custom launchers** - Replace the default button with your own UI elements * **Event callbacks** - React to component events like open, close, and token expiration ### Data & Communication * **Retrieve referral links** - Get active referral codes and URLs programmatically * **Access campaign config** - Fetch reward amounts and program details * **Display announcements** - Show targeted messages and updates to users ### Advanced Features * **Localization** - Access and customize all UI text labels * **Country restrictions** - Automatically handle unsupported regions * **Graceful shutdown** - Clean component removal when needed ## Mobile Applications Looking to add referral functionality to your mobile app? Check out our native mobile SDKs: > [card] [iOS SDK](/sdk/mobile/ios) > > Swift/Objective-C SDK for iOS apps > [card] [Android SDK](/sdk/mobile/android) > > Kotlin/Java SDK for Android apps > [card] [React Native](/sdk/mobile/react-native) > > Cross-platform mobile SDK ## Next Steps **1. Install the SDK** [Follow the quickstart](/referral-component/quickstart) to add Cello JS to your application **2. Authenticate Users** [Set up JWT authentication](/sdk/client-side/user-authentication) for secure user sessions **3. Explore the API** [View all available methods](/sdk/client-side/cello-js-usage) in the usage documentation # Usage Source: https://docs.cello.so/sdk/client-side/cello-js-usage Below is the full list of commands to call the Cello JS SDK with. ## `cello.boot(options)` Initializes Cello Referral Component in your product. Returns a promise that is resolved once the whole initialization process is finished or rejected if the boot command failed. ```javascript theme={null} window.cello = window.cello || { cmd: [] }; window.cello.cmd.push(async (cello) => { try { await cello.boot(options); } catch (error) { // Handle the error appropriately } }); ``` The solution above is designed so that you don't have to wait for the library to finish loading before you call the command - follow it and use the `window.cello` object to avoid that particular race condition. For any other commands, or when you are sure that the command is called after the library has finished loading, you can opt to use the regular command syntax: ```javascript theme={null} await window.Cello("boot", options); ``` ### Accepts **options** `object` *required* The initialization options object: **properties** **productId** `string` *required* Identifier of the product your users will refer. You can obtain this in your Cello Portal. **token** `string` *required* Access token generated for the given user. More in [User Authentication](/referral-component/user-authentication). **productUserDetails** `object` *required* Product user details object. Required for select features **properties** **email** `string` *required* Email of the product user. This data is used in the personalization of the referral experience, e.g. email notifications. Required for select features **firstName** `string` *required* First name of the product user. This data is used in the personalization of the referral experience, e.g. email notifications and the [personalized message to referees](/docs/add-personalized-message). Required for select features **lastName** `string` Last name of the product user **fullName** `string` Full name of the product user. Use this option if you do not have first name and last name separately. **productUserCountryCode** `string` Product user country, if known. ISO 3166 Alpha-2 standard e.g. `DE`. If the country is not on the [supported payout countries list](/guides/user-experience/overview#reward-countries-and-payout-methods), the Referral Component will not be booted for this user. If no country is passed, Cello will still be booted. Note: this uses the country your product has on file, which may differ from the user's actual PayPal payout country. See the [unsupported countries guidance](/guides/user-experience/overview#reward-countries-and-payout-methods) for tradeoffs before using this to gate visibility. **language** `string` The language, in which the Referral Component will be loaded in ISO 639-1. Default: `undefined`. If undefined, we use default language set for your product. Note: the language must be enabled for your product by Cello - if the language is not enabled, this parameter has no effect and the component falls back to your product's default language. Contact Cello support to enable additional languages. **themeMode** `string` Set light or dark theme to match your app’s interface. Accepts `light` and `dark`. Default: `light`. **nonce** `string` The CSP nonce of the current response, for sites whose Content Security Policy uses a nonce in `style-src` or `script-src`. The Referral Component puts it on every style it creates and on the font stylesheet it loads. Default: `undefined`. Not needed when your policy allows `'unsafe-inline'` or you set no CSP. See [Nonce-based policies](#nonce-based-policies). **hideDefaultLauncher** `boolean` Hides the entire default Cello launcher button. Use this when you want to provide your own launcher element via `customLauncherSelector`. Default: `false`. Note: this hides the **button**, not just the notification badge. To hide only the badge on a custom launcher element, add `data-cello-badge="false"` to your HTML element instead - see [Configure notification badge](/referral-component/custom-launcher#configure-notification-badge). There is no `hideDefaultBadge` boot option. **onOpen** `function` Callback event for when Referral Component widget is opened. **onClose** `function` Callback event for when Referral Component widget is closed. **onUserInteraction** `function` Callback handler for user interactions within the Referral Component. Receives two parameters: `action` (string) and `payload` (any). Currently supports `linkCopied` action which provides the copied URL as payload. **onUnreadCountChanged** `function` Callback for when the unread counts change. Use it to show the [notification badge](/guides/user-experience/referral-notifications-and-emails#alert-and-badge) in your own UI, as described in [Show your own badge](/referral-component/custom-launcher#show-your-own-badge). Receives two parameters: * `badgeCount` (number): a number you can show on your own badge, at most 99. The number of unread rewards, otherwise `1` for another unread notification such as an unseen alert, otherwise `0`. Unread views are not counted. Cello's own badge is a dot and doesn't show this number * `detailedCounts` (object): the unread counts by type, same shape as [`getUnreadEventCounts()`](#getunreadeventcounts) returns Called right at boot with all counts at `0`, again once notifications have loaded, and then on every change, including when the user opens the Referral Component and the counts are cleared. It can be called again with the same values, so make your handler safe to call repeatedly. **onAnnouncementChanged** `function` Callback for when the active [announcement](/guides/user-experience/referral-notifications-and-emails#announcement) changes. Use it to show announcements in your own UI instead of the Referral Component's announcement bubble. [Show your own announcement](/referral-component/custom-launcher#show-your-own-announcement) explains how, including how to turn off the bubble. Receives one parameter: the active `announcement` object (same shape as [`getActiveAnnouncement()`](#getactiveannouncement) returns), or `null`. * Called with `null` right at boot, then with the active announcement once it has loaded, if there is one * Called with the new announcement when one arrives, or after [`showAnnouncement`](#showannouncement-announcement) * Called again if the announcement content changes, e.g. after [`changeLanguage`](#changelanguage-language) * Called with `null` when the announcement is read or dismissed, including when the user opens the Referral Component ### Example ```javascript theme={null} window.cello = window.cello || { cmd: [] }; window.cello.cmd.push(async (cello) => { try { const options = { productId: "REPLACE_WITH_PRODUCT_ID", token: "REPLACE_WITH_TOKEN", language: "en", productUserDetails: { firstName: "Bob", lastName: "Bobsky", fullName: "Bob B Bobsky", email: "bob@gmail.com", }, onUserInteraction: (action, payload) => { console.log('user interaction', action, payload) if (action === 'linkCopied') { const urlThatWasCopied = payload // Handle the copied link (e.g., track analytics, show notification) } } }; await cello.boot(options); // Call other Cello commands, if necessary } catch (error) { console.error("Failed to boot cello:", error); } }); ``` *** ## `changeLanguage(language)` Changes the Referral Component language at runtime without re-initializing it. ```javascript theme={null} window.Cello("changeLanguage", "de"); ``` ### Accepts **language** `string` *required* The language string in ISO 639-1 ## `setThemeMode(theme)` Changes the Referral Component theme at runtime without re-initializing it. ```javascript theme={null} window.Cello("setThemeMode", "dark"); ``` ### Accepts **theme** `string` The theme mode to apply. Accepted values are `light` or `dark`. ## `close()` Closes Referral Component. ```javascript theme={null} window.Cello.close(); ``` *** ## `dismissAnnouncement()` Dismisses the active [announcement](/guides/user-experience/referral-notifications-and-emails#announcement) without opening the Referral Component. Use it for the close button when you show announcements in your own UI. The announcement is marked as read, and [`onAnnouncementChanged`](#cello-boot-options) is called with `null`. Does nothing if there is no active announcement. ```javascript theme={null} window.Cello("dismissAnnouncement"); ``` *** ## `getActiveAnnouncement()` Returns the active [announcement](/guides/user-experience/referral-notifications-and-emails#announcement) for the currently logged-in user, or `null` if there is none. Heading and text are translated and personalized the same way as in the Referral Component's own announcement bubble, including your label overrides. Use it when your page loads after the announcement arrived. To be notified when the announcement changes, use the [`onAnnouncementChanged`](#cello-boot-options) boot option. ```javascript theme={null} const announcement = await window.Cello("getActiveAnnouncement"); ``` ### Returns **announcement** `object | null` The active announcement object: **properties** **id** `string` Unique identifier of the announcement **type** `string` Announcement type, e.g. `welcome-announcement-1` **heading** `string` Announcement heading, translated to the current language **text** `string` Announcement text, translated to the current language. May contain simple `` markup **icon** `string` Optional icon name: `Heart`, `Success` or `Gift` **ctaLabel** `string` Optional call-to-action button label **ctaDestination** `string` Optional Referral Component page the call-to-action opens, e.g. `invite` or `rewards`. Pass it to [`open`](#open-destination) ### Example Example below shows the announcement in your own UI. The call-to-action opens the Referral Component on the right page, which also marks the announcement as read: ```javascript theme={null} const renderAnnouncement = (announcement) => { if (!announcement) { hideMyAnnouncement(); return; } showMyAnnouncement({ heading: announcement.heading, text: announcement.text, ctaLabel: announcement.ctaLabel, onCtaClick: () => window.Cello("open", announcement.ctaDestination), onClose: () => window.Cello("dismissAnnouncement"), }); }; await window.Cello("boot", { // ...other options onAnnouncementChanged: renderAnnouncement, }); // In a component that mounts later, read the active one renderAnnouncement(await window.Cello("getActiveAnnouncement")); ``` > [!NOTE] > > `text` can contain `` tags. If you insert it as HTML, sanitize it first. Otherwise, strip the tags and show it as plain text. ## `getActiveUcc()` Returns active `ucc` and invite `link` for the currently logged-in user. ```javascript theme={null} const { ucc, link } = await window.Cello("getActiveUcc"); ``` ### Returns **activeUcc** `object` The active ucc object: **properties** **ucc** `string` Active unique campaign code or referral code for the current logged-in user **link** `string` Personal invite link for the current logged-in user ## `getCampaignConfig()` Returns campaign config values for the currently logged-in user. ```javascript theme={null} const campaignConfig = await window.Cello("getCampaignConfig"); ``` ### Returns **campaignConfig** `object` The campaign config object: **properties** **primaryCurrency** `string` Primary currency code **revenuePercentage** `number` Percentage of attributed new revenue that will be paid as a reward **rewardCap** `number` Maximum reward that can be earned per referral **newSignupBonus** `number` Additional reward for signups to encourage more sharing **newPurchaseBonus** `number` Additional reward for purchases to encourage more sharing **newUserDiscountMonth** `number` How long new users get a discount **newUserDiscountPercentage** `number` The discount new users get ## `getLabels()` Returns select labels used in our Referral Component. ```javascript theme={null} const labels = await window.Cello("getLabels"); ``` ### Returns **labels** `object` The labels object: **properties** **customLauncher** `string` A welcome text useful for building custom launchers ## `getUnreadEventCounts()` Returns the unread counts for the currently logged-in user, the same counts that drive the Cello [notification badge](/guides/user-experience/referral-notifications-and-emails#alert-and-badge). Use it to read the counts once, e.g. when your launcher renders. To be notified when they change, use the [`onUnreadCountChanged`](#cello-boot-options) boot option. ```javascript theme={null} const counts = await window.Cello("getUnreadEventCounts"); ``` ### Returns **counts** `object` The unread counts: **properties** **badgeCount** `number` A number you can show on your own badge, the same value as the `badgeCount` parameter of [`onUnreadCountChanged`](#cello-boot-options). At most 99. Unread views are not counted. Cello's own badge is a dot and doesn't show this number **views** `number` Number of unread referral link views **rewards** `number` Number of unread rewards **alerts** `number` `1` if there is an unseen [alert](/guides/user-experience/referral-notifications-and-emails#alert-and-badge), otherwise `0` **shouldShowBadge** `boolean` Whether the Cello launcher shows the notification badge right now ### Example Example below shows a dot badge on your own launcher. To show a number instead, see [Show your own badge](/referral-component/custom-launcher#show-your-own-badge). ```javascript theme={null} const updateBadge = (counts) => { const badge = document.getElementById("my-referral-badge"); badge.hidden = !counts.shouldShowBadge; }; await window.Cello("boot", { // ...other options onUnreadCountChanged: (badgeCount, counts) => updateBadge(counts), }); // In a component that mounts later, read the current counts updateBadge(await window.Cello("getUnreadEventCounts")); ``` *** ## `hide()` Hides the Cello button or bookmark that launches the Referral Component. ```javascript theme={null} window.Cello("hide"); ``` *** ## `open(destination)` Opens Referral Component. ```javascript theme={null} window.Cello("open", destination); ``` ### Accepts **destination** `string` Optional destination string to open Referral Component on a specific tab or page. Without it, Referral Component opens on the invite tab: * `"rewards"` - open Referral Component on the rewards tab * `"edit-payments"` - open Referral Component on the payment details page ## `show()` Shows the Cello button or bookmark that launches the Referral Component. ```javascript theme={null} window.Cello("show"); ``` *** ## `showAnnouncement(announcement)` Triggers an [announcement](/guides/user-experience/referral-notifications-and-emails#announcement). ```javascript theme={null} window.Cello("showAnnouncement", announcement); ``` ### Accepts **announcement** `string` *required* ### Example Example below triggers a default welcome announcement: ```javascript theme={null} const announcement = { type: "welcome-announcement-1" }; window.Cello("showAnnouncement", announcement); ``` > [!WARNING] > > A fulfilled promise from `showAnnouncement` only means the SDK accepted the request. It does **not** mean the announcement is visible to the user. > > The announcement is anchored to the element matched by your **Announcement Selector** using `document.querySelector` (first match in DOM order). If that element is hidden, zero-sized, or off-screen, the announcement renders but is invisible. If you see `Promise {: undefined}` but no announcement, run `document.querySelectorAll("")` in the console - the result must be exactly one visible element. > > See [Troubleshooting: announcement not showing](/referral-component/custom-launcher#troubleshooting-announcement-not-showing) for the full diagnostic flow. ## `shutdown()` Shuts down connection to Cello and unmounts the Referral Component. ```javascript theme={null} window.Cello("shutdown"); ``` *** ## `updateProductUserDetails(productUserDetails)` Updates user details at runtime without re-initializing the Referral Component. ```javascript theme={null} window.Cello("updateProductUserDetails", productUserDetails); ``` ### Accepts **productUserDetails** `object` *required* The product user details object **properties** **email** `string` *required* Email of the product user. This data is used in the personalization of the referral experience, e.g. email notifications. Required for select features **firstName** `string` *required* First name of the product user. This data is used in the personalization of the referral experience, e.g. email notifications and the [personalized message to referees](/docs/add-personalized-message). Required for select features **lastName** `string` Last name of the product user **fullName** `string` Full name of the product user. Use this option if you do not have first name and last name separately. ### Example ```javascript theme={null} const productUserDetails = { email: "bob@gmail.com", firstName: "Bob", lastName: "Bobsky", fullName: "Bob Bobsky", }; window.Cello("updateProductUserDetails", productUserDetails); ``` *** ## Content Security Policy (CSP) Most applications don't need any changes here. This section only applies if your site enforces a Content Security Policy - if you don't set CSP headers, or your policy is permissive, you can skip it. The Cello Referral Component loads its script and assets from Cello domains at runtime. If your policy is restrictive, extend it with the following sources so the Referral Component can load and run: ```text theme={null} script-src https://assets.cello.so connect-src https://share.cello.so img-src https://cdn.cello.so https://p.typekit.net blob: data: style-src https://use.typekit.net https://p.typekit.net 'unsafe-inline' font-src https://use.typekit.net https://p.typekit.net ``` > [!NOTE] > > * These directives extend your existing policy; if you use a restrictive `default-src`, keep all of the above explicit. > * Sandbox environments use the equivalent `*.sandbox.cello.so` domains (for example `https://assets.sandbox.cello.so` and `https://share.sandbox.cello.so`). If the Referral Component fails to load and your browser console shows errors like `Refused to connect because it violates the document's Content Security Policy`, see [Troubleshooting](/referral-component/quickstart#troubleshooting) in the Referral Component quickstart. ### Nonce-based policies If your `style-src` or `script-src` contains a `'nonce-...'` source, browsers ignore `'unsafe-inline'`. The Referral Component then cannot apply its styles and renders without them. Pass the nonce of the current response to `boot` instead, and put it on the two script tags as well: ```html theme={null} ``` The Referral Component puts the nonce on every style it creates and on the font stylesheet it loads. `'unsafe-inline'` is no longer needed in `style-src`; keep the Cello and Typekit hosts listed above. Pass a fresh nonce on every page load. A nonce reused across responses defeats the policy. # Embedded Script Tag Source: https://docs.cello.so/sdk/client-side/embedded-script-tag Learn how to add Cello attribution script to your website Attribution script helps you to capture referral code on your landing pages and make it available at signup to attribute referral conversions to the right referrers. In addition, it helps you to personalize messages for referees on the landing page, get discount information and detect potential fraud and abuse of your referral program. **Script Loading Context:** The attribution script loads asynchronously and methods become available shortly after page load. All attribution methods use the unified `window.CelloAttribution("methodName")` syntax. # Adding the script You can add attribution script to your website like any other third party JavaScript code by inserting the following code snippet into the `` tag of **each page** on your website. > [!NOTE] > > Make sure to use `type="module"` and `async` html params in the script tag > [tab] Sandbox URL > > ```javascript theme={null} > > ``` > [tab] Production URL > > ```javascript theme={null} > > ``` # Verifying the installation Now that you have added the attribution script to your website, make sure that the `ucc` is available on the signup page. To verify, follow these steps: ## Step 1: Test with URL parameters Add `?productId=test` and `?ucc=test` to your website URL: ```html theme={null} https://yourwebsite.com/?productId=test&ucc=test ``` ## Step 2: Check cookie storage Open browser developer tools (F12) and verify these values are saved in cookies: * `cello-product-id` should contain `test` * `cello-referral` should contain `test` ## Step 3: Test method access Navigate to your signup page and test the attribution methods from the browser console: ```javascript theme={null} // Wait for script to load if needed setTimeout(async () => { try { const ucc = await window.CelloAttribution('getUcc'); console.log('UCC test result:', ucc); // Should return 'test' // Test other methods const referrerName = await window.CelloAttribution('getReferrerName'); const campaignConfig = await window.CelloAttribution('getCampaignConfig'); console.log('Attribution methods working:', { ucc, referrerName, campaignConfig }); } catch (error) { console.error('Attribution test failed:', error); } }, 2000); ``` Expected result: ```javascript theme={null} Promise {: 'test'} ``` ## Troubleshooting Installation Issues ### Script not loading ```javascript theme={null} // Check if script loaded if (typeof window.CelloAttribution !== 'function') { console.error('Attribution script failed to load'); // Check network tab for loading errors // Verify script URL is accessible } ``` ### Methods return undefined * Wait longer for script initialization (try 3-5 seconds) * Check browser console for JavaScript errors * Verify script tag has `type="module"` and `async` attributes * Ensure no ad blockers are interfering ### Cookie issues * Check if cookies are enabled in browser * Verify no GDPR/cookie consent is blocking storage * Test in incognito mode to rule out extensions **Installation successful** if methods return expected values and cookies are stored properly. **Need help?** Check the [troubleshooting guide](/sdk/client-side/attribution-js-usage#troubleshooting) for common issues and solutions. # Google Tag Manager Source: https://docs.cello.so/sdk/client-side/google-tag-manager How to add the Cello attribution script to your site using Google Tag Manager Learn how to install the Cello attribution script on your website using Google Tag Manager (GTM). This method is ideal for teams who want to manage tracking scripts without direct code changes. ## Prerequisites Before you begin, ensure you have: * A Google Tag Manager account and container set up on your website * Admin access to your GTM container * Your Cello product ID from the Cello Portal ## Step 1: Create a New Tag 1. Log in to your Google Tag Manager account 2. Select the container for your website 3. Click **Tags** in the left sidebar 4. Click the **New** button to create a new tag 5. Click the **Tag Configuration** area ## Step 2: Add the Cello Attribution Script 1. Select **Custom HTML** as the tag type 2. In the HTML field, paste the following code: ```html theme={null} ``` 3. Name your tag (e.g., "Cello Attribution Script") ## Step 3: Configure Consent Settings If your GTM container uses a Consent Management Platform (such as Cookiebot, OneTrust, or CookieFirst) with Google Consent Mode, you must configure the tag's consent settings to prevent the script from being blocked. 1. In the tag editor, expand **Advanced Settings** 2. Scroll down to **Consent Settings** 3. Select **"No additional consent required"** > [!WARNING] > > If you leave consent settings as **"Not set"** (the default), the tag inherits your container's consent behavior. When Consent Mode is active, this typically means the tag will be blocked until cookie consent is granted - causing the attribution script to **load inconsistently or not at all**. Cello's attribution cookies are classified as [strictly necessary / essential cookies](/landing-pages/manage-cookies). They store only the referral campaign code (`ucc`) and do not track user identity. Many customers treat them as essential and load them independently of cookie consent banners. Consult your legal team to confirm this aligns with your compliance requirements. ## Step 4: Configure the Trigger 1. Click the **Triggering** area 2. Choose when you want the Cello attribution script to load: ### Option A: All Pages (Recommended) * Select **All Pages** trigger * This ensures referral codes are captured on any landing page ### Option B: Specific Pages Only If you only want to track attribution on specific pages: 1. Click the **+** to create a new trigger 2. Select **Page View → Some Page Views** 3. Configure conditions (e.g., Page URL contains "landing" or "signup") ## Step 5: Save and Publish 1. Click **Save** to save your tag 2. Give your tag a descriptive name (e.g., "Cello Attribution - All Pages") 3. Click **Submit** to create a new version 4. Add a version description (e.g., "Added Cello referral attribution tracking") 5. Click **Publish** to make the changes live ## Step 6: Test Your Installation ### Method 1: Browser Console Test 1. Open your website in a new browser tab 2. Open the browser's developer console (F12) 3. Type the following command: ```javascript theme={null} window.CelloAttribution('getUcc') ``` If the script is installed correctly, you should see a Promise response: ```javascript theme={null} Promise {} ``` ### Method 2: Test with Referral Parameters 1. Add the `?ucc=test123&productId=test` query parameters to your website URL: ``` https://yourwebsite.com/?ucc=test123&productId=test ``` 2. Check that the referral cookies are being set in your browser: * Open Developer Tools → Application → Cookies * Look for `cello-referral` and `cello-product-id` cookies 3. Test `ucc` retrieval in the console: ```javascript theme={null} window.CelloAttribution('getUcc').then(ucc => console.log('ucc:', ucc)) ``` Expected output: `ucc: test123` ### Method 3: GTM Preview Mode 1. In GTM, click **Preview** to enter debug mode 2. Visit your website - you should see the GTM debug panel 3. Verify that your "Cello Attribution Script" tag is firing on the correct pages > [!TIP] > > **Success indicators:** > > * Cello attribution tag fires in GTM preview > * `window.CelloAttribution` function is available in console > * `ucc` cookies are set when visiting with referral parameters > * `getUcc()` method returns referral codes correctly ## Troubleshooting ### Attribution script loads inconsistently If the Cello attribution script only loads on some page views (works on one refresh but not the next), this is almost always caused by **Google Consent Mode** blocking the tag. **Why it happens:** When your GTM container has Consent Mode configured, the default consent state is set to "denied." If the Cello tag's consent settings are left as "Not set," GTM may block the tag before the returning visitor's prior consent choice is restored from the cookie - creating a race condition where the script sometimes fires and sometimes doesn't. **Fix:** Edit the Cello Attribution Script tag → **Advanced Settings** → **Consent Settings** → select **"No additional consent required"**. See [Step 3](#step-3-configure-consent-settings) above. You can verify this is the cause by opening **GTM Preview** mode and checking whether the Cello tag shows as "Blocked" or displays a consent-related note next to it. # User Authentication Source: https://docs.cello.so/sdk/client-side/user-authentication The Cello Referral Component contains sensitive data such as the identity of the referee, amounts of payouts and details regarding your user's referral flow e.g. notifications. We use JWT (JSON Web token) to authenticate the user and authorize access to the data in the Referral Component. The expected flow is as follows: 1. User logs into your system. 2. Your **backend** provides your frontend code with a **Cello JWT token**. 3. Your frontend code initializes the Referral Component with the **token**. ## Generating the token > [!CAUTION] > > Keep your credentials safe. **Never** generate a token or store your secret on the client side! To generate a valid Cello JWT token, you'll need: 1. Your Cello credentials: **productId** and **product secret** 2. A **productUserId** that uniquely identifies the logged-in user 3. A token signing library for your tech stack of choice. A good variety can be found in the [JWT community](https://jwt.io/libraries) For more resources on **server-side token** generation see [JWT community](https://jwt.io/introduction). ### Credentials You will require both **productId** and **product secret** to generate tokens for your users. You can find these in your [Cello Portal](https://app.cello.so/developers/access-keys): ![Portal Credentials Access Keys productId and PRODUCT_SECRET for Referral Component Cello JS](https://mintcdn.com/cello/6Zr08teY9AER0ncF/sdk/client-side/cello-sdk-cello-js-user-authentication-portal-credentials-accesskeys-productId-productSecret.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=3b5be72ede62019ba00873e5bbf8d8b0) ### User identity Cello requires a **productUserId** - a unique user identifier to be passed when initializing the Referral Component. This can be a user id that you already use to identify users in your product. It can also be any other new unique identifier you generate - the main requirement is that it is unique per user accross your application. > [!WARNING] > > It is important that this ID is **unique per user**, rather than organisation. ### JWT signing library Regardless of the signing library you choose, make sure you use the `HS512` signing algorithm: ```json theme={null} { "alg": "HS512", "typ": "JWT" } ``` ### Token generation Token payload attributes: **productId** `string` *required* Identifier of the product your users will refer **productUserId** `string` *required* Your logged-in user's unique identifier within your system **iat** `int` *required* A token issuing Unix timestamp. Example: `1661876739` **signupDate** `string` Original signup date of the user. This helps to improve [accuracy](/guides/attribution/auto-attribution) for auto-attributions. **orgIds** `list` List of organizations the user is assigned to. This is required to enable automatic attribution when referrals are based on organizations. [More information](/guides/attribution/auto-attribution). > [!NOTE] > > Note that some libraries do not require you to pass `iat` in the payload and default to the current time if you don't. ### Example Example of token generation in a NodeJS backend with JavaScript: ```javascript theme={null} import { sign } from 'jsonwebtoken'; const tokenPayload = { productId: 'REPLACE_WITH_PRODUCT_ID', productUserId: 'REPLACE_WITH_CURRENT_USER_ID', signupDate: '2022-10-05T14:14:34Z', orgIds: ['ORG_1, ORG_2'] }; const secret = 'REPLACE_WITH_PRODUCT_SECRET'; const token = sign(tokenPayload, secret, { algorithm: 'HS512', }); ``` > [!CAUTION] > > Creating a JWT token should **always** be done in your backend code and **not in the browser**! Below is an example content of the generated JWT token. ```json theme={null} { "productId": "acme.com", "productUserId": "123456", "iat": 1662712365 } ``` ## Using the token Finally, provide the server side-generated token in the `token` property when initializing the Referral Component. ```javascript theme={null} window.cello = window.cello || { cmd: [] }; window.cello.cmd.push(async (cello) => { await cello.boot({ productId: "REPLACE_WITH_PRODUCT_ID", token: "REPLACE_WITH_TOKEN", ...otherOptions, }); }); ``` # Introduction Source: https://docs.cello.so/sdk/introduction Explore our SDKs for adding referrals to your web and mobile apps. # Web SDKs > [card] [Cello JS](/sdk/client-side/cello-js-introduction) > > Referral component for your web app > [card] [Attribution JS](/sdk/client-side/attribution-js-introduction) > > Script for tracking referrals on landing pages # Mobile SDKs > [card] [iOS SDK](/sdk/mobile/ios) > > Referral component for your iOS app > [card] [Android SDK](/sdk/mobile/android) > > Referral component for your Android app > [card] [ReactNative SDK](/sdk/mobile/react-native) > > Referral component for iOS and Android # Cello for Android Source: https://docs.cello.so/sdk/mobile/android The Cello SDK for Android enables you to add a referral program into your Android app. With a plug-n-play mobile component, your users can easily share their invite link with their friends and network using mobile sharing options convenient for them, receive rewards and get paid out. ## Installation You can install Cello for Android using Gradle or manually. A basic installation takes around 15 minutes but will take a little longer if you want to customize the way the Cello Referral Component is launched. ### Compatibility Cello SDK for Android is compatible with API 21 and up. ### SDK size The size of Cello for Android once installed varies depending on your app’s configuration. Around 7MB is the average size increase we would expect to see if you're minifying your app correctly. ## Setup Install Cello to see and give your users the option to spread the word from your Android app. Cello for Android supports API 21 and above. **Note:** We recommend using the latest available `compileSdkVersion`. ### Install Cello Add the following dependency to your app’s `build.gradle` file: #### Groovy (or Kotlin DSL) ```gradle theme={null} dependencies { implementation("so.cello.android:cello-sdk:0.9.1") } ``` Also, ensure that Maven Central is added to your root `build.gradle`: ```gradle theme={null} allprojects { repositories { mavenCentral() } } ``` ### Choose an Environment In your Cello SDK setup, you have the flexibility to select the environment in which your application will run. This feature is especially useful for different stages of development, such as testing in a development or staging environment before going live in production. The available environments are: * `prod` (Production) – *default* * `sandbox` (Sandbox) #### Configuration Steps In your Android project, open or create `res/values/config.xml`, then add: ```xml theme={null} prod ``` To change the environment, simply replace the value of `cello_env`. For instance, to set the environment to sandbox: ```xml theme={null} sandbox ``` Save and rebuild your project to apply. Using this configuration, the Cello SDK will adapt to the specified environment, allowing for more controlled development and testing processes. ## Initialize Cello In this step, you will need your **product ID** and a **token** you have generated for the user, similar when [**implementing the web based Referral component**](https://docs.cello.so/docs/user-authentication). `initialize` takes an `Activity`, so call it from your activity rather than from `Application`: ```kotlin theme={null} class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) Cello.initialize(this, "YOUR_PRODUCT_ID", token) } } ``` Calling `initialize` again with a different activity updates the activity the SDK holds, so it is safe to call from each activity that needs the referral component. ### Knowing when the SDK is ready `initialize` returns immediately and does its work in the background. Pass `onComplete` to find out when it has finished, and whether it failed. Available from 0.15.0. ```kotlin theme={null} Cello.initialize(this, "YOUR_PRODUCT_ID", token) { result -> when (result) { is CelloInitializationResult.Success -> Log.d("Cello", "ready: ${result.configuration.optString("referrerId")}") is CelloInitializationResult.Failure -> Log.e("Cello", "initialization failed", result.error) } } ``` The callback fires once per call, on the main thread, whether initialization succeeds or fails. You do not need to wait for it before calling `openWidget`, `showFab`, `updateToken`, `changeLanguage` or `setThemeMode`. Those are queued while initialization is in progress and run once it completes. > [!NOTE] > > Before 0.15.0 there was no way to observe the result. A failed initialization > was only logged, so a later `openWidget` call would silently do nothing. ## Customize the Cello Referral Component The Cello SDK allows for various levels of customization to better fit into your app's design and flow. One of the main components you might want to customize is the [**Referral component**](https://docs.cello.so/docs/component-overview) You have two options to launch the referral component: ### Default Launcher If you choose to go with the default launcher, you can call the `showFab()` method from the Cello SDK to present a Floating Action Button (FAB) within your app. This FAB is pre-styled but may not perfectly match your app's look and feel. ```kotlin theme={null} Cello.client().showFab() ``` ### Custom Launcher If the default launcher does not fit your needs, you can implement your own custom launcher. This could be any UI element like a button, menu item, or even a gesture. To open the Referral component using a custom launcher, you can call `Cello.openWidget()`. ```kotlin theme={null} Cello.client().openWidget() ``` Example using Compose: ```kotlin theme={null} Button(onClick = { Cello.client().openWidget() }) { Text("Open Referral") } ``` ## Android API ### `Cello.initialize()` Initializes the Cello referral component. | Name | Type | Description | Required | | - | - | - | - | | activity | Activity | This is the reference to the MainActivity | Yes | | productId | String | Identifier of the product your users will refer | Yes | | token | String | Access token generated for the given user | Yes | | productUserDetails | ProductUserDetails | Product user details | No | | language | String | Initial language of the widget | No | | themeMode | String | Initial theme mode: `"light"` or `"dark"` | No | ```kotlin theme={null} import com.cello.cello_sdk.ProductUserDetails val productUserDetails = ProductUserDetails( firstName = "John", lastName = "Doe", fullName = "John Doe", email = "john.doe@example.com" ) Cello.initialize(this, "YOUR_PRODUCT_ID", token, productUserDetails = productUserDetails, language = 'de', themeMode = 'light') ``` ### `Cello.showFab()` Shows the Floating action button or bookmark that launches the Referral Component ```kotlin theme={null} Cello.client().showFab() ``` ### `Cello.hideFab()` Hides the Floating action button or bookmark that launches the Referral Component ```kotlin theme={null} Cello.client().hideFab() ``` ### `Cello.openWidget()` Opens the referral component. ```kotlin theme={null} Cello.client().openWidget() ``` ### `Cello.hideWidget()` Hides the referral component. ```kotlin theme={null} Cello.client().hideWidget() ``` ### `Cello.addWidgetListener()` Tells you when the referral component opens and closes. Available from 0.16.0. ```kotlin theme={null} val widgetListener = object : CelloWidgetListener { override fun onWidgetOpened() { Log.d("Cello", "Referral component opened") } override fun onWidgetClosed() { Log.d("Cello", "Referral component closed") } } Cello.addWidgetListener(widgetListener) // When you no longer need it Cello.removeWidgetListener(widgetListener) ``` * Both methods are optional, so override only the ones you need. Listeners are called on the main thread. * You can register a listener before `Cello.initialize()`, and it stays registered after `Cello.shutdown()`. * `onWidgetOpened()` fires when the component is shown, whether from `openWidget()` or the default launcher. * `onWidgetClosed()` fires as the component starts to dismiss, whatever closed it: the close button, system back, swiping it down, `hideWidget()` or `shutdown()`. Opening the share sheet from inside the component doesn't count as closing. ### `Cello.getActiveUcc()` A method to get an active `ucc` and invite link for the currently logged in user. ```kotlin theme={null} val result = Cello.client()?.getActiveUcc() // mapOf("ucc" to "...", "link" to "...") or null before initialization ``` ### `Cello.getConfiguration()` Returns the state of the initialised SDK, or `null` if the SDK is not ready yet. `null` means "not initialised", not "this user has no referral data". Available from 0.15.0. ```kotlin theme={null} val configuration = Cello.client()?.getConfiguration() if (configuration != null) { Log.d("Cello", "${configuration.ucc} ${configuration.shareLink}") Log.d("Cello", "${configuration.views} ${configuration.unreadViewsCount}") } ``` Exposes `productId`, `referrerId`, `campaignId`, `ucc`, `shareLink`, `productName`, `language`, `supportedLanguages`, `themeMode`, `platform`, `sdkVersion`, `tokenTTL`, `totalEarnedRewards`, `views`, `unreadViewsCount`, `hasPaymentDetails`, `onboardingShown`, `isUserBlocked`, `isWidgetUnavailable`, `showFullWidget`, `showEnhancedView`, `isTablet` and `campaignConfig`. `tokenTTL` is `-1` when token expiry checking is disabled for the product, which is the default. Use `toMap()` if you need a serialisable form, for example to pass across a bridge. This replaces the older `configuration` property, which is deprecated. That property returns the raw initialization response and an empty object before the SDK is ready, so there is no way to tell "not ready" from "no data". ## `getCampaignConfig()` Returns campaign config values for the currently logged-in user. ```kotlin theme={null} let result = Cello.client().getCampaignConfig() ``` ### Returns **campaignConfig** `object` The campaign config object: **properties** **primaryCurrency** `string` Primary currency code **revenuePercentage** `number` Percentage of attributed new revenue that will be paid as a reward **rewardCap** `number` Maximum reward that can be earned per referral **newSignupBonus** `number` Additional reward for signups to encourage more sharing **newPurchaseBonus** `number` Additional reward for purchases to encourage more sharing **newUserDiscountMonth** `number` How long new users get a discount **newUserDiscountPercentage** `number` The discount new users get ### `Cello.changeLanguage()` A method to change the language of the Referral component at runtime without re-initialising it. ```kotlin theme={null} Cello.client().changeLanguage("de") ``` ### `Cello.setThemeMode()` A method to change the theme mode of the Referral component at runtime without re-initialising it. ```kotlin theme={null} Cello.client().setThemeMode("dark") ``` **Parameters:** * `themeMode` (*String*): The theme mode to set. Valid values are `"light"` or `"dark"`. ### `Cello.shutdown()` Shuts down connection to Cello and unmounts the component ```kotlin theme={null} Cello.client().shutdown() ``` *** ## Error Handling ### Common Error Scenarios #### 1. Invalid Parameters **What it means:** The product ID or token provided during initialization is empty or blank. **Error behavior:** * SDK initialization is **silently skipped** * Warning logged: `"Initialization skipped: productId and token must not be empty or blank"` * No exception thrown **Common causes:** * Empty strings for productId or token * Whitespace-only strings *** #### 2. Network/API Errors **What it means:** The network request to initialize the SDK or update token failed. **Error type:** `RuntimeException("Response not successful")` **Common causes:** * No internet connection * Server errors (5xx responses) * HTTP errors (4xx responses) * Timeout issues * Firewall or proxy blocking requests *** #### 3. Activity State Errors **What it means:** The Activity is destroyed, finishing, or not available when trying to perform UI operations. **Error type:** `IllegalStateException("Activity is not valid")` **Error message:** `"Cannot perform UI operation - Activity is not available or destroyed"` **Common causes:** * Calling SDK methods after Activity is destroyed * Activity finishing during async operations * Attempting UI operations during Activity transitions *** #### 4. Initialization Failures **What it means:** The SDK failed to initialize due to an error in the initialization process. **Error behavior:** * Exception passed to callback * Error logged: `"Error initializing widget: {exception message}"` * Pending operations cleared **Common causes:** * Network connectivity issues * Invalid credentials (product ID or token) * Server-side configuration issues *** ### Error Handling Best Practices **1. Always handle both success and error cases:** ```kotlin theme={null} Cello.initialize(this, productId, token) { config, exception -> if (exception != null) { // Handle error Log.e("Cello", "Error: ${exception.message}") showErrorMessage("Unable to initialize referral system") } else { // Handle success Log.d("Cello", "Initialized successfully") setupReferralFeatures(config) } } ``` **2. Validate parameters before SDK calls:** ```kotlin theme={null} fun initializeCello(productId: String, token: String) { // Validate product ID if (productId.isBlank()) { Log.e("Cello", "Product ID cannot be empty") showError("Configuration error") return } // Validate token if (token.isBlank()) { Log.e("Cello", "Token cannot be empty") showError("Authentication error") return } // Check Activity state if (isFinishing || isDestroyed) { Log.e("Cello", "Cannot initialize - Activity is finishing") return } Cello.initialize(this, productId, token) { config, error -> // Handle result } } ``` **3. Implement retry logic for network errors:** ```kotlin theme={null} class CelloManager(private val activity: Activity) { private var retryCount = 0 private val maxRetries = 3 fun initializeWithRetry(productId: String, token: String) { Cello.initialize(activity, productId, token) { config, exception -> if (exception != null) { handleInitializationError(exception, productId, token) } else { retryCount = 0 onInitializationSuccess(config) } } } private fun handleInitializationError( exception: Exception, productId: String, token: String ) { Log.e("Cello", "Initialization error: ${exception.message}") // Retry for network errors if (exception is RuntimeException && retryCount < maxRetries) { retryCount++ val delay = (2000L * retryCount) // Linear backoff Handler(Looper.getMainLooper()).postDelayed({ Log.d("Cello", "Retrying initialization (attempt $retryCount)") initializeWithRetry(productId, token) }, delay) } else { // Max retries reached or non-recoverable error retryCount = 0 showFinalError("Failed to initialize after $maxRetries attempts") } } } ``` **4. Track initialization state:** ```kotlin theme={null} class CelloStateManager(private val activity: Activity) { private var initializationState = InitState.NOT_INITIALIZED enum class InitState { NOT_INITIALIZED, INITIALIZING, INITIALIZED, FAILED } fun initialize(productId: String, token: String) { if (initializationState == InitState.INITIALIZING) { Log.w("Cello", "Initialization already in progress") return } initializationState = InitState.INITIALIZING Cello.initialize(activity, productId, token) { config, exception -> if (exception != null) { initializationState = InitState.FAILED Log.e("Cello", "Initialization failed") } else { initializationState = InitState.INITIALIZED Log.d("Cello", "Initialization successful") } } } fun showWidget() { when (initializationState) { InitState.NOT_INITIALIZED -> { Log.w("Cello", "SDK not initialized") } InitState.INITIALIZING -> { Log.w("Cello", "SDK still initializing") } InitState.FAILED -> { Log.e("Cello", "Cannot show widget - initialization failed") } InitState.INITIALIZED -> { Cello.openWidget() } } } } ``` **5. Handle Activity lifecycle properly:** ```kotlin theme={null} class MainActivity : AppCompatActivity() { private var isCelloReady = false override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) initializeCello() } private fun initializeCello() { Cello.initialize(this, productId, token) { config, error -> if (error == null && !isFinishing && !isDestroyed) { isCelloReady = true } } } fun performCelloAction() { // Always check Activity and SDK state if (isFinishing || isDestroyed) { Log.w("Cello", "Activity is finishing - cannot perform action") return } if (!isCelloReady) { Log.w("Cello", "SDK not ready") return } Cello.openWidget() } override fun onDestroy() { super.onDestroy() if (isFinishing) { isCelloReady = false Cello.shutdown() } } } ``` ### Getting Help If you encounter an error you can't resolve: 1. Check the error scenario in the reference above 2. Verify your integration follows the code examples 3. Check logcat for detailed error messages: `adb logcat | grep cello-sdk` 4. Verify network connectivity and firewall settings 5. Ensure product ID and token are valid and not empty 6. Check Activity lifecycle (not finishing or destroyed) 7. Contact Cello support with: * Full error message and stack trace from logcat * Steps to reproduce * SDK version * Android OS version and device model * Network conditions when error occurred # Cello for Flutter Source: https://docs.cello.so/sdk/mobile/flutter Beta The Cello Flutter SDK allows you to use Cello for iOS and Cello for Android in your Flutter apps. With a plug-n-play mobile component, your users can easily share their invite link with their friends and network using mobile sharing options convenient for them, receive rewards and get paid out. ## Installation A basic installation takes around 15 minutes, but will take a little longer if you want to customize the way the Cello Referral Component is launched. **Compatibility** * The Cello Flutter SDK supports Flutter **3.3.0** and above (Dart 3+). * Cello for iOS supports **iOS 15+**. * Cello for Android supports **API 21+**. ### Install Cello ```bash theme={null} flutter pub add cello_sdk ``` Or add to your `pubspec.yaml`: ```yaml theme={null} dependencies: flutter: sdk: flutter cello_sdk: ^0.0.1 ``` Then run: ```bash theme={null} flutter pub get ``` ### Android Setup The Flutter plugin automatically handles linking for Android. Ensure your app's `android/app/build.gradle` has the correct configuration: ```gradle theme={null} android { compileSdk 34 defaultConfig { minSdk 21 // ... other config } } ``` Ensure your project's `android/build.gradle` (or app-level) includes: ```gradle theme={null} repositories { google() mavenCentral() } ``` #### Internet Permission Add internet permission in `android/app/src/main/AndroidManifest.xml`: ```xml theme={null} ``` ### iOS Setup The iOS SDK ships inside the plugin, and the plugin supports both Swift Package Manager and CocoaPods. With Flutter 3.44 or newer, Swift Package Manager is on by default and there is nothing to run: `flutter run` and `flutter build ios` add the plugin to your app. Set your app's minimum iOS version to 15.0 or higher (**Minimum Deployments** in the Runner target in Xcode). If your app still uses CocoaPods (an older Flutter version, or Swift Package Manager turned off), make sure your `ios/Podfile` specifies iOS 15.0+: ```ruby theme={null} platform :ios, '15.0' ``` Then, from your `ios/` directory, run: ```bash theme={null} cd ios pod install cd .. ``` > [!NOTE] > > Don't also add `CelloSDK` to your app through the `Podfile` or Swift Package Manager. The plugin already includes it, and the app must not get two copies of the framework. ## Choose an Environment In your Cello SDK setup, you have the flexibility to select the environment in which your application will run. This feature is especially useful for different stages of development, such as testing in a development or staging environment before going live in production. The available environments are: * `production` or `prod` (Production) *(default)* * `sandbox` (Sandbox) You specify the environment when initializing Cello: ```dart theme={null} await Cello.initialize( CelloInitializeOptions( productId: 'your-product-id', token: 'your-token', environment: 'sandbox', // or 'production' ), ); ``` ## Customize the Cello Referral Component The Cello Flutter SDK allows for various levels of customization to better fit into your app's design and flow. One of the main components you might want to customize is the [**Referral component**](https://docs.cello.so/docs/component-overview) ### Choose Your Launcher The library provides two ways to launch the Referral component: **Default launcher** If you choose to go with the default launcher, you can call the `showFab()` method from the Cello library to present a Floating Action Button (FAB) within your app. This FAB is pre-styled but may not perfectly match your app's look and feel. ```dart theme={null} import 'package:cello_sdk/cello_sdk.dart'; await Cello.showFab(); ``` **Custom launcher** If the default launcher does not fit your needs, you can implement your own custom launcher. This could be any UI element like a button, menu item, or even a gesture. To open the Referral component using a custom launcher, you can call `Cello.openWidget()`. ```dart theme={null} import 'package:cello_sdk/cello_sdk.dart'; ElevatedButton( onPressed: () async { await Cello.openWidget(); }, child: Text('Open Referral'), ) ``` ## Flutter API ### `Cello.initialize(CelloInitializeOptions): Future` Initializes the Cello referral component. ### CelloInitializeOptions | Property | Type | Required | Description | | - | - | - | - | | productId | String | yes | Your product ID from Cello Portal | | token | String | yes | User authentication token | | environment | String? | no | Environment: `"production"` or `"sandbox"` | | productUserDetails | ProductUserDetails | no | User details object (see below) | | language | String? | no | Initial language of the widget | | themeMode | String? | no | Initial theme mode: `"light"`, `"dark"`, or `"system"` | ### ProductUserDetails Optional object with user information: | Property | Type | Description | | - | - | - | | firstName | String | User's first name | | lastName | String | User's last name | | fullName | String | User's full name | | email | String | User's email address | ```dart theme={null} import 'package:cello_sdk/cello_sdk.dart'; final config = await Cello.initialize( CelloInitializeOptions( productId: 'your-product-id', token: 'your-token', environment: 'production', productUserDetails: ProductUserDetails( firstName: 'John', lastName: 'Doe', fullName: 'John Doe', email: 'john.doe@example.com', ), language: 'de', themeMode: 'system', ), ); ``` ### `Cello.showFab(): Future` Shows the default Cello button that launches the Referral Component ```dart theme={null} await Cello.showFab(); ``` ### `Cello.hideFab(): Future` Hides the default Cello button that launches the Referral Component ```dart theme={null} await Cello.hideFab(); ``` ### `Cello.openWidget({String? destination}): Future` Opens the referral component. Pass a destination to open straight onto a specific page. ```dart theme={null} await Cello.openWidget(); await Cello.openWidget(destination: 'rewards'); await Cello.openWidget(destination: 'edit-payments'); ``` `rewards` and `edit-payments` are the supported destinations. Available from 0.1.0. ### `Cello.hideWidget(): Future` Hides the referral component. ```dart theme={null} await Cello.hideWidget(); ``` ### `Cello.getActiveUcc(): Future>` A method to get an active `ucc` and related data for the currently logged in user. ```dart theme={null} final ucc = await Cello.getActiveUcc(); // Returns: { "ucc": "...", "link": "..." } or empty map ``` ### `Cello.getCampaignConfig(): Future>` A method to get the campaign configuration. ```dart theme={null} final config = await Cello.getCampaignConfig(); // Returns: Map with campaign settings ``` ### `Cello.getConfiguration(): Future` Returns the state of the initialised SDK, or `null` if the SDK is not ready yet. `null` means "not initialised", not "this user has no referral data". Available from 0.1.0. ```dart theme={null} final configuration = await Cello.getConfiguration(); if (configuration != null) { print('${configuration.ucc} ${configuration.shareLink}'); print('${configuration.views} views, ${configuration.unreadViewsCount} unread'); } ``` `CelloSdkConfiguration` has the same fields as the native SDKs' configuration: `productId`, `referrerId`, `campaignId`, `ucc`, `shareLink`, `productName`, `language`, `supportedLanguages`, `themeMode`, `platform`, `sdkVersion`, `tokenTTL`, `totalEarnedRewards`, `views`, `unreadViewsCount`, `hasPaymentDetails`, `onboardingShown`, `isUserBlocked`, `isWidgetUnavailable`, `showFullWidget`, `showEnhancedView`, `isTablet` and `campaignConfig`. The string fields and `campaignConfig` are nullable. ### `Cello.changeLanguage(String language): Future` A method to change the language of the Referral component at runtime without re-initialising it. **Note**: Requires iOS 14+ on iOS platform. ```dart theme={null} await Cello.changeLanguage('de'); ``` ### `Cello.setThemeMode(String themeMode): Future` A method to change the theme mode of the Referral component at runtime without re-initialising it. **Note**: Requires iOS 14+ on iOS platform. ```dart theme={null} await Cello.setThemeMode('dark'); ``` **Parameters:** * `themeMode` (*String*): The theme mode to set. Valid values are `"light"`, `"dark"`, or `"system"`. ### `Cello.updateToken(String token): Future` Updates the user authentication token without re-initializing. **Note**: Requires iOS 14+ on iOS platform. ```dart theme={null} await Cello.updateToken('new-token'); ``` ### `Cello.shutdown(): Future` Shuts down connection to Cello and unmounts the component ```dart theme={null} await Cello.shutdown(); ``` ### `Cello.tokenEvents: Stream` A broadcast stream that emits token lifecycle events. ```dart theme={null} Cello.tokenEvents.listen((event) { switch (event.type) { case CelloTokenEventType.tokenAboutToExpire: // Refresh your token refreshToken(); break; case CelloTokenEventType.tokenHasExpired: // Handle expired token handleExpiredToken(); break; } }); ``` ### `Cello.widgetEvents: Stream` A broadcast stream that emits when the referral component opens and closes. Available from 0.2.0, with the native SDKs 0.16.0. ```dart theme={null} final subscription = Cello.widgetEvents.listen((event) { switch (event.type) { case CelloWidgetEventType.opened: print('Referral component opened'); break; case CelloWidgetEventType.closed: print('Referral component closed'); break; } }); // When you no longer need it await subscription.cancel(); ``` * `opened` fires when the component is shown, whether from `Cello.openWidget()` or the default launcher. * `closed` fires as the component starts to dismiss, whatever closed it: the close button, system back, swiping it away, `Cello.hideWidget()` or `Cello.shutdown()`. Opening the share sheet from inside the component doesn't count as closing. *** ## Error Handling ### Exception types The Cello Flutter SDK throws `PlatformException` with specific error codes when operations fail: | Code | Platform(s) | Trigger | Typical causes | | - | - | - | - | | `InitializationError` | iOS & Android | `Cello.initialize` completes with native failure | Invalid/empty product ID or token, network issues, bad environment | | `InitializationException` | Android | Unexpected exception inside `Cello.initialize` | Activity finishing, SDK not linked correctly, runtime crash | | `ActivityUnavailable` | Android | `Cello.initialize` without an active Activity | Initialization triggered too early (e.g. before app fully ready) | | `TokenUpdateError` | iOS | `Cello.updateToken` failure | Token expired/invalid, network errors | | `LanguageChangeError` | iOS | `Cello.changeLanguage` failure | Unsupported language code, network errors | | `ThemeModeChangeError` | iOS | `Cello.setThemeMode` failure | Invalid theme mode value, network errors | | `Unavailable` | iOS | Feature requires iOS 14+ | Device running \< iOS 14 when calling token, language, or theme updates | | `ClientUnavailable` | Android | Method called before initialization | SDK not initialized before calling other methods | | `CelloError` | Android | Generic SDK error | Various SDK-level errors | | `UccError` | Android | `Cello.getActiveUcc` threw | SDK not initialized, network or serialization errors | | `CampaignConfigError` | Android | `Cello.getCampaignConfig` threw | SDK not initialized, configuration not ready | | `InvalidArguments` | iOS & Android | Missing or invalid method arguments | Required parameters not provided or have invalid values | > **Tip:** Catch `PlatformException` and inspect `error.code`, `error.message`, and `error.details` for extra context. ### Common error scenarios #### 1. Initialization exception **Symptoms:** `InitializationError` or `InitializationException` in the catch block. **Fix:** Validate credentials, confirm network connectivity, and ensure you selected the right environment (`production` vs `sandbox`). Check native logs for additional details. #### 2. Methods called before initialization **Symptoms:** `ClientUnavailable` error on Android or native console warnings. **Fix:** Ensure `Cello.initialize` completes successfully before calling other methods like `showFab()` or `openWidget()`. Track initialization state in your app. #### 3. Platform feature limitations `Cello.changeLanguage`, `Cello.setThemeMode`, and `Cello.updateToken` require iOS 14+ on iOS. On older devices these methods reject with `Unavailable` error. Guard these calls with a platform/version check if needed. ### Error handling best practices **1. Wrap initialization in try/catch:** ```dart theme={null} import 'package:flutter/services.dart'; import 'package:cello_sdk/cello_sdk.dart'; Future bootstrapCello() async { try { if (productId.trim().isEmpty || token.trim().isEmpty) { throw Exception('Missing credentials'); } final config = await Cello.initialize( CelloInitializeOptions( productId: productId, token: token, productUserDetails: productUserDetails, ), ); setState(() { celloReady = true; }); print('[Cello] Initialized: ${config.rawResponse}'); } on PlatformException catch (e) { print('[Cello] Initialization failed: ${e.code} - ${e.message}'); // Show user-friendly error showDialog( context: context, builder: (context) => AlertDialog( title: Text('Referrals unavailable'), content: Text('Please check your connection and try again.'), actions: [ TextButton( onPressed: () => Navigator.pop(context), child: Text('OK'), ), ], ), ); } catch (e) { print('[Cello] Unexpected error: $e'); } } ``` **2. Delay UI interactions:** Only call `Cello.showFab()` or `Cello.openWidget()` after a successful initialization. Keep a dedicated `isCelloReady` state flag in your widgets. ```dart theme={null} ElevatedButton( onPressed: celloReady ? () => Cello.openWidget() : null, child: Text('Open Referral'), ) ``` **3. Handle token lifecycle:** Listen to `Cello.tokenEvents` and refresh tokens proactively before they expire: ```dart theme={null} StreamSubscription? _tokenSubscription; @override void initState() { super.initState(); _tokenSubscription = Cello.tokenEvents.listen((event) { if (event.type == CelloTokenEventType.tokenAboutToExpire) { // Refresh token from your backend _refreshCelloToken(); } }); } @override void dispose() { _tokenSubscription?.cancel(); super.dispose(); } Future _refreshCelloToken() async { try { // Get fresh token from your API final newToken = await fetchFreshToken(); // Update Cello with new token await Cello.updateToken(newToken); print('[Cello] Token refreshed successfully'); } on PlatformException catch (e) { print('[Cello] Token refresh failed: ${e.code} - ${e.message}'); } } ``` **4. Retry on transient errors:** For recoverable failures (network timeouts, `InitializationError`), schedule a retry with exponential backoff. Limit retries to avoid looping endlessly. **5. Log error details:** Capture error codes, messages, and relevant details in your logging/monitoring solution to help support diagnose issues quickly. # Introduction Source: https://docs.cello.so/sdk/mobile/introduction Native mobile SDKs for embedding referral functionality in iOS and Android applications ![Mobile referral component interface for iOS and Android native SDKs](https://mintcdn.com/cello/6Zr08teY9AER0ncF/sdk/mobile/sdk-mobile-referral-component-native-sdks.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=94bddda7dbfbf347a50c12a4f0f831fd) ## Available Mobile SDKs Cello provides native mobile SDKs that embed a complete referral experience directly into your mobile applications, enabling users to share referral links, track rewards, and receive payouts - all without leaving your app. > [card] [iOS SDK](/sdk/mobile/ios) > > Native Swift/Objective-C SDK for iOS apps > [card] [Android SDK](/sdk/mobile/android) > > Native Kotlin/Java SDK for Android apps > [card] [React Native](/sdk/mobile/react-native) > > Cross-platform SDK for React Native apps > [card] [Flutter](/sdk/mobile/flutter) > > Cross-platform SDK for Flutter apps ## What Do Mobile SDKs Do? The mobile SDKs provide the same comprehensive referral functionality as our web component, optimized for mobile experiences: ### Referral Component Features * **In-app sharing interface** with native mobile sharing options (Messages, email, social media) * **Real-time tracking** of referral performance and earned rewards * **Reward management** with payout setup and history * **Multi-language support** with automatic device language detection ### Native Mobile Integrations * **Platform-specific UI** that follows iOS and Android design guidelines * **Native sharing** using platform share sheets and messaging apps * **Deep linking support** for seamless user journeys * **Performance optimized** for mobile device constraints ### Customizations You can customize the mobile Referral Component in the following ways: * **Launcher** – Use the default button or implement a custom launcher to open the Referral component. * **Hero Image** – Set a custom image for the sharing screen. * **Copy** – Customize the text displayed in the component. * **Brand Color** – Apply your brand’s primary color to match your app’s style. * **Notification images** - Choose which image is displayed in the new view and new reward notification. * **Dark mode** - Support for light and dark theme, with configurable colors per theme in the [Cello Portal](https://app.cello.so) to match your app’s interface. ## Complete Mobile Referral Setup After integrating the mobile SDK, you'll need to set up mobile attribution and referral conversion tracking: ### 1. Set Up Mobile Attribution Configure deep linking and referral code capture for mobile app installs: > [card] [Mobile Attribution Guide](/attribution/for-mobile) > > Learn how to capture referral codes through app store installs using Branch.io or similar services ### 2. Track Referral Conversions Implement signup and purchase event tracking to reward referrers: > [card] [Track Signups](/attribution/tracking-signups) > > Send signup events when users create accounts > [card] [Track Purchases](/attribution/tracking-purchase) > > Send purchase events for subscription or one-time payments ## Getting Started **1. Choose Your Platform** Select the appropriate SDK for your mobile platform **2. Install & Configure** Follow the installation guide for your chosen SDK **3. Set Up Attribution** [Configure mobile attribution](/attribution/for-mobile) to capture referral codes from app installs **4. Track Referral Conversion Events** Implement referral events for [signups](/attribution/tracking-signups) and [purchases](/attribution/tracking-purchase) to complete the referral flow > [!NOTE] > > Mobile SDKs work independently but can be used alongside [Cello JS](/sdk/client-side/cello-js-introduction) if you have both web and mobile versions of your product. # Cello for iOS Source: https://docs.cello.so/sdk/mobile/ios The Cello SDK for iOS enables you to add a referral program into your iOS app. With a plug-n-play mobile component, your users can easily share their invite link with their friends and network using mobile sharing options convenient for them, receive rewards and get paid out. ## Installation A basic installation takes around 15 minutes but will take a little longer if you want to customize the way the Cello Referral Component is launched. **Compatibility** Cello for iOS is compatible with iOS 15 and up. ### SDK size The size of Cello for iOS varies depending on your app’s configuration. For most installations, it’s around 3 MB in size. ## Setup Install Cello to see and give your users the option to spread the word from your iOS app. The Cello for iOS library supports iOS **15+** and requires **Xcode 14** to build. ### Install Cello #### Option 1: Swift Package Manager (recommended) Add [**https://github.com/getcello/cello-ios-sp**](https://github.com/getcello/cello-ios-sp) as a Swift Package Repository in Xcode and follow the instructions to add CelloSDK as a Swift Package. ![iOS Swift Package Manager configuration for Cello SDK installation](https://mintcdn.com/cello/6Zr08teY9AER0ncF/images/uphzam2u5p5cr54iz7ubkoh5q0awntm2w8m50lzwda2h1d4e4lafte0wdzookvuh.png?fit=max\&auto=format\&n=6Zr08teY9AER0ncF\&q=85\&s=e9b457c975f2d8f17c5c83f028f750f4) #### Option 2: CocoaPods Add CelloSDK to your Podfile from the `cello-ios` repository, pinned to a release tag, and run `pod install`: ```ruby theme={null} target :YourTargetName do pod 'CelloSDK', :git => 'https://github.com/getcello/cello-ios.git', :tag => '0.16.1' end ``` To upgrade, change the tag to a newer [release](https://github.com/getcello/cello-ios/tags) and run `pod install` again. > [!NOTE] > > The CocoaPods trunk became read-only on 2 December 2026, so a plain `pod 'CelloSDK'` stays on version 0.16.1. If your Podfile has that line, replace it with the line above to get newer releases. #### Option 3: Install Cello manually 1. Download Cello for iOS and extract the zip. (👉 [**Cello iOS zip download**](https://github.com/getcello/cello-ios-sp/releases)) 2. Drag `CelloSDK.xcframework` into your project. Make sure **Copy items if needed** is selected and click Finish. 3. In the target settings for your app, set the `CelloSDK.xcframework` to **Embed & Sign** in the **Frameworks, Libraries, and Embedded Content** section of the **General** tab. ### Choose an Environment In your Cello SDK setup, you have the flexibility to select the environment in which your application will run. This feature is especially useful for different stages of development, such as testing in a development or staging environment before going live in production. The available environments are: Available environments: * `prod` (Production) * `sandbox` (Sandbox) *`Default environment: prod`* #### Configuration Steps * Open your iOS project in Xcode. * Navigate to the `Info.plist` file. * Add a new key-value pair: ```xml theme={null} CELLO_ENV prod ``` * To switch to sandbox, change the string value to `sandbox`. * Save your changes. The next build will use the selected environment. Using this setup, the Cello SDK on iOS can adapt to the chosen environment, allowing a smoother and more controlled development and testing process. ## Initialize Cello You’ll need your **product ID** and a user-specific **token** (similar to [the web-based Referral component flow](https://docs.cello.so/docs/user-authentication)): ```swift theme={null} import CelloSDK Cello.initialize(for: "YOUR_PRODUCT_ID", with: token) { result in switch result { case .success(let configuration): print("Initialization successful with config:", configuration) case .failure(let error): print("Initialization failed with error:", error) } } ``` ## Customize the Cello Referral Component The Cello SDK allows for various levels of customization to better fit into your app's design and flow. One of the main components you might want to customize is the [**Referral component**](https://docs.cello.so/docs/component-overview) ### Choose your launcher * **Default launcher**: Use `Cello.showFab()` to present a pre-styled Floating Action Button (FAB). ```swift theme={null} import CelloSDK Cello.showFab() ``` * **Custom launcher**: Use any UI element (button, menu item, gesture) and call `Cello.openWidget()` when you want to open it. ```swift theme={null} import CelloSDK class YourViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let myButton = UIButton(type: .system) myButton.setTitle("Open Referral", for: .normal) myButton.addTarget(self, action: #selector(didTapMyButton), for: .touchUpInside) // Add 'myButton' to your view } @objc func didTapMyButton() { Cello.openWidget() } } ``` ### Advanced: Custom Callbacks Set `Cello.delegate` to an object conforming to `CelloDelegate` to be told when the Referral component opens and closes. Available from 0.16.0. ```swift theme={null} class YourViewController: UIViewController, CelloDelegate { override func viewDidLoad() { super.viewDidLoad() Cello.delegate = self } func celloWidgetDidOpen() { print("Referral component opened") } func celloWidgetDidClose() { print("Referral component closed") } } ``` * Both methods are optional, so implement only the ones you need. * `celloWidgetDidOpen()` fires when the component is presented, whether from `Cello.openWidget()` or the default launcher. * `celloWidgetDidClose()` fires as the component starts to dismiss, whatever closed it: the close button, swiping it away on iPad, `Cello.hideWidget()` or `Cello.shutdown()`. Opening the share sheet from inside the component doesn't count as closing. * `Cello.delegate` is a weak reference, so keep your delegate alive yourself. If more than one part of your app needs these events, observe the `.CelloWidgetDidOpen` and `.CelloWidgetDidClose` notifications instead of setting the delegate: ```swift theme={null} NotificationCenter.default.addObserver(forName: .CelloWidgetDidClose, object: nil, queue: .main) { _ in print("Referral component closed") } ``` ## iOS API ### Cello.initialize() Initializes the Cello referral component. | Name | Type | Description | Required | | - | - | - | - | | productId | string | Identifier of the product your users will refer. Found in your Cello Portal. | Yes | | token | string | Access token generated for the given user. | Yes | | productUserDetails | Cello.productUserDetails | Product User details | No | | language | string | Initial language of the widget | No | | themeMode | string | Initial theme mode: `"light"` or `"dark"` | No | | completion | callback | Receives success or failure with configuration or error. | | ```swift theme={null} import CelloSDK let productUserDetails = CelloSDK.ProductUserDetails( firstName: "John", lastName: "Doe", fullName: "John Doe", email: "john.doe@example.com" ) Cello.initialize(for: "dev.cello.so", with: token, productUserDetails: productUserDetails, language: 'de', themeMode: 'light') { result in switch result { case .success(let configuration): print("Initialization successful with config:", configuration) case .failure(let error): print("Initialization failed with error:", error) } } ``` ### Cello.showFab() Shows the Floating action button or bookmark that launches the Referral Component ```swift theme={null} import CelloSDK Cello.showFab() ``` ### Cello.hideFab() Hides the Floating action button or bookmark that launches the Referral Component ```swift theme={null} import CelloSDK Cello.hideFab() ``` ### Cello.openWidget() Opens the referral component. ```swift theme={null} import CelloSDK Cello.openWidget() ``` ### Cello.hideWidget() Hides the referral component. ```swift theme={null} import CelloSDK Cello.hideWidget() ``` ### Cello.getActiveUcc() A method to get an active `ucc` and invite link for the currently logged in user. ```swift theme={null} import CelloSDK let result = Cello.getActiveUcc() // ["ucc": "...", "link": "..."] or nil before initialization ``` ### Cello.getConfiguration() Returns the state of the initialised SDK, or `nil` if the SDK is not ready yet. `nil` means "not initialised", not "this user has no referral data". Available from 0.15.0. ```swift theme={null} import CelloSDK if let configuration = Cello.getConfiguration() { print(configuration.ucc as Any, configuration.shareLink as Any) print(configuration.views, configuration.unreadViewsCount) } ``` Exposes `productId`, `referrerId`, `campaignId`, `ucc`, `shareLink`, `productName`, `language`, `supportedLanguages`, `themeMode`, `platform`, `sdkVersion`, `tokenTTL`, `totalEarnedRewards`, `views`, `unreadViewsCount`, `hasPaymentDetails`, `onboardingShown`, `isUserBlocked`, `isWidgetUnavailable`, `showFullWidget`, `showEnhancedView`, `isTablet` and `campaignConfig`. `tokenTTL` is `-1` when token expiry checking is disabled for the product, which is the default. Use `asDictionary()` if you need a serialisable form, for example to pass across a bridge. Some fields are `nil` for blocked users and when the referral component is unavailable. ## `getCampaignConfig()` Returns campaign config values for the currently logged-in user. ```swift theme={null} import CelloSDK let result = Cello.getCampaignConfig() ``` ### Returns **campaignConfig** `object` The campaign config object: **properties** **primaryCurrency** `string` Primary currency code **revenuePercentage** `number` Percentage of attributed new revenue that will be paid as a reward **rewardCap** `number` Maximum reward that can be earned per referral **newSignupBonus** `number` Additional reward for signups to encourage more sharing **newPurchaseBonus** `number` Additional reward for purchases to encourage more sharing **newUserDiscountMonth** `number` How long new users get a discount **newUserDiscountPercentage** `number` The discount new users get ### Cello.changeLanguage() A method to change the language of the Referral component at runtime without re-initialising it. ```swift theme={null} import CelloSDK Cello.changeLanguage(to: .de) ``` ### Cello.setThemeMode() A method to change the theme mode of the Referral component at runtime without re-initialising it. ```swift theme={null} import CelloSDK Cello.setThemeMode(to: "dark") ``` **Parameters:** * `themeMode` (*String*): The theme mode to set. Valid values are `"light"` or `"dark"`. **Availability:** iOS 14.0+ ### Cello.shutdown() Shuts down connection to Cello and unmounts the component ```swift theme={null} import CelloSDK Cello.shutdown() ``` ## Error Handling When using CelloSDK, you may encounter errors during initialization or other operations. Errors are returned in the format: ``` The operation couldn't be completed. (CelloSDK.APIError error N.) ``` Where `N` is a numeric error code (0-6) that identifies the specific error type. ### Error Codes Reference #### Error 0: Invalid URL **What it means:** The SDK attempted to create a request with an invalid or malformed URL. **Common causes:** * Missing or empty product ID * Malformed base URL in SDK configuration * Invalid characters in URL parameters *** #### Error 1: Unauthorized **What it means:** The authentication token is invalid, expired, or the user is not authorized to access the widget. **Common causes:** * Expired JWT token * Invalid token signature * Token generated for a different product ID * User permissions revoked * Initializing for wrong environment *** #### Error 2: Request Failed **What it means:** The network request failed due to connectivity issues or server errors. **Error code meanings:** * `-1`: Network connectivity error (no internet, timeout) * `400-499`: Client errors (bad request, not found) * `500-599`: Server errors **Common causes:** * No internet connection * Slow or unstable network * Server maintenance or downtime * Firewall or proxy blocking requests *** #### Error 3: Invalid Response Type **What it means:** The server response was not in the expected HTTP format. **Common causes:** * Network proxy modifying responses * Server misconfiguration * Non-HTTP protocol response *** #### Error 4: No Data Received **What it means:** The server returned a successful response (HTTP 200-299) but with no data in the response body. **Common causes:** * Server returning empty response * Network issue truncating the response * Incorrect API endpoint or version *** #### Error 5: JSON Parsing Error **What it means:** The SDK received data from the server but couldn't parse it as valid JSON. **Common causes:** * Server returned HTML error page instead of JSON * Malformed or incomplete response * API version mismatch *** #### Error 6: Invalid State **What it means:** The SDK is in an invalid state or required parameters are missing. **Specific messages:** * "Product ID cannot be empty" * "Token cannot be empty" * "Product ID not set" * "Configuration not initialized" **Common causes:** * Empty product ID or token during initialization * Calling SDK methods before initialization completes *** ### Initialization State Errors If you call SDK methods before initialization, you'll see console warnings: * `"Error: showFab() called before initialization."` * `"Error: hideFab() called before initialization."` * `"Error: openWidget() called before initialization."` * `"Error: hideWidget() called before initialization."` * `"Error: shutdown() called before initialization."` * `"Error: getActiveUcc() called before initialization."` * `"Error: getCampaignConfig() called before initialization."` * `"Error: changeLanguage() called before initialization."` * `"Error: setThemeMode() called before initialization."` **Solution:** Always wait for initialization to complete before calling other SDK methods. *** ### Error Handling Best Practices **1. Validate parameters before initialization:** ```swift theme={null} guard !productId.trimmingCharacters(in: .whitespaces).isEmpty else { print("Error: Product ID is required") return } guard !token.trimmingCharacters(in: .whitespaces).isEmpty else { print("Error: Token is required") return } Cello.initialize(for: productId, with: token) { result in // Handle result } ``` **2. Track initialization state:** ```swift theme={null} class CelloManager { private var isInitialized = false func initialize(productId: String, token: String) { Cello.initialize(for: productId, with: token) { [weak self] result in if case .success = result { self?.isInitialized = true } } } func showReferral() { guard isInitialized else { print("SDK not initialized yet") return } Cello.openWidget() } } ``` # Cello for React Native Source: https://docs.cello.so/sdk/mobile/react-native The Cello React Native wrapper allows you to use Cello for iOS and Cello for Android in your React Native apps. With a plug-n-play mobile component, your users can easily share their invite link with their friends and network using mobile sharing options convenient for them, receive rewards and get paid out. ## Installation A basic installation takes around 15 minutes, but will take a little longer if you want to customize the way the Cello Referral Component is launched. **Compatibility** * The Cello React Native wrapper supports React Native **0.59** and above. * Cello for iOS supports **iOS 15+**. * Cello for Android supports **API 21+**. ### Install Cello ```bash theme={null} yarn add @getcello/cello-react-native # or npm install @getcello/cello-react-native ``` ### Android Setup #### Automatic Linking (RN v0.60+) Library is automatically linked after installation. #### React Native v0.59 (Automatic Linking) ```bash theme={null} react-native link @getcello/cello-react-native ``` #### React Native v0.59 (Manual Linking) **`android/settings.gradle`** ```groovy theme={null} include ':cello-react-native' project(':cello-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/@getcello/cello-react-native/android') ``` **`android/app/build.gradle`** ```groovy theme={null} dependencies { implementation project(':cello-react-native') } ``` ### Android Setup Include internet permission in `android/app/src/main/AndroidManifest.xml`: ```xml theme={null} ``` There is nothing to add to `MainApplication`. Initialization happens from JavaScript, see [Initialization](#initialization) below. ### iOS Setup The library links automatically after `pod install`. The iOS SDK ships inside the package, so there is nothing to add to your `Podfile`. > [!NOTE] > > Don't also add `CelloSDK` to your app through the `Podfile` or Swift Package Manager: the app would get two copies of the framework. With a `pod 'CelloSDK'` line, `pod install` stops with `target has frameworks with conflicting names: cellosdk.xcframework`. Remove that line and run `pod install` again. ### Initialization Initialize from JavaScript. There is nothing to add to `MainApplication` on Android or `AppDelegate` on iOS. ```ts theme={null} import Cello from '@getcello/cello-react-native'; const configuration = await Cello.initialize({ productId: 'your-product-id', token: 'your-jwt', }); ``` The promise resolves once the SDK is ready, with the configuration for the current user. It rejects if initialization fails, so wrap it in a `try`/`catch` rather than assuming success. > [!NOTE] > > Before 0.15.0 the promise resolved on Android before initialization had > finished, and the resolved value was an empty object. If you are on an earlier > version, upgrade rather than polling the getters to work out when the SDK is > ready. `environment` can only be set here. It is not read from any native configuration file, so passing it to `initialize` is the only way to target a non-production stack. ## Choose an Environment In your Cello SDK setup, you have the flexibility to select the environment in which your application will run. This feature is especially useful for different stages of development, such as testing in a development or staging environment before going live in production. The available environments are: * `prod` (Production) *(default)* * `sandbox` (Sandbox) For iOS follow [**Cello for iOS configurational steps**](https://docs.cello.so/docs/cello-for-ios#choose-an-environment) For Android follow Cello for [**Android configurational steps**](https://docs.cello.so/docs/cello-for-android#choose-an-environment) ## Using Cello with Expo If you are using Expo, you can use the built-in plugin. After installing the **@getcello/cello-react-native** package, add the [**config plugin**](https://docs.expo.io/guides/config-plugins/) to the `plugins` array of your `app.json` or `app.config.js`: ```json theme={null} { "expo": { "plugins": ["@getcello/cello-react-native"] } } ``` The plugin provides props to set environment. Every time you change the props or plugins, you'll need to rebuild (and `prebuild`) the native app. If no extra properties are added, defaults will be used. * `env` (*string*): Set to your desired environment, such as `prod`, `sandbox`. Optional. Defaults to `prod`. ```json theme={null} { "expo": { "plugins": [ [ "@getcello/cello-react-native", { "env": "sandbox" } ] ] } } ``` Next, rebuild your app as described in the [**"Adding custom native code"**](https://docs.expo.io/workflow/customizing/) guide. ## Customize the Cello Referral Component The Cello React Native allows for various levels of customization to better fit into your app's design and flow. One of the main components you might want to customize is the [**Referral component**](https://docs.cello.so/docs/component-overview) ### Choose Your Launcher The library provides two ways to launch the Referral component: **Default launcher** If you choose to go with the default launcher, you can call the `showFab()` method from the Cello library to present a Floating Action Button (FAB) within your app. This FAB is pre-styled but may not perfectly match your app's look and feel. ```js theme={null} import Cello from '@getcello/cello-react-native'; Cello.showFab(); ``` **Custom launcher** If the default launcher does not fit your needs, you can implement your own custom launcher. This could be any UI element like a button, menu item, or even a gesture. To open the Referral component using a custom launcher, you can call `Cello.openWidget()`. ```js theme={null} import Cello from '@getcello/cello-react-native'; const MyButton = () => { return ; }; ``` ## React Native API ### `Cello.initialize(InitializeOptions): Promise` Initializes the Cello referral component. ### InitializeOptions | Property | Type | Required | Description | | - | - | - | - | | productId | string | yes | Your product ID from Cello Portal | | token | string | yes | User authentication token | | productUserDetails | ProductUserDetails | no | User details object (see below) | | language | string | no | Initial language of the widget | | themeMode | string | no | Initial theme mode: `"light"` or `"dark"` | ### ProductUserDetails Optional object with user information: | Property | Type | Description | | - | - | - | | firstName | string | User's first name | | lastName | string | User's last name | | fullName | string | User's full name | | email | string | User's email address | ```ts theme={null} Cello.initialize({ productId: 'your-product-id', token: 'your-token', productUserDetails: { firstName: 'John', lastName: 'Doe', fullName: 'John Doe', email: 'john.doe@example.com', }, language: 'de', themeMode: 'light', }); ``` ### `Cello.showFab(): void` Shows the default Cello button that launches the Referral Component ```ts theme={null} Cello.showFab(); ``` ### `Cello.hideFab(): void` Hides the default Cello button that launches the Referral Component ```ts theme={null} Cello.hideFab(); ``` ### `Cello.openWidget(destination?: string): void` Opens the referral component. Pass a destination to open straight onto a specific tab. ```ts theme={null} Cello.openWidget(); Cello.openWidget('rewards'); Cello.openWidget('edit-payments'); ``` `rewards` and `edit-payments` are the supported destinations. Anything else falls back to the invite view. ### `Cello.hideWidget(): void` Hides the referral component. ```ts theme={null} Cello.hideWidget(); ``` ### `Cello.getActiveUcc(): Promise<{ ucc: string; link: string; } | null>` A method to get an active `ucc` and invite link for the currently logged in user. ```ts theme={null} const data = await Cello.getActiveUcc(); ``` ### `Cello.getConfiguration(): Promise` Returns the state of the initialised SDK, or `null` if the SDK is not ready yet. That distinction matters: `null` means "not initialised", not "this user has no referral data". Available from 0.15.0. ```ts theme={null} const configuration = await Cello.getConfiguration(); if (configuration) { console.log(configuration.ucc, configuration.shareLink); console.log(configuration.views, configuration.unreadViewsCount); } ``` | Field | Type | Notes | | - | - | - | | `productId` | `string?` | | | `referrerId` | `string?` | | | `campaignId` | `string?` | | | `ucc` | `string?` | | | `shareLink` | `string?` | The referrer's invite link | | `productName` | `string?` | | | `language` | `string?` | Reflects the most recent `changeLanguage` call | | `supportedLanguages` | `string[]` | | | `themeMode` | `string?` | Reflects the most recent `setThemeMode` call | | `platform` | `string` | `ios` or `android` | | `sdkVersion` | `string` | | | `tokenTTL` | `number` | `-1` when token expiry checking is disabled for the product, which is the default | | `totalEarnedRewards` | `string?` | Preformatted with currency | | `views` | `number` | | | `unreadViewsCount` | `number` | | | `hasPaymentDetails` | `boolean` | | | `onboardingShown` | `boolean` | | | `isUserBlocked` | `boolean` | | | `isWidgetUnavailable` | `boolean` | | | `showFullWidget` | `boolean` | | | `showEnhancedView` | `boolean` | | | `isTablet` | `boolean` | | | `campaignConfig` | `object?` | Same values as `getCampaignConfig()` | Some fields are absent for blocked users and when the referral component is unavailable, so treat the optional ones as optional. ### `Cello.changeLanguage(langCode: string): void` A method to change the language of the Referral component at runtime without re-initialising it. ```ts theme={null} Cello.changeLanguage('de'); ``` ### `Cello.setThemeMode(themeMode: string): void` A method to change the theme mode of the Referral component at runtime without re-initialising it. ```ts theme={null} Cello.setThemeMode('dark'); ``` **Parameters:** * `themeMode` (*string*): The theme mode to set. Valid values are `"light"` or `"dark"`. ### `Cello.shutdown(): void` Shuts down connection to Cello and unmounts the component ```ts theme={null} Cello.shutdown(); ``` ### `Cello.addListener(event, callback)` Subscribes to SDK events. It returns a subscription, so call `remove()` on it when you're done. ```ts theme={null} import Cello, { CelloEvents } from '@getcello/cello-react-native'; const closed = Cello.addListener(CelloEvents.widgetClosed, () => { console.log('Referral component closed'); }); // When you no longer need it closed.remove(); ``` | Event | When | | - | - | | `CelloEvents.tokenAboutToExpire` | The token is about to expire, so refresh it and call `Cello.updateToken()` | | `CelloEvents.tokenHasExpired` | The token has expired | | `CelloEvents.widgetOpened` | The referral component is shown, whether from `openWidget()` or the default launcher. Available from 0.16.0 | | `CelloEvents.widgetClosed` | The referral component starts to dismiss, whatever closed it: the close button, system back, swiping it away, `hideWidget()` or `shutdown()`. Opening the share sheet from inside the component doesn't count. Available from 0.16.0 | *** ## Error Handling ### Promise rejection codes | Code | Platform(s) | Trigger | Typical causes | | - | - | - | - | | `InitializationError` | iOS & Android | `Cello.initialize` completes with native failure | Invalid/empty product ID or token, network issues, bad environment | | `InitializationException` | Android | Unexpected exception inside `Cello.initialize` | Activity finishing, SDK not linked correctly, runtime crash | | `ActivityError` | Android | `Cello.initialize` without an active Activity | Initialization triggered too early (e.g. before React root ready) | | `TokenUpdateError` | iOS | `Cello.updateToken` failure | Token expired/invalid, network errors | | `LanguageChangeError` | iOS | `Cello.changeLanguage` failure | Unsupported language code, network errors | | `ThemeModeChangeError` | iOS | `Cello.setThemeMode` failure | Invalid theme mode value, network errors | | `UnavailableError` | iOS | Feature requires iOS 14+ | Device running \< iOS 14 when calling token, language, or theme updates | | `NO_ACTIVE_UCC` | iOS | `Cello.getActiveUcc` with no active referral | User has not generated an invite yet | | `UCC_ERROR` | Android | `Cello.getActiveUcc` threw | SDK not initialized, network or serialization errors | | `CAMPAIGN_CONFIG_ERROR` | Android | `Cello.getCampaignConfig` threw | SDK not initialized, configuration not ready | | `LINKING_ERROR` | JavaScript | Module not linked | Pod install missing, app not rebuilt, using Expo Go | | `frameworks with conflicting names: cellosdk.xcframework` | iOS | `pod install` stops | `pod 'CelloSDK'` is also in the `Podfile`; remove it, the package already includes the SDK | > **Tip:** The React Native bridge rejects promises with the objects above. Inspect `error.code`, `error.message`, and (on iOS) `error.nativeStackIOS` for extra context. ### Common error scenarios #### 1. Initialization promise rejected **Symptoms:** `InitializationError` or `InitializationException` in the catch block. **Fix:** Validate credentials, confirm network connectivity, and ensure you selected the right environment (`prod` vs `sandbox`). Compare native logs with the [iOS](./ios.md#error-handling) and [Android](./android.md#error-handling) error references for detailed native codes. #### 2. Module not linked (`LINKING_ERROR`) **Symptoms:** Error thrown immediately when importing `@getcello/cello-react-native`. **Fix:** Run `pod install` inside `ios`, rebuild the app, and ensure you are not running inside Expo Go. #### 3. UI calls before initialization finishes Calling `Cello.showFab()`, `Cello.openWidget()`, or similar before the SDK is ready triggers native console warnings such as `"Error: showFab() called before initialization."`. Track initialization state in JavaScript and gate UI interactions until `Cello.initialize` resolves. #### 4. Platform feature limitations `Cello.changeLanguage` and `Cello.setThemeMode` require iOS 14+. On older devices the bridge rejects with `UnavailableError`. Guard these calls with a platform/version check. ### Error handling best practices **`1. Wrap initialization in try/catch:`** ```ts theme={null} import { Alert } from 'react-native'; import Cello from '@getcello/cello-react-native'; async function bootstrapCello() { try { if (!productId.trim() || !token.trim()) { throw new Error('Missing credentials'); } const config = await Cello.initialize({ productId, token, productUserDetails, }); setCelloReady(true); console.log('[Cello] Initialized', config); } catch (error: any) { console.warn('[Cello] Initialization failed', error); Alert.alert( 'Referrals unavailable', 'Please check your connection and try again.' ); } } ``` **2. Delay UI interactions:** Only call `Cello.showFab()` or `Cello.openWidget()` after a successful initialization. Keep a dedicated `isCelloReady` state flag in your components. **3. Retry on transient errors:** For recoverable failures (network timeouts, `InitializationError`), schedule a retry with exponential or linear backoff. Limit retries to avoid looping endlessly. **4. Log error details:** Capture `error.code`, `error.message`, and relevant native stack traces in your logging/monitoring solution to help support diagnose issues quickly.