Intro

To sync Chargebee data with Vitally, we'll use Zapier to assign data from Chargebee to traits on the customer in Vitally. We'll then setup the subscription tracking config in Vitally to use those traits to display and track your customers' trial and renewal lifecycles.

Steps

1. If you haven't already, you'll need to connect your Vitally account to Zapier. To connect your account, enable the Zapier integration in your Vitally account settings (Settings->Integrations->Zapier).

2. You'll need to setup Zaps in Zapier for the following Chargebee events:

  • New Subscription
  • Subscription Activated
  • Subscription Changed
  • Subscription Cancelled

3. Then, you'll need to setup Subscription Tracking in Vitally (Settings->Subscription Tracking)

Creating Zaps

For each Chargebee event, you'll need to create a three-step Zap:

  1. [Trigger] Select Chargebee event (e.g. New Subscription)
  2. [Search] Find the Customer, or User for this Customer, in Vitally
  3. [Action] Update Customer Traits in Vitally
Chargebee Event Trigger

To begin creating your Zap, as your trigger, select Chargebee as your Trigger App, and "New Subscription" as your Chargebee Trigger:


Chargbee New Subscription Trigger

Find Customer Search

Once you have a Subscription from Chargebee, you'll need to associate the customer in Chargebee with the customer in Vitally. You can find the customer in Vitally with a Zapier search step. There are multiple ways that step can be configured, depending on what data you have stored in Chargebee.

1. (Recommended) Find the customer by id. If you have set customer.id in Chargebee to be the same ID you send to Vitally as the customer's id, you should use Vitally's "Find a Customer" search, and search by "External ID"


Find customer by External Id


2. (Not Recommended) Find the customer via a user's email. If you haven't added the customer's ID to Chargebee, you can use Vitally's "Find a User" search, and search by "email". This is not recommended, as that User must have been seen in Vitally already.


Find User By Email


Update Customer Traits Action

The final step is to create a Vitally "Update Customer Traits" action.

First, select "Use a Custom Value" for the Customer field. If you used the "Find a Customer" search in step 2, use the ID field for the Custom Value. If you used the "Find a User" search, use the "Customer ID" field.

Then, create traits for all of the the Chargebee traits listed here:

  • subscription.status
  • invoice.amount
  • subscription.trial_end
  • subscription.current_term_start
  • subscription.current_term_end
  • subscription.cancelled_at

Plus, any other traits you might want to see in Vitally.

Chargebee update traits
Turning on your Zap

After setting up those three steps, name your Zap something like "Chargebee New Subscription to Vitally" and turn it on! Events will then start flowing from Chargebee to Vitally as they happen.

Copying your Zap

Once you've named and enabled your new Zap, you can easily create Zaps for the rest of the events by copying the "Chargebee New Subscription to Vitally" Zap and changing the event in step 1.

You'll need to create matching Zaps for the following Chargebee events, in addition to New Subscription:

  • Subscription Activated
  • Subscription Changed
  • Subscription Cancelled

Since all of the Chargebee Subscription events have the same shape, you should just need to change the Zap name to "Chargebee [Event Name] to Vitally", and turn it on!

Vitally Subscription Tracking

After setting up the 4 new Zaps, you'll need to configure subscription tracking in Vitally to use the traits you imported. Note: the traits you use will depend on what you named them in the "Update Customer Traits" step in Zapier.

Revenue

Chose the following traits and options to track subscribed customers:

  1. "Via a customer trait"
  2. invoice.amount
  3. subscription.status is "active"
  4. subscription.current_term_end
  5. subscription.current_term_start
  6. "Total Subscription Period Cost"
Trials

Chose the following traits and options to track trial customers:

  1. "Via a customer trait"
  2. subscription.status is "in_trial"
  3. subscription.trial_end
Churn

Chose the following traits and options to track churned customers:

  1. "Via a customer trait"
  2. subscription.status is "cancelled"