Freemius
The Freemius integration allows you to track purchases made through Freemius checkout. This integration automatically tracks purchase events when customers complete a purchase through your Freemius-powered checkout, including one-time purchases, subscriptions, and trial periods.
Prerequisites
- Freemius Account: You need a Freemius account with your plugin or theme integrated
- Freemius Plugin (optional): The Freemius WordPress plugin is optional - you can use Freemius without the plugin
Enabling the Integration
Step 1: Enable the Integration in Code
Before you can use the Freemius integration, you need to enable it by adding a code snippet to your site. This is required because Freemius integration requires manual setup.
Add the following code to your theme's functions.php file or a custom plugin:
add_filter( 'conversion_bridge_freemius_available', '__return_true' );Where to add this code:
- Option 1: Add to your active theme's
functions.phpfile (located inwp-content/themes/your-theme/functions.php) - Option 2: Create a custom plugin or use a code snippets plugin
After adding this code, the Freemius integration will appear in the Conversion Bridge settings. You must complete this step before proceeding with the rest of the setup.
Step 2: Enable the Integration in Settings
- In your WordPress admin, go to Settings → Conversion Bridge → Integrations
- Find Freemius in the list of available integrations
- Enable the integration by clicking the toggle
- Check the option to enable Purchase tracking
Configure the Integration
Option A: Using the Freemius WordPress Plugin
If you're using the Freemius WordPress plugin:
- In your WordPress admin, go to your Freemius plugin settings
- Navigate to Settings → Purchase Completed Callback (or similar section)
- Add the following JavaScript code:
if (typeof cb_freemius === 'function') {
cb_freemius(response, 'Your Product Name');
}Important:
- Replace
'Your Product Name'with your actual product name, or use a variable that contains the product name - The
cb_freemiusfunction is automatically provided by Conversion Bridge - The
responseobject contains the purchase data from Freemius
Option B: Manual Checkout Implementation (No Plugin)
If you're implementing the Freemius checkout JavaScript manually (without the plugin), you need to add the Conversion Bridge tracking code to the purchaseCompleted callback in your checkout code.
- Locate your Freemius checkout JavaScript code (where you initialize
FS.Checkout) - Add the Conversion Bridge tracking code to the
purchaseCompletedcallback
Here's an example of how your checkout code should look:
const checkout = new FS.Checkout({
product_id: '<productID>',
plan_id: '<planID>',
public_key: '<productPublicKey>',
image: 'https://your-plugin-site.com/logo-100x100.png',
});
document.querySelector('#purchase').addEventListener('click', function (e) {
checkout.open({
title: '<productTitle>',
licenses: document.querySelector('#licenses').value,
purchaseCompleted: function (response) {
// Conversion Bridge tracking code
if (typeof cb_freemius === 'function') {
cb_freemius(response, '<productTitle>');
}
// Your other purchase completion logic here
},
});
e.preventDefault();
});Important:
- The
purchaseCompletedcallback receives aresponseobject containing purchase and user data - Replace
'<productTitle>'with your actual product name or a variable containing it - The
cb_freemiusfunction is automatically provided by Conversion Bridge - For more details on the Freemius checkout API, see the Freemius Checkout Documentation
How It Works
When a customer completes a purchase through Freemius:
- Freemius Response: Freemius sends a purchase response object containing purchase details
- Tracking Function: The
cb_freemiusfunction (injected by Conversion Bridge) receives the response - Event Tracking: Conversion Bridge extracts purchase data and tracks a conversion event
- Platform Delivery: The event is sent to all enabled analytics and ad platforms
Purchase Data Tracked
The integration tracks the following purchase information:
- Transaction ID: The unique purchase ID from Freemius
- Amount: Purchase amount (handles trials, subscriptions, and one-time purchases)
- Currency: Purchase currency code
- Items: Product information including:
- Product ID (plugin ID)
- Product name
- Plan ID (for subscriptions)
- License quantity
- Price
- Coupon: Coupon code if used
- Customer Data (if enhanced conversions enabled):
- Email address
- First name
- Last name
Enhanced Conversions
When enhanced conversions is enabled, Conversion Bridge automatically includes customer email and name data with purchase events. This data is sent to platforms that support enhanced conversions (such as Google Ads, Meta Ads, or ad platform integrations that support it) to improve conversion tracking accuracy and attributionThe process of determining which channels, campaigns, or actions contributed to a conversion, helping you understand what influenced a visitor’s decision to take action..
Enhanced conversion data is only sent to platforms that support it and is handled according to each platform's privacy requirements.
Still need help?
If you have not yet found your answer in the documentation articles, please contact support
Contact support