This guide explains how to connect Chargebee purchases and subscriptions with LeadDyno. Chargebee is a leading platform for subscription billing, offering features like recurring billing, subscription management, and automated invoicing. By integrating Chargebee, transaction data such as the affiliate ID can be sent to LeadDyno, allowing for tracking of affiliate conversions and related commissions.
Important Note:
- If you are a customer who has been using the original Chargebee integration, we have a dedicated guide which can be found here. This hyperlinked guide is applicable to APIv1 users. Unsure if this includes you? Send us a note, and we’ll help you along your way!
- For new users, Chargebee will automatically assign you to APIv2.
In this article
Requirements
The Chargebee integration requires the following before you can successfully connect with LeadDyno.
1. Chargebee Site address
2. Chargebee API Key.
To start, log in to your Chargebee account. Next, simply follow the steps below:
Chargebee Site Address
Firstly, please obtain your site address. This is the URL located at the top of your Chargebee dashboard. To retrieve your Chargebee site address, kindly verify the URL of your dashboard, which should follow the format {site}.chargebee.com. For instance, in the image below, the Chargebee site address is ldd-ssc-test.chargebee.com, and in this case, the required site name is "ldd-ssc-test."
Chargebee API Key
Once you have the Chargebee site address, the next step is to generate an API key in your Chargebee account. To find this key, just follow these steps:
1. Go to your Chargebee Home Page, and click on Settings → Configure Chargebee;
2. Once this is done, choose API Keys under API Keys and Webhooks;
3. Choose Add API Key;
4. Select Read-Only Key → All (Please select "All" after selecting "Read-Only Key);
5. Copy the API Key from Chargebee.
Connect to LeadDyno
Ok, it’s time to take the information you’ve gathered from Chargebee (including the site Address and Chargebee API Key) and go ahead and log in to your LeadDyno account. Now that you’re logged in, follow these steps to complete the integration:
1. To connect the Chargebee integration, go to your LeadDyno account, select Integrations - Explore, then navigate to Payment Processing and click the add button for Chargebee.
2. Copy the API Key and Site Address you grabbed from Chargebee and fill in the corresponding information for your Chargebee Site and the API Key. Once this is done, please click "Connect".
4. The next step is to include the JavaScript code below in your website's header. This script allows LeadDyno to monitor when visitors complete a purchase. If you're unsure how to add this script to your website header, we suggest contacting your website provider for assistance.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script type="text/javascript" src="https://static.leaddyno.com/js"> </script>
<script>
LeadDyno.key = "PUBLIC_API_Key";
LeadDyno.recordVisit();
LeadDyno.autoWatch();
$(document).ready(function() {
var cbInstance = Chargebee.getInstance();
cbInstance.setCheckoutCallbacks(function(cart) {
return {
success: function(hostedPageId) {
LeadDyno.recordVisit({ 'purchase_code': hostedPageId, channel: 'chargebee' }, null, true);
}
}
});
});
</script>Limitations / Known Issues
The Chargebee APIv2 integration is currently compatible only with Chargebee's In-App Checkout. This integration is not compatible with other checkout versions such as Full Page Checkout.