Step 1)

If you are NOT using Chargebee Drop-in JS script (the one that shows their popup checkout), skip this step and use our sign-up tracking script or API like it's specified on the setup instructions page to track the signups first and proceed to step 2 below(setting up the Chargebee webhook).

If you are using Chargebee popup checkout, you won't be able to get the customer details through Javascript(our signup tracking script won't work in this case) so we need to use another approach to match the customer with the tracking id stored in the browser cookie:

a)  Set up a text custom field for the Customer object on Chargebee called "cf_tid". Click here for more information about Chargebee custom fields. 

b) Grab the referral code from the cookie and set it on Customer custom field. We've made an implementation for this that you can copy-paste on your pricing page:

<script>
function getCookieValue(a) {
    var b = document.cookie.match('(^|[^;]+)\\s*' + a + '\\s*=\\s*([^;]+)');
    return b ? b.pop() : '';
}
document.addEventListener("DOMContentLoaded", function() {
    var tid = getCookieValue('_fprom_track'); //grab tracking id
    if (tid){
        var chargebeeInstance = Chargebee.getInstance();
        var cart = chargebeeInstance.getCart();
        cart.setCustomer({cf_tid:tid});
     }
});
</script>

Step 2)

Make sure you are on FirstPromoter Chargebee integration setup, either by going to Settings > Integrations > Chargebee > Setup or from the Quick Setup Wizard from Getting Started section. Make sure you see this:

Set Chargebee Webhooks

  1. Login to Chargebee and go to Settings > Webhook Settings
  2. Click 'Add new webhook' button on top right(if it's visible)
  3. On Webhook name set something like 'FirstPromoter'
  4. On the Webhook URL, paste the Webhook Endpoint URL value from FirstPromoter integration setup
  5. Select API version - V2
  6. Check 'Exclude card object from webhook call'
  7. Click 'Create Webhook'
  8. Back to FirstPromoter, on 'Site' field, enter your Chargebee subdomain(look at the URL bar, if your URL is https://mycompany.chargebee.com your site is 'mycompany')
  9. Click 'Save'
Did this answer your question?