Prerequisites
Before you can send Cello signup events, you need to make sure that you are able to capture the referral codeuccduring signup or demo booking:
- When users sign up in your web app
- When users sign up in your mobile app
- When users book a demo using Hubspot or Typeform forms or scheduling
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
To track a signup, you can pass the followingmetadata to Stripe Customer Object on customer creation.
cello_ucc- ucc, a referral code identifying the referrer. You can retrieve this code using attribution scriptgetUcc ()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, when this user logs into your appnew_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.
Now that the customer is created in Stripe with Cello metadata, a
customer.created event will be sent with Stripe Webhook, which we will count as a signup event in Cello.Option 2: Using Chargebee - I create Chargebee customer at signup
You can pass the following metadata to Chargebee on customer creation.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
cello_ucc- ucc, a referral code identifying the referrer. You can retrieve this code using attribution scriptgetUcc ()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, when this user logs into your appnew_user_organization_id(optional) - add organization ID, if your referrers can refer an organization and you want to reward them for organization account expansion.
Now that the customer is created in Chargebee with Cello metadata, a
Customer Created event will be sent with Chargebee Webhook, which we will count as a signup event in Cello.Option 3: Using Cello API POST /events API endpoint
Send anew-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 scriptgetUcc ()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, when this user logs into your appnewUser.email- new user emailnewUser.name- new user namenewUser.organizationId(optional) - add organization ID, if your referrers can refer an organization and you want to reward them for organization account expansion.
POST /events call to send a new-signup event:
Tracking “demo attended” event
Send ademo-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 scriptgetUcc ()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, when this user logs into your appnewUser.email- new user emailnewUser.name- new user namenewUser.organizationId(optional) - add organization ID, if your referrers can refer an organization and you want to reward them for organization account expansion.
POST /events call to send a new-signup event: